getClusterNodes – Solana
The getClusterNodes JSON-RPC method retrieves information about all nodes participating in the Solana cluster.
The getClusterNodes RPC Solana method returns an array of JSON objects containing details about each active node in the cluster.
The returned data includes the node’s public key, network addresses, software version, feature set, and shred version. This information is crucial for developers, validators, and network analysts to assess node distribution, connectivity, and operational details.
Supported Networks
This method is accessible through Solana API endpoints:
Mainnet
Devnet
Parameters
This method does not require any parameters.
Request Example
API Endpoints
cURL Example
Response
A successful getClusterNodes example response returns an array of objects detailing each node in the cluster.
The response includes:
pubkey (string): Base-58 encoded node public key.
gossip (string|null): Gossip network address of the node.
tpu (string|null): TPU network address of the node.
rpc (string|null): JSON-RPC network address (if the node has an active RPC service).
version (string|null): Software version running on the node.
featureSet (u32|null): Unique identifier for the node's feature set.
shredVersion (u16|null): Shred version configured for the node.
Example Response
Error Handling
Common getClusterNodes error scenarios:
Network connectivity issues: The request fails due to Solana RPC unavailability.
Invalid request format: If the request is improperly structured.
Example Error Response
Use Cases
The Solana getClusterNodes method is essential for:
Network monitoring: Observing node connectivity and distribution.
Validator tracking: Checking node software versions and infrastructure.
Web3 applications: Ensuring proper RPC availability for dApps.
Infrastructure analysis: Gathering metadata on the cluster’s performance and configuration.
Code Example – Web3 getClusterNodes Integration
Integration with Web3
Integrate the getClusterNodes API with Solana’s Core API to dynamically retrieve real-time network data. By leveraging JSON-RPC parameters and endpoints, developers can gain deep insights into cluster activity, ensuring robust infrastructure for blockchain applications and validator operations.
Last updated