Network
getClusterNodes
Returns information about all the nodes participating in the cluster
Parameters
This method does not take any parameters.
Response
Array of objects containing node information:
Code Examples
Basic Request
Using web3.js
Notes
- Some fields may be
null
if the information is not available - Node information is obtained through the gossip network
- The list includes all known nodes, whether they are currently active or not
- Network addresses are in standard socket format (IP:port)
Best Practices
- Cache results to reduce RPC load (refresh every few minutes)
- Use version information to detect network upgrades
- Filter null values when processing network addresses
- Consider node versions when selecting RPC endpoints
- Use TPU addresses for transaction forwarding optimization
Common Errors
Code | Message | Solution |
---|---|---|
-32601 | Method not found | Verify you’re connected to a Solana RPC node |
-32007 | Node information unavailable | Node may be bootstrapping or gossip service may be down |
-32008 | Node list too large | Try again later when network conditions improve |
Use Cases
-
Load Balancing
- Discover available RPC endpoints
- Distribute client connections
-
Network Health Monitoring
- Track node versions
- Monitor network distribution
- Identify network partitions
-
Transaction Optimization
- Find closest TPU addresses
- Implement leader-aware transaction forwarding
-
Version Management
- Track network upgrades
- Ensure client compatibility
- Plan maintenance windows