Explore Courses Blog Tutorials Interview Questions
0 votes
in Blockchain by (4.1k points)

Parity UI displays current block number at the bottom, but if UI is not enabled, then how do we find the current block number?

Is there a way to find current block number

using JSONRPC ?
Is it stored somewhere in basepath?
Note: If anyone can find proper tags, please update it! Currently there is no tag for parity.

1 Answer

0 votes
by (14.4k points)

To get the latest block number over RPC, you can call the 'eth_blockNumber' method. 

See this from the 

// Request

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}'

// Result



  "jsonrpc": "2.0",

  "result": "0x4b7" // 1207


Also, there are other higher-level APIs like web3.js or These allow users to use web3.eth.blockNumber to get the latest block number. These APIs generally work in native types rather than hex strings.

Browse Categories