ReferenceHTTP
Check health
GET
Check whether an SWQoS edge can currently reach upcoming leaders; readiness does not guarantee that a transaction will land. A send can still be refused, for example with not_ready. No API key is required. The route returns plain text and uses the same test as getHealth.
Returns ok as plain text when an SWQoS edge can currently reach upcoming leaders; readiness does not guarantee that a transaction will land. A send can still be refused, for example with not_ready. No API key is required. The local agent reports its own state.
response?"ok"text/plainValue in
"ok"// src/bin/http_health.rs
// Builds on the example project (/reference/json-rpc#example-project).
use swqos_examples::swqos::Result;
#[tokio::main]
async fn main() -> Result<()> {
let base = std::env::var("SWQOS_URL").unwrap_or_else(|_| "https://sol.zerocopy.sh".into());
let mut endpoint = reqwest::Url::parse(&base)?;
endpoint.set_path("/health");
endpoint.set_query(None);
// This route does not require an API key.
let response = reqwest::Client::new().get(endpoint).send().await?;
let status = response.status();
let body = response.text().await?;
if !status.is_success() {
return Err(format!("HTTP {status}: {body}").into());
}
println!("{body}");
Ok(())
}ok