How to retrieve latest block height using tendermint rpc

I am going to set up a new node on mainnet following the steps illustrated in [Join the Cosmos Hub Mainnet | Cosmos Hub ]), while the node is syncing with the mainnet, I would like to retrieve the latest block height synced by the node using tendermint rpc from time to time, I couldn’t figure out how to do it, can someone please help? Thanks! and aslo how to get the seeds and persistent peers details

1 Like
  1. curl localhost:26657/status would return latest_block_height field, which is node’s latest block height
  2. curl localhost:26657/block would return the latest block itself.

Replace 26657 with the port your Tendermint RPC is on, if needed.

Hi thank you posting, I am having issues with curl http://127.0.0.1:26657/block
curl: (7) Failed to connect to “127.0.0.1” port 26657 after 0 ms: Connection refused, this is the first time initializing the node using snapshot looks like RPC server is not running, could you help with possible issues ?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.