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://triport.io/sol \
  -X POST -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <api-key>' \
  -d '{"id":1,"method":"getHealth","params":[],"jsonrpc":"2.0"}'
const res = await fetch("https://triport.io/sol", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
  body: JSON.stringify({
  "id": 1,
  "method": "getHealth",
  "params": [],
  "jsonrpc": "2.0"
}),
});
const data = await res.json();
import requests
resp = requests.post(
    "https://triport.io/sol",
    headers={"Authorization": "Bearer <api-key>"},
    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.