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}| Field | Type | Description |
|---|---|---|
result | string | Always 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}| Field | Type | Description |
|---|---|---|
error.code | number | JSON-RPC error code. Fixed at -32005 for an unhealthy node. |
error.message | string | Human-readable description of the health issue, e.g. slot lag count. |
error.data.numSlotsBehind | number | How many slots behind the cluster tip this node currently is. |