blockchain - Get current block number in `paritytech/parity` -
parity ui displays current block number @ bottom, if ui not enabled, how find current block number?
is there way find current block number
- using jsonrpc ?
- is stored somewhere in basepath?
note: if can find proper tags, please update it! there no tag parity
.
you can latest block number on rpc calling 'eth_blocknumber' method.
from json rpc docs:
returns number of recent block.
// request curl -x post --data '{"jsonrpc":"2.0","method":"eth_blocknumber","params":[],"id":83}' // result { "id":83, "jsonrpc": "2.0", "result": "0x4b7" // 1207 }
there other, higher level apis might interested in, web3.js or web3.py. both allow use web3.eth.blocknumber
latest block number, , work in native types rather hex strings.
Comments
Post a Comment