hmy_blockNumber

BlockNumber

Get number of the most recent block.

API v1

Returns

  • String - Index of the most recent block in the chain.

Sample Curl Request

 curl -d '{
  "jsonrpc":"2.0",
  "method":"hmy_blockNumber",
  "params":[],
  "id":1
 }' -H 'Content-Type:application/json' -X POST 'https://api.s0.b.hmny.io'

Sample Curl Response

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x4b0"
}

API v2

Returns

  • uint64 - Index of the most recent block in the chain.

Sample Curl Request

 curl -d '{
  "jsonrpc":"2.0",
  "method":"hmyv2_blockNumber",
  "params":[],
  "id":1
 }' -H 'Content-Type:application/json' -X POST 'http://localhost:9500'

Sample Curl Response

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": 10
}

Last updated