system_version - JSON-RPC Method
Description
Returns the version of the node implementation. This JSON-RPC method provides information about the node software being used, which is useful for compatibility checking and debugging.
Parameters
This method does not require any parameters.
Returns
Field | Type | Description |
---|---|---|
result | string | Version string of the node implementation |
Request Example
{
"jsonrpc": "2.0",
"method": "system_version",
"params": [],
"id": 1
}
Response Example
{
"jsonrpc": "2.0",
"result": "Parity Polkadot/v0.9.43-ba42b9ce51d",
"id": 1
}
Code Examples
JavaScript
const getNodeVersion = async () => {
const response = await fetch('https://api-polkadot.n.dwellir.com', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
jsonrpc: '2.0',
method: 'system_version',
params: [],
id: 1
})
});
const data = await response.json();
return data.result;
};
// Parse version information
const version = await getNodeVersion();
console.log('Node version:', version);
// Extract implementation and version
const [implementation, versionInfo] = version.split('/');
console.log('Implementation:', implementation);
console.log('Version:', versionInfo);
Python
import requests
import json
import re
def get_system_version():
url = "https://api-polkadot.n.dwellir.com"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"jsonrpc": "2.0",
"method": "system_version",
"params": [],
"id": 1
}
response = requests.post(url, headers=headers, data=json.dumps(payload))
return response.json()["result"]
# Parse version
version = get_system_version()
print(f"Full version: {version}")
# Extract components
match = re.match(r"(.+?)/v?([\d.]+)", version)
if match:
implementation = match.group(1)
version_number = match.group(2)
print(f"Implementation: {implementation}")
print(f"Version: {version_number}")
Common Version Formats
Implementation | Example Version | Description |
---|---|---|
Parity Polkadot | Parity Polkadot/v0.9.43 | Official Parity client |
Cumulus | Cumulus/v0.9.420 | Parachain collator |
Substrate Node | Substrate Node/v4.0.0 | Generic Substrate node |
Custom | MyNode/v1.0.0 | Custom implementations |
Use Cases
- Compatibility Checking: Ensure node meets minimum version requirements
- Feature Detection: Determine available features based on version
- Monitoring: Track node versions across infrastructure
- Debugging: Identify version-specific issues
- Analytics: Analyze network node distribution
Related Methods
system_chain
- Get chain namestate_getRuntimeVersion
- Get runtime versionsystem_health
- Get node health statussystem_properties
- Get chain properties