Parameters

This method does not take any parameters.

Response

result
array

Array of objects containing node information:

Code Examples

Basic Request

curl https://rpc.orbitflare.com -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getClusterNodes"
}'

Using web3.js

import { Connection } from '@solana/web3.js';

const connection = new Connection('https://rpc.orbitflare.com');

const nodes = await connection.getClusterNodes();
console.log('Cluster nodes:', nodes);

// Example: Find all nodes running a specific version
const version = '1.16.0';
const nodesWithVersion = nodes.filter(node => node.version === version);
console.log(`Nodes running version ${version}:`, nodesWithVersion);

// Example: Get all RPC endpoints
const rpcEndpoints = nodes
  .filter(node => node.rpc)
  .map(node => node.rpc);
console.log('Available RPC endpoints:', rpcEndpoints);

Notes

  1. Some fields may be null if the information is not available
  2. Node information is obtained through the gossip network
  3. The list includes all known nodes, whether they are currently active or not
  4. Network addresses are in standard socket format (IP:port)

Best Practices

  1. Cache results to reduce RPC load (refresh every few minutes)
  2. Use version information to detect network upgrades
  3. Filter null values when processing network addresses
  4. Consider node versions when selecting RPC endpoints
  5. Use TPU addresses for transaction forwarding optimization

Common Errors

CodeMessageSolution
-32601Method not foundVerify you’re connected to a Solana RPC node
-32007Node information unavailableNode may be bootstrapping or gossip service may be down
-32008Node list too largeTry again later when network conditions improve

Use Cases

  1. Load Balancing

    • Discover available RPC endpoints
    • Distribute client connections
  2. Network Health Monitoring

    • Track node versions
    • Monitor network distribution
    • Identify network partitions
  3. Transaction Optimization

    • Find closest TPU addresses
    • Implement leader-aware transaction forwarding
  4. Version Management

    • Track network upgrades
    • Ensure client compatibility
    • Plan maintenance windows