TransWikia.com

How to get blockchain length

Tezos Asked on August 19, 2021

I send rpc calls to a node through tezos-client and I would like to know the length, or the height, of the blockchain so I can see if it is synced and, if not, how much time is remaining. How do I do that?

2 Answers

tezos-client rpc get /chains/main/blocks/head. Look for the value of the level key under the header key in the outputted json.

The output data is quite big, so you can use this:

tezos-client rpc get /chains/main/blocks/head | grep level | head -1

Correct answer by Troels Bjørnskov on August 19, 2021

You can also call tezos-client get timestamp repeatedly: it will give you the timestamp of the most recently received block. You'll get an idea on where you're at and how long you have left to synchronize. If you want to synchronize the full state of the blockchain, this might take a long time. Look into snapshots to get into sync faster. You can find snapshots here.

Answered by arvidj on August 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP