Network
getHealth
Returns the current health status of the node
Parameters
This method does not take any parameters.
Response
One of the following status values:
"ok"
: Node is healthy and up-to-date"behind"
: Node is behind by some number of slots"unknown"
: Node health cannot be determined
Code Examples
Basic Request
Alternative HTTP GET Request
Using web3.js
Notes
- This method is commonly used for load balancer health checks
- The HTTP GET endpoint
/health
provides the same information - A node is considered “behind” if it’s more than
HEALTH_CHECK_SLOT_DISTANCE
slots from the latest cluster slot - The “unknown” status typically indicates the node is bootstrapping or having issues
Best Practices
- Use this endpoint for basic health monitoring
- Implement circuit breakers based on health status
- Consider using more detailed methods for specific health metrics:
getVersion
for software versiongetSlot
for slot progressgetBlockHeight
for block height
- Set appropriate timeouts for health checks
- Handle all possible response values
Common Errors
Code | Message | Solution |
---|---|---|
-32601 | Method not found | Verify you’re connected to a Solana RPC node |
-32603 | Internal error | Node may be experiencing issues |
503 | Service Unavailable | Node is not ready to handle requests |
Use Cases
-
Load Balancer Configuration
-
Health Monitoring
-
Client-Side Load Balancing
-
System Status Dashboard