getClusterNodes — Solana RPC Method
getClusterNodes returns information about all nodes currently participating in the cluster, including their public keys, network addresses, software version, and stake assignment. This is the primary method for discovering the cluster’s topology.
Parameters
This method takes no parameters.
Request
curl -X POST https://api.mainnet-beta.solana.com \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getClusterNodes",
"params": []
}'
TypeScript (@solana/kit)
import { createSolanaRpc } from "@solana/kit";
const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");
const nodes = await rpc.getClusterNodes().send();
console.log(`Total nodes: ${nodes.length}`);
for (const node of nodes.slice(0, 5)) {
console.log(`${node.pubkey} — ${node.version ?? "unknown"}`);
}
Response
{
"jsonrpc": "2.0",
"result": [
{
"pubkey": "9QzsJf7LPLj8GkXbYT3LFDKqsj2hHG7TA3xinJHu8epQ",
"gossip": "10.239.6.48:8001",
"tpu": "10.239.6.48:8856",
"tpuQuic": "10.239.6.48:8858",
"rpc": "10.239.6.48:8899",
"pubsub": null,
"version": "2.2.4",
"featureSet": 4215500110,
"shredVersion": 50093
}
],
"id": 1
}
| Field | Type | Description |
|---|---|---|
pubkey | string | Node’s identity public key (base-58). |
gossip | string or null | Gossip network address. |
tpu | string or null | TPU (Transaction Processing Unit) address for sending transactions via UDP. |
tpuQuic | string or null | TPU address for sending transactions via QUIC. |
rpc | string or null | JSON-RPC endpoint address. null if the node does not serve RPC. |
pubsub | string or null | WebSocket PubSub address. |
version | string or null | Software version the node is running. |
featureSet | u32 or null | Unique identifier for the node’s feature set. |
shredVersion | u16 | Shred version this node has been configured to use. |
Common errors
This method rarely fails since it takes no parameters. The most common issue is a timeout when the cluster has a very large number of nodes and the response is correspondingly large.
Performance
The response includes every node in the cluster — on mainnet this is 1,500+ entries. The response can be 500KB-2MB depending on the cluster size. Cache the result if you need to query it repeatedly; node topology changes slowly. Polling once per minute is sufficient for monitoring.
FAQ
How many nodes does Solana mainnet have? Mainnet typically has 1,500-3,000+ nodes at any given time, including validators, RPC nodes, and other participants.
What is the difference between tpu and tpuQuic?
Both accept transactions. tpu uses UDP, while tpuQuic uses the QUIC protocol. QUIC is the preferred transport for sending transactions on current Solana versions, as it provides better congestion control and staked connection priority.
How do I find which nodes serve RPC?
Filter the results for entries where rpc is not null. However, the listed address may not be publicly accessible — many RPC nodes are behind load balancers or firewalls.
What is shredVersion? The shred version identifies which network the node is participating in. Nodes with different shred versions cannot communicate. This prevents mainnet, testnet, and devnet nodes from interfering with each other.
How do I check if a specific validator is online? Search the results for the validator’s identity pubkey. If it appears in the list, the node is gossiping with the cluster. Note that being in the cluster does not guarantee the node is producing blocks — check getBlockProduction for that.
Updated: