getClusterNodes
Returns information about all the nodes participating in the cluster
Common use cases
| Validator selector implementation | Build custom validator selection logic by filtering cluster nodes on criteria like version, region proximity (via gossip IP), or RPC availability. Applications needing specific validator characteristics query all nodes and apply selection heuristics. |
| Direct TPU transaction submission | Discover current TPU or TPU-QUIC endpoints for validators to send transactions directly, bypassing RPC relay. Improves latency for high-frequency trading or MEV applications by routing to validator TPU ports. |
| Network upgrade monitoring | Track software version distribution across the cluster to assess upgrade progress or identify lagging validators. Network operators and monitoring services poll periodically to generate version adoption metrics. |
Parameters
No parameters required.
Request
- cURL
- JavaScript
- Python
curl https://solana-mainnet.api.syndica.io/api-key/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getClusterNodes"
}'
// Using fetch
const response = await fetch('https://solana-mainnet.api.syndica.io/api-key/YOUR_API_KEY', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 1,
"method": "getClusterNodes"
})
});
const data = await response.json();
console.log(data);
import requests
import json
url = 'https://solana-mainnet.api.syndica.io/api-key/YOUR_API_KEY'
headers = {'Content-Type': 'application/json'}
data = {
"jsonrpc": "2.0",
"id": 1,
"method": "getClusterNodes"
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
Replace mainnet with devnet in the URL to query devnet instead.
Response
{
"jsonrpc": "2.0",
"result": [
{
"featureSet": 3073396398,
"gossip": "10.239.6.48:8001",
"pubkey": "9QzsJf7LPLj8GkXbYT3LFDKqsj2hHG7TA3xinJHu8epQ",
"rpc": "10.239.6.48:8899",
"shredVersion": 2405,
"tpu": "10.239.6.48:8856",
"version": "1.0.0 c375ce1f"
}
],
"id": 1
}
Response Fields
Return value: array
The result field will be an array of JSON objects, each with the following sub fields:
FAQ and Troubleshooting
Why are some fields null in the response?
Null fields indicate the feature is unavailable for that node. For example, validators without a public RPC endpoint return null for the rpc field. Similarly, nodes may not advertise TPU addresses or version information.
Can I use shredVersion to identify which cluster I'm connected to?
Not reliably. While shredVersion differs per cluster (e.g., mainnet=56177, devnet=38642), it changes after cluster restarts. Use getGenesisHash instead for stable cluster identification with immutable genesis hashes.
What's the difference between gossip and RPC addresses?
Gossip address is the internal cluster communication endpoint (peer-to-peer protocol). RPC address is the public JSON-RPC endpoint for client requests. Validators may have gossip without exposing public RPC.
How do I find the TPU forward port for transaction submission?
Call getClusterNodes and extract the node's contact info. The response includes tpu and tpuForwards addresses. Parse the address to get host and port for direct validator submission.
Related Methods
getGenesisHash
Returns cluster's immutable genesis hash for stable identification. Use with getClusterNodes to verify cluster identity when nodes' shredVersion changes across restarts.
getVoteAccounts
Returns voting status and stake for current and delinquent validators. Combine with getClusterNodes to correlate node contact info with validator stake and voting activity.
getVersion
Returns the RPC node's Solana software version. Compare with getClusterNodes version field to audit consistency or detect version mismatches across cluster.
getHealth
Returns health status of the RPC node. Pair with getClusterNodes when building node selectors to filter healthy endpoints before querying contact information.
External Resources
- Solana Official Documentation
- Solana Gossip Protocol - Explains the gossip network that propagates node contact information returned by getClusterNodes. Useful for understanding gossip vs RPC endpoints.