ZeroCopyZeroCopy
ReferenceHTTP

Check health

GET
/health

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.

Response Body

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/plain
Value in"ok"
Example request
// 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(())
}
Example response
ok