curl --request POST \
--url https://optimism-mainnet.core.chainstack.com/efb0a5eccd2caa5135eb54eba6f7f300 \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"id": 1
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}
curl --request POST \
--url https://optimism-mainnet.core.chainstack.com/efb0a5eccd2caa5135eb54eba6f7f300 \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"id": 1
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}
0x69B5B
means that the block is block 432987 in the blockchain.
none
result
— the integer value of the node’s latest block number is synced to, 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
method in Optimism is for applications that need to be aware of the current block number—some applications may need to be mindful of the current block number to function correctly. For example, a DApp may use the current block number to determine the expiration date of a time-limited offer.The block number information
The response is of type object
.
Was this page helpful?