getClusterNodes RPC Method
Parameters
This method does not accept any parameters
Returns
featureSet
Loading...
gossip
Loading...
pubkey
Loading...
rpc
Loading...
shredVersion
Loading...
tpu
Loading...
version
Loading...
Request
curl https://docs-demo.solana-devnet.quiknode.pro/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0", "id":1, "method":"getClusterNodes"}'require "uri"
require "json"
require "net/http"
url = URI("https://docs-demo.solana-mainnet.quiknode.pro/")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"jsonrpc": "2.0",
"id": 1,
"method": "getClusterNodes"
})
response = https.request(request)
puts response.read_body
import { createSolanaRpc } from "@solana/kit";
(async () => {
const solanaRpc = createSolanaRpc("https://docs-demo.solana-mainnet.quiknode.pro/");
try {
const clusterNodes = await solanaRpc.getClusterNodes().send();
console.log(clusterNodes);
} catch (error) {
console.error("Error fetching cluster nodes:", error);
}
})();const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://docs-demo.solana-mainnet.quiknode.pro/");
console.log(await solana.getClusterNodes());
})();
from solana.rpc.api import Client
solana_client = Client("https://docs-demo.solana-mainnet.quiknode.pro/")
print(solana_client.get_cluster_nodes())use reqwest::header;
use reqwest::Client;
use std::error::Error;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let mut headers = header::HeaderMap::new();
headers.insert("Content-Type", "application/json".parse().unwrap());
let client = Client::new();
let json_data = r#"
{
"jsonrpc": "2.0",
"id": 1,
"method": "getClusterNodes"
}
"#;
let response = client
.post("https://docs-demo.solana-mainnet.quiknode.pro/")
.headers(headers)
.body(json_data)
.send()
.await?;
let body = response.text().await?;
println!("{}", body);
Ok(())
}
Response
{
"jsonrpc": "2.0",
"result": [
{
"gossip": "10.239.6.48:8001",
"pubkey": "9QzsJf7LPLj8GkXbYT3LFDKqsj2hHG7TA3xinJHu8epQ",
"rpc": "10.239.6.48:8899",
"tpu": "10.239.6.48:8856",
"version": "1.0.0 c375ce1f"
}
],
"id": 1
}Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free