For the complete documentation index, see llms.txt. This page is also available as Markdown.

chain_getRuntimeVersion - Midnight

Example code for the chain_getRuntimeVersion JSON-RPC method. Complete guide on how to use chain_getRuntimeVersion JSON-RPC in GetBlock Web3 documentation.

This method returns the runtime version metadata at a given block (or the current best block if no hash is provided). Runtime version changes during a runtime upgrade.

Parameters

Parameter
Type
Required
Description

hash

string

No

Block hash to query. Defaults to the current best block

Request Example

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "chain_getRuntimeVersion",
    "params": [],
    "id": "getblock.io"
}'

Response Example

{
    "jsonrpc": "2.0",
    "result": {
        "specName": "midnight",
        "implName": "midnight",
        "authoringVersion": 1,
        "specVersion": 22000,
        "implVersion": 0,
        "apis": [
            [
                "0xf78b278be53f454c",
                2
            ],
            [
                "0x279a32908e96410d",
                1
            ],
            [
                "0xbc9d89904f5b923f",
                1
            ],
            [
                "0xdd718d5cc53262d4",
                1
            ],
            [
                "0xa897625b130086bd",
                1
            ],
            [
                "0xfbc577b9d747efd6",
                1
            ],
            [
                "0xdf6acb689907609b",
                5
            ],
            [
                "0x49eaaf1b548a0cb0",
                5
            ],
            [
                "0x393b2599ea57bca2",
                1
            ],
            [
                "0xa0c89371ec56244c",
                1
            ],
            [
                "0xab3c0572291feb8b",
                1
            ],
            [
                "0x2a5e924655399e60",
                1
            ],
            [
                "0x37e397fc7c91f5e4",
                2
            ],
            [
                "0xc3c222f40af6f42b",
                1
            ],
            [
                "0x22a0eaa81c05f0d3",
                1
            ],
            [
                "0x0093e736d7484c30",
                1
            ],
            [
                "0xd9bc84ac3bfb8a0c",
                1
            ],
            [
                "0xd2bc9897eed08f15",
                3
            ],
            [
                "0x40fe3ad401f8959a",
                6
            ],
            [
                "0xed99c5acb25eedf5",
                3
            ],
            [
                "0xc7805fd5ec973a86",
                1
            ],
            [
                "0x19dba14093498f16",
                2
            ],
            [
                "0x7d699da8a672e867",
                5
            ],
            [
                "0x91d5df18b0d2cf58",
                2
            ]
        ],
        "transactionVersion": 2,
        "systemVersion": 1,
        "stateVersion": 1
    },
    "id": "getblock.io"
}

Response Parameters

Field
Type
Description

result.specName

string

Name of the runtime spec

result.implName

string

Name of the runtime implementation

result.specVersion

integer

Spec version — increments on runtime upgrades

result.transactionVersion

integer

Transaction format version

result.apis

array

List of runtime API identifiers and their versions

Use Cases

  • Detecting runtime upgrades

  • Selecting the correct extrinsic format for signing

  • Capability detection in client libraries

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?