getmempoolinfo - Zcash

This method returns aggregate mempool statistics: the number of transactions queued and the memory they occupy.

Zebra returns a smaller object than Bitcoin Core's getmempoolinfo. The fee-threshold fields mempoolminfee and minrelaytxfee, and the maxmempool limit, are not present, so a client ported from Bitcoin Core must not depend on them.

Parameters

This method takes no 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": "getmempoolinfo",
    "params": [],
    "id": "getblock.io"
}'

example.js

javascriptconst axios = require('axios');

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

console.log(response.data.result);

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': 'getmempoolinfo',
        'params': [],
        'id': 'getblock.io'
    }
)

print(response.json())

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": "getmempoolinfo",
            "params": [],
            "id": "getblock.io"
        }))
        .send()
        .await?
        .json::<Value>()
        .await?;
    
    println!("Result: {}", response["result"]);
    Ok(())
}

Response

json{
    "jsonrpc": "2.0",
    "result": {
        "size": 7,
        "bytes": 55446,
        "usage": 55446
    },
    "id": "getblock.io"
}

Response Parameters

ParameterTypeDescription
sizeintegerNumber of transactions in the mempool
bytesintegerTotal serialized size of mempool transactions in bytes
usageintegerTotal memory usage of the mempool in bytes

Use Cases

  • Mempool Health Monitoring: Alert when size or bytes approach configured limits
  • Fee Estimation Baselines: Use mempoolminfee as a floor for constructing new transactions during congestion
  • Capacity Planning: Track mempool memory usage on self-hosted nodes for resource sizing
  • Congestion Signals: Compare bytes to maxmempool to detect capacity pressure

Error Handling

Error CodeMessageDescription
-32603Internal errorNode failed to compile the mempool stats