TriportRPC

getHealth

POSThttps://api.triport.io/v1/sol

Reports whether the serving node is caught up with the cluster.

Solanasol_read_rpcfree+ — 20 / 60 / 200 / 600 RPS (free / basic / pro / business)

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

None. Send an empty positional array, params: [].

optional
This method takes no parameters.

Response

Response fields

FieldTypeDescription
resultstringNode health: "ok", "behind", or "unknown".

Errors

Errors are returned in the standard JSON-RPC error envelope. See the shared errors reference for the full envelope shape and shared codes.

CodeMeaningWhen it happens
401UnauthorizedMissing or invalid Authorization: Bearer key.
429Rate limitedMore than your tier's RPS for sol_read_rpc (20 / 60 / 200 / 600).

Note: a lagging node reports "behind" as a successful result, not as a JSON-RPC error — there is no dedicated health error code.

Examples

JavaScript (fetch)

const res = await fetch("https://api.triport.io/v1/sol", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "getHealth",
    params: [],
  }),
});


const { result } = await res.json();
if (result !== "ok") {
  console.warn(`Node not healthy: ${result}`);
}

TypeScript SDK (@triport/sdk)

import { TriportClient } from "@triport/sdk";


const client = new TriportClient({ apiKey: process.env.TRIPORT_API_KEY });


const health = await client.solana.getHealth();


if (health !== "ok") {
  console.warn(`Node not healthy: ${health}`);
}

Python (triport-sdk)

import os
from triport import TriportClient


client = TriportClient(api_key=os.environ["TRIPORT_API_KEY"])


health = client.solana.get_health()


if health != "ok":
    print(f"Node not healthy: {health}")

Notes

  • Cheapest health check: getHealth takes no params and returns a single string — prefer it over getSlot or getEpochInfo when you only need a yes/no liveness signal.
  • behind threshold: the node is reported behind when it falls more than HEALTH_CHECK_SLOT_DISTANCE slots short of the highest known slot. The exact distance is set on the serving node, so treat behind as "do not rely on this node for fresh reads" rather than a fixed slot count.
  • Polling: when using this as a load-balancer probe, mind the sol_read_rpc RPS limits for your tier so health checks don't consume your throughput budget.
  • Related methods: getSlot returns the node's current slot and getEpochInfo reports both absoluteSlot and blockHeight if you need the actual lag magnitude rather than a health label.