getmempoolinfo - Zcash
Example code for the getmempoolinfo JSON-RPC method. Complete guide on how to use the getmempoolinfo JSON-RPC method in GetBlock.io Web3 documentation.
This method returns aggregate mempool statistics: the number of transactions queued and the memory they occupy.
Parameters
This method takes no parameters.
Request
curl --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"
}'const 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);import 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())Response
{
"jsonrpc": "2.0",
"result": {
"size": 7,
"bytes": 55446,
"usage": 55446
},
"id": "getblock.io"
}Response Parameters
size
integer
Number of transactions in the mempool
bytes
integer
Total serialized size of mempool transactions in bytes
usage
integer
Total memory usage of the mempool in bytes
Use Cases
Mempool Health Monitoring: Alert when
sizeorbytesapproach configured limitsFee Estimation Baselines: Use
mempoolminfeeas a floor for constructing new transactions during congestionCapacity Planning: Track mempool memory usage on self-hosted nodes for resource sizing
Congestion Signals: Compare
bytestomaxmempoolto detect capacity pressure
Error Handling
-32603
Internal error
Node failed to compile the mempool stats
Last updated
Was this helpful?