getrpcinfo - Bitcoin Cash

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

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "getrpcinfo",
    "params": [],
    "id": "getblock.io"
}'

example.js

javascriptconst axios = require('axios');
const { data } = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
  jsonrpc: '2.0', method: 'getrpcinfo', params: [], id: 'getblock.io'
});
console.log(data.result.active_commands);

example.py

pythonimport requests

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

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

example.rs

rustuse reqwest::Client;
use serde_json::{json, Value};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();

    let response = client
        .post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
        .header("Content-Type", "application/json")
        .json(&json!({
            "jsonrpc": "2.0",
            "method": "getrpcinfo",
            "params": [],
            "id": "getblock.io"
        }))
        .send()
        .await?
        .json::<Value>()
        .await?;

    println!("Result: {}", response["result"]);
    Ok(())
}

Response

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

Response Parameters

ParameterTypeDescription
errornull|objectError object when the call fails, otherwise null
idstringRequest identifier matching the request
resultobjectObject describing the RPC server runtime state

Result Object

FieldTypeDescription
active_commandsarrayCommands currently being processed, with durations
logpathstringPath 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 CodeMessageDescription
-32700Parse errorRequest body is not valid JSON
-32600Invalid requestThe JSON sent is not a valid request object
-32603Internal errorNode failed to read the requested chain state