TriportRPC

getHealth

Last updated:

`getHealth` returns the current health of the node serving your request. It is the cheapest liveness probe on the Solana surface: no parameters, and the result is a single short string. Use it for load-balancer health checks, readiness gates before sending traffic, or to decide whether to fall back to a stricter commitment.

The result is one of three values:

- **`ok`** — the node is within the cluster's accepted slot distance of the highest known slot and is safe to read from. - **`behind`** — the node is lagging: it is *not* within `HEALTH_CHECK_SLOT_DISTANCE` slots of the highest known slot. Reads may return stale data; prefer a `finalized` commitment or retry against a healthy node. - **`unknown`** — the node cannot currently determine its own health (for example, it has not yet established its position relative to the cluster).

A `behind` or `unknown` result is still delivered as a normal JSON-RPC `result` (HTTP 200), not an error — inspect the string value rather than relying on the status code.

Parameters

This method takes no parameters.

Returns

getHealth return value
FieldType
resultstring

Examples

curl https://<your-endpoint>/ \
  -X POST -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"getHealth","params":[]}'
const res = await fetch("https://<your-endpoint>/", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "id": 1,
  "method": "getHealth",
  "params": [],
  "jsonrpc": "2.0"
}),
});
const data = await res.json();
import requests
resp = requests.post("https://<your-endpoint>/", json={"id":1,"method":"getHealth","params":[],"jsonrpc":"2.0"})
print(resp.json())
{
  "id": 1,
  "result": "ok",
  "jsonrpc": "2.0"
}

Usage

  1. Transport: HTTP (JSON-RPC).
  2. Networks: mainnet, devnet, testnet.
  3. Credit cost: 1 per call.

FAQ

What does getHealth do?
Reports whether the serving node is caught up with the cluster.
How many credits does getHealth cost?
getHealth costs 1 credit(s) per call on Triport by default.
Is getHealth available over WebSocket?
getHealth is an HTTP JSON-RPC method.