getVersion
Returns the node's software version string and optional feature set identifier.
Request
curl / JSON-RPC
{ "jsonrpc": "2.0", "id": 1, "method": "getVersion"}Kit
import { createSolanaRpc } from "@solana/kit"; const rpc_url = "https://rpc.openinfra.sh";const rpc = createSolanaRpc(rpc_url); let version = await rpc.getVersion().send(); console.log(version);web3.js
import { Connection } from "@solana/web3.js"; const connection = new Connection("https://rpc.openinfra.sh", "confirmed"); let version = await connection.getVersion(); console.log(version);Rust
use anyhow::Result;use solana_client::nonblocking::rpc_client::RpcClient;use solana_commitment_config::CommitmentConfig; #[tokio::main]async fn main() -> Result<()> { let client = RpcClient::new_with_commitment( String::from("https://rpc.openinfra.sh"), CommitmentConfig::confirmed(), ); let version = client.get_version().await?; println!("{}", version); Ok(())}Parameters
This method takes no parameters.
Response
response.jsonjson
{ "jsonrpc": "2.0", "result": { "solana-core": "3.1.8", "feature-set": 2891131721 }, "id": 1}| Field | Type | Description |
|---|---|---|
| solana-core | string | Node software version string. |
| feature-set | u32 | null | First four bytes of the current software's FeatureSet identifier. May be null if the node does not report a feature set. |