Get current block number in `paritytech/parity`

Viewed 2963

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.

2 Answers

Using the answer posted by @carver I was able to get only the current block number in decimal form, my RPC port is 8545(default):

echo $((`curl --data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545 | grep -oh "\w*0x\w*"`))
Related