Skip to main content

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#

FieldTypeDescription
resultstringNode implementation name and version string (e.g., "mythos-node/1.2.3-abc123")

Use Cases#

  1. Compatibility Verification: Ensure connected nodes meet minimum version requirements
  2. Upgrade Monitoring: Track node version distribution across infrastructure
  3. Debug Information: Include version details in error reports and logs
  4. Feature Detection: Determine if specific features are available based on version
  5. Release Management: Coordinate application deployments with node upgrades
  6. 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#

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');
}

Best Practices#

  • Cache node version during initialization and refresh periodically
  • Combine with state_getRuntimeVersion for 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