curl --request POST \
--url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": []
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}curl --request POST \
--url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": []
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}noneresult — the integer value of the node’s latest block number, encoded as hexadecimal. The block number is used to identify the block’s position in the blockchain and is updated every time a new block is added to the chain.eth_blockNumber code examplesconst { ethers } = require("ethers");
const provider = new ethers.JsonRpcProvider("CHAINSTACK_NODE_URL");
async function getBlockNumber() {
const blockNumber = await provider.getBlockNumber();
console.log(`Latest block: ${blockNumber}`);
}
getBlockNumber();
eth_blockNumber is tracking the current state of the blockchain. Applications can use the current block number to determine time-sensitive operations, such as calculating when a time-locked contract will become executable or monitoring network progress.Was this page helpful?