getHealth
Returns the current health of the node.

Parameters

None

Returns

  • <string> - If the node is healthy, returns "ok"; otherwise, a JSON RPC error response is returned.

Example

Request

cURL
1
curl --location --request POST 'https://solana-mainnet.g.alchemy.com/v2/demo' \
2
--header 'Content-Type: application/json' \
3
--data-raw '{
4
"jsonrpc": "2.0",
5
"id": 1,
6
"method": "getHealth"
7
}'
Copied!

Response

Healthy Result
Unhealthy Result
1
{
2
"jsonrpc": "2.0",
3
"result": "ok",
4
"id": 1
5
}
Copied!
1
{
2
"jsonrpc": "2.0",
3
"error": {
4
"code": -32005,
5
"message": "Node is behind by 42 slots",
6
"data": {
7
"numSlotsBehind": 42
8
}
9
},
10
"id": 1
11
}
Copied!