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

getrpcinfo - Bitcoin Cash

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

This method returns runtime details about the RPC server, including the commands currently being processed and the path to the debug log.

Parameters

This method does not accept any parameters.

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "getrpcinfo",
    "params": [],
    "id": "getblock.io"
}'
example.js
const axios = require('axios');
const { data } = await axios.post('https://go.getblock.io/<ACCESS-TOKEN>/', {
  jsonrpc: '2.0', method: 'getrpcinfo', params: [], id: 'getblock.io'
});
console.log(data.result.active_commands);
example.py
import requests

response = requests.post(
    'https://go.getblock.io/<ACCESS-TOKEN>/',
    headers={'Content-Type': 'application/json'},
    json={
        'jsonrpc': '2.0',
        'method': 'getrpcinfo',
        'params': [],
        'id': 'getblock.io'
    }
)

print(response.json()['result'])

Response

{
    "result": {
        "active_commands": [
            {
                "method": "getrpcinfo",
                "duration": 1
            }
        ]
    },
    "error": null,
    "id": "getblock.io"
}

Response Parameters

Parameter
Type
Description

error

null|object

Error object when the call fails, otherwise null

id

string

Request identifier matching the request

result

object

Object describing the RPC server runtime state

Result Object

Field
Type
Description

active_commands

array

Commands currently being processed, with durations

logpath

string

Path to the node's debug log file

Use Cases

  • Request Diagnostics: Inspect which RPC commands are currently running

  • Latency Debugging: Read command durations to find slow calls

  • Operations Monitoring: Confirm the RPC server is responsive

  • Support Reporting: Include active-command state in a node bug report

Error Handling

Error Code
Message
Description

-32700

Parse error

Request body is not valid JSON

-32600

Invalid request

The JSON sent is not a valid request object

-32603

Internal error

Node failed to read the requested chain state

Last updated

Was this helpful?