curl --request POST \
--url https://aurora-mainnet.core.chainstack.com/6df1a1b3061097e66349993a96b8e535 \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByHash",
"params": [
"0x5db8ff1beb252c1a9cb390ef25af04e2763bdee1bcd48c76977a17148bba503d"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}curl --request POST \
--url https://aurora-mainnet.core.chainstack.com/6df1a1b3061097e66349993a96b8e535 \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByHash",
"params": [
"0x5db8ff1beb252c1a9cb390ef25af04e2763bdee1bcd48c76977a17148bba503d"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}hash — the block hash of the requested block.quantity — an integer value representing how many transactions are included in the block.eth_getBlockTransactionCountByHash code examplesconst { Web3 } = require("web3");
const NODE_URL = "CHAINSTACK_NODE_URL";
const web3 = new Web3(NODE_URL);
async function getTransactionsCount(blockHash) {
const count = await web3.eth.getBlockTransactionCount(blockHash)
console.log(count);
}
getTransactionsCount('0xe1af269d0e3f556bb30f61abb4dc00a678c283bd31e18c87f7f16fde8357ce99')
eth_getBlockTransactionCountByHash is a useful tool for analyzing transaction volume on the Aurora blockchain. On average, a new block is generated on the Aurora mainnet every 1.3 seconds, resulting in approximately 2769 blocks per hour. Using a Web3 library, one can inspect the past 2769 blocks starting from the latest block, retrieve the hash of each block, and use eth_getBlockTransactionCountByHash to find the number of transactions in each block.Was this page helpful?