system_version – Mythos JSON-RPC Method
Description#
Returns the software version string of the connected Mythos node implementation. This method provides the client version information including the node software name, version number, and build information. The version string is essential for compatibility checks, debugging, upgrade planning, and ensuring your application works with the expected node software version. Combined with runtime version information, it gives complete visibility into the node's software stack.
Parameters#
This method does not require any parameters.
Returns#
| Field | Type | Description |
|---|---|---|
result | string | Node implementation name and version string (e.g., "mythos-node/1.2.3-abc123") |
Use Cases#
- Compatibility Verification: Ensure connected nodes meet minimum version requirements
- Upgrade Monitoring: Track node version distribution across infrastructure
- Debug Information: Include version details in error reports and logs
- Feature Detection: Determine if specific features are available based on version
- Release Management: Coordinate application deployments with node upgrades
- Support Diagnostics: Quickly identify node versions when troubleshooting issues
Request Example#
curl -s https://api-mythos.n.dwellir.com/YOUR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "system_version",
"params": [],
"id": 1
}'
Response Example#
{
"jsonrpc": "2.0",
"result": "mythos-node/1.2.3-abc123def",
"id": 1
}
Code Examples#
- TypeScript (@polkadot/api)
- Python
- JavaScript
import { ApiPromise, WsProvider } from '@polkadot/api';
const api = await ApiPromise.create({
provider: new WsProvider('wss://api-mythos.n.dwellir.com/YOUR_API_KEY')
});
const nodeVersion = await api.rpc.system.version();
const runtimeVersion = await api.rpc.state.getRuntimeVersion();
console.log(`Node: ${nodeVersion.toString()}`);
console.log(`Runtime: ${runtimeVersion.specName}/${runtimeVersion.specVersion}`);
// Parse version for comparison
function parseVersion(versionString: string) {
const match = versionString.match(/(\d+)\.(\d+)\.(\d+)/);
if (match) {
return {
major: parseInt(match[1]),
minor: parseInt(match[2]),
patch: parseInt(match[3])
};
}
return null;
}
const version = parseVersion(nodeVersion.toString());
if (version && version.major >= 1 && version.minor >= 2) {
console.log('Node meets minimum version requirements');
}
import requests
import json
import re
def get_node_version():
url = "https://api-mythos.n.dwellir.com/YOUR_API_KEY"
payload = {
"jsonrpc": "2.0",
"method": "system_version",
"params": [],
"id": 1
}
response = requests.post(url, json=payload)
return response.json()["result"]
def parse_version(version_string):
match = re.search(r'(\d+)\.(\d+)\.(\d+)', version_string)
if match:
return {
'major': int(match.group(1)),
'minor': int(match.group(2)),
'patch': int(match.group(3))
}
return None
node_version = get_node_version()
print(f"Node version: {node_version}")
version = parse_version(node_version)
if version:
print(f"Major: {version['major']}, Minor: {version['minor']}, Patch: {version['patch']}")
# Check minimum version requirement
if version['major'] >= 1 and version['minor'] >= 2:
print("✓ Node meets minimum version requirements")
else:
print("✗ Node version too old, upgrade required")
async function getNodeVersion() {
const response = await fetch('https://api-mythos.n.dwellir.com/YOUR_API_KEY', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
method: 'system_version',
params: [],
id: 1
})
});
const data = await response.json();
return data.result;
}
async function getSystemInfo() {
const version = await getNodeVersion();
console.log(`Connected to: ${version}`);
// Extract version numbers
const versionMatch = version.match(/(\d+)\.(\d+)\.(\d+)/);
if (versionMatch) {
const [, major, minor, patch] = versionMatch;
console.log(`Version: ${major}.${minor}.${patch}`);
// Version comparison
if (parseInt(major) >= 1 && parseInt(minor) >= 2) {
console.log('✓ Compatible version detected');
}
}
}
await getSystemInfo();
Best Practices#
- Cache node version during initialization and refresh periodically
- Combine with
state_getRuntimeVersionfor complete version information - Implement version checks before using version-specific features
- Log node version in application startup logs for troubleshooting
- Set up alerts when nodes are running outdated versions
- Parse version strings carefully as format may vary between implementations
- Include version information in bug reports and support requests
Related Methods#
state_getRuntimeVersion- Get runtime version informationsystem_properties- Get chain propertiesrpc_methods- List available RPC methodssystem_chain- Get chain name