Substrate and Custom JSON-RPC Endpoints

rpc_methods

The list of RPC methods that are exposed by the node

Method: POST

https://moonbeam.nownodes.io

Example body (raw)

{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "rpc_methods",
    "params": []
}

Example response: 200

{
    "jsonrpc": "2.0",
    "result": {
        "methods": [
            "account_nextIndex",
            "author_hasKey",
            "author_hasSessionKeys",
            "author_insertKey",
            "author_pendingExtrinsics",
            "author_removeExtrinsic",
            "author_rotateKeys",
            "author_submitAndWatchExtrinsic",
            "author_submitExtrinsic",
            "author_unwatchExtrinsic",
            "chainHead_unstable_body",
            "chainHead_unstable_call",
            "chainHead_unstable_continue",
            "chainHead_unstable_follow",
            "chainHead_unstable_header",
            "chainHead_unstable_stopOperation",
            "chainHead_unstable_storage",
            "chainHead_unstable_unfollow",
            "chainHead_unstable_unpin",
            "chain_getBlock",
            "chain_getBlockHash",
            "chain_getFinalisedHead",
            "chain_getFinalizedHead",
            "chain_getHead",
            "chain_getHeader",
            "chain_getRuntimeVersion",
            "chain_subscribeAllHeads",
            "chain_subscribeFinalisedHeads",
            "chain_subscribeFinalizedHeads",
            "chain_subscribeNewHead",
            "chain_subscribeNewHeads",
            "chain_subscribeRuntimeVersion",
            "chain_unsubscribeAllHeads",
            "chain_unsubscribeFinalisedHeads",
            "chain_unsubscribeFinalizedHeads",
            "chain_unsubscribeNewHead",
            "chain_unsubscribeNewHeads",
            "chain_unsubscribeRuntimeVersion",
            "childstate_getKeys",
            "childstate_getKeysPaged",
            "childstate_getKeysPagedAt",
            "childstate_getStorage",
            "childstate_getStorageEntries",
            "childstate_getStorageHash",
            "childstate_getStorageSize",
            "eth_accounts",
...

chain_getBlock

The header and body of a block as specified by the block hash parameter

Method: POST

https://moonbeam.nownodes.io

Example body (raw)

{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "chain_getBlock",
    "params": [
        "0x574cef67650636211dbdd4bfa2baff122f9a9076369a843a81d064f45229e096"
    ]
}

Example response: 200

{
    "jsonrpc": "2.0",
    "result": null,
    "id": 1
}

chain_getHeader

The block hash of the last finalized block in the canonical chain

Method: POST

https://moonbeam.nownodes.io

Example body (raw)

{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "chain_getHeader",
    "params": []
}

Example response: 200

{
    "jsonrpc": "2.0",
    "result": {
        "parentHash": "0x6f25d067d9e0fa6270d5205c55ac61019769ce5da6b1596ed49cc59999c03038",
        "number": "0x5c9ad7",
        "stateRoot": "0xdbe2998a5747cd0e59227b28a4ac2176aee65606d8f9a7d3b31d1608b427cc38",
        "extrinsicsRoot": "0x6dc7147858f9828cc82b6f554d70dda276ca8e67ec84740a99867fe3a16406dc",
        "digest": {
            "logs": [
                "0x066e6d627380b2ca4e73dff5d5010727c46273228a41228070df5406adc2b04701add98dc217",
                "0x0672616e6481010e7f17169d1618a27276b3cf3bc222969693781f5ca0a191a320e95090e93d3e958851db08c22ec2cbdf715782de3a58e1dc7e9b3a088231ec6ace3eb4626a06f8162d34966364d03754135f9afeebf3e2f4823dca6137def4a55b6e2222af08",
                "0x04525053529097a8b1b4dd3e2d29c50484c0a54c384095d8cc99d3aa49e5cd9abdc269b7fd507a30e904",
                "0x0466726f6e890401fef2138a473e28f392f1b7179d96db87a739452ac19e38f6ae888182e6008778205924e4547f3c018ef3024b2318d100a11901d76750c6bdcf7da65df166834ae8ac8a9ace3361760bf20857df7d419a8656488047a0064a4051672f72d5ad998081f0570bc34ab0c033e9d51d60bbd5ff7d8f2a9b4f332ccbf48418e5f436ea3fdf420377129b43d3b15fd13be13f6eb29f7fd50206fd330b3d60683e5ea96eef970c291f116437d11e25b42e022e980aabb47fb5228c06581f7fb1ca23a42bdf3a9be108e7a3827b5a6561da2285728fe2af33fffab578cadc70cd6227e14ba02734cfb2214745b7727937a0be62b0453ebe0810e398d3ae61a1447bfe06695068d717f2c3a4143febdef52f463208c7d6f8f7b2729859a3811be85e5aec9431",
                "0x056e6d62730101b2d76cc2da44c334fa3ece16d7f5df10eb21588dc8193905a4f2dc8d0dcf0b01890cdd0c0244220d2dfbf52c01a0aa6934971d2c40073fa5d41ea0020180e58f"
            ]
        }
    },
    "id": 1
}

Last updated