OpenInfra.sh is now live - Solana infrastructure, included with every server. LEARN MORE HERE >

OpenInfra.shopeninfra.sh

getHealth

Returns whether this RPC node is healthy. The node reports healthy when it is within the configured slot distance of the cluster tip.

Request

{  "jsonrpc": "2.0",  "id": 1,  "method": "getHealth"}

Response

Healthy — result

When the node is within the configured slot distance of the cluster tip, the response contains a result field set to the string "ok".

{  "jsonrpc": "2.0",  "result": "ok",  "id": 1}
FieldTypeDescription
resultstringAlways the string "ok" when the node is healthy.

Unhealthy — error

When the node is too far behind the cluster tip, the response contains an error object instead of a result.

{  "jsonrpc": "2.0",  "error": {    "code": -32005,    "message": "Node is behind by 42 slots",    "data": { "numSlotsBehind": 42 }  },  "id": 1}
FieldTypeDescription
error.codenumberJSON-RPC error code. Fixed at -32005 for an unhealthy node.
error.messagestringHuman-readable description of the health issue, e.g. slot lag count.
error.data.numSlotsBehindnumberHow many slots behind the cluster tip this node currently is.