eth_blockNumber - Celo
Example code for the eth_blockNumber JSON-RPC method. Complete guide on how to use eth_blockNumber JSON-RPC in GetBlock Web3 documentation.
This method returns the number of the most recent block on the Celo network. This is a fundamental method for tracking blockchain state, monitoring network progress, and determining transaction finality. With Celo's ~1 second block times, this value updates rapidly.
Parameters
None
Request Example
curl -X POST https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/ \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "getblock.io",
"method": "eth_blockNumber",
"params": []
}'const axios = require('axios');
const url = 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/';
const payload = {
jsonrpc: '2.0',
id: 'getblock.io',
method: 'eth_blockNumber',
params: []
};
axios.post(url, payload, {
headers: { 'Content-Type': 'application/json' }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));Response Example
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": "0x1d9f2a8"
}Response Parameters Definition
result
string
Hexadecimal block number (e.g., "0x1d9f2a8" = 31,130,280)
Use Cases
Monitor blockchain synchronization status
Calculate transaction confirmations
Track network liveness and progress
Implement block-based polling for updates
Determine finality for transactions
Error Handling
-32603
Internal error - node processing issues
-32000
Server error - RPC endpoint unavailable
SDK Integration
Last updated
Was this helpful?