getVersion
Learn getVersion use cases, code examples, request parameters, response structure, and tips.
The getVersion
RPC method in CoinVera returns the software version of the Solana node responding to the request. This includes the solana-core
version string and a feature-set
identifier, making it a valuable tool for diagnostics, compatibility checks, and monitoring.
✅ Common Use Cases
Node Version Verification Confirm the version of the CoinVera RPC node you’re communicating with—for feature support or SDK compatibility.
Network Monitoring Periodically query node versions across the network (use
getClusterNodes
for broader insight).Troubleshooting and Debugging Determine if issues may be version-specific by identifying the exact software build of the node.
🧾 Request Parameters
This method does not take any parameters.
[]
📦 Response Structure
{
"solana-core": "1.17.9",
"feature-set": 123456789
}
solana-core: The version string of the Solana software running on the node.
feature-set: An internal identifier corresponding to the set of features enabled in this version.
🧪 Example
Get Current Node Version
{
"jsonrpc": "2.0",
"id": 1,
"method": "getVersion"
}
Response:
{
"jsonrpc": "2.0",
"result": {
"solana-core": "1.17.9",
"feature-set": 123456789
},
"id": 1
}
Code Examples
const fetch = require('node-fetch');
async function getVersion(rpcUrl) {
try {
const response = await fetch(rpcUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'getVersion'
}),
});
const data = await response.json();
// Print the exact full response
console.log('Full RPC Response:');
console.log(JSON.stringify(data, null, 2));
return data;
} catch (error) {
console.error('Error getting health:', error.message);
return null;
}
}
// Example usage
const RPC_URL = 'https://rpc.coinvera.io/?x-api-key=your-coinvera-x-api-key';
getVersion(RPC_URL);
Example Response
{
"jsonrpc": "2.0",
"result": {
"feature-set": 3073396398,
"solana-core": "2.2.16"
},
"id": 1
}
💡 Developer Tips
Simple and Fast This is one of the quickest RPC calls—ideal for lightweight health checks or CLI tools.
Version Is Node-Specific The version returned reflects the specific CoinVera RPC node you're querying. During network upgrades, other nodes may be running different versions.
Use Feature Set for Compatibility While version strings are useful, the
feature-set
number can be important for programmatic checks or runtime gating of features.
The getVersion
method is a simple yet effective way to verify Solana software versions and ensure you're interacting with a compatible and up-to-date CoinVera node.
Last updated