> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orbitflare.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getClusterNodes

> Returns information about all the nodes participating in the cluster

## Parameters

This method does not take any parameters.

## Response

<ResponseField name="result" type="array">
  Array of objects containing node information:

  <Expandable title="result fields">
    <ResponseField name="pubkey" type="string">
      Node public key (base-58)
    </ResponseField>

    <ResponseField name="gossip" type="string | null">
      Gossip network address for the node
    </ResponseField>

    <ResponseField name="tpu" type="string | null">
      TPU network address for the node
    </ResponseField>

    <ResponseField name="rpc" type="string | null">
      JSON RPC network address for the node
    </ResponseField>

    <ResponseField name="version" type="string | null">
      Software version of the node
    </ResponseField>

    <ResponseField name="featureSet" type="number | null">
      Unique identifier of the node's feature set
    </ResponseField>

    <ResponseField name="shredVersion" type="number | null">
      The shred version the node has been configured to use
    </ResponseField>
  </Expandable>
</ResponseField>

## Code Examples

### Basic Request

```bash theme={null}
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getClusterNodes"
}'
```

### Using web3.js

```typescript theme={null}
import { Connection } from '@solana/web3.js';

const connection = new Connection('https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY');

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

| 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

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
