How can I find out what the highest block is?

  • I'm syncing up a new node. How can I find out what the latest block is so that I know how far I've got to go?

    I have started to sync since 15 days ago and today I think I passed the highest block 4741144 I downloaded 4741185 of 4741144 but ethereum node started to downloaded chain data. does anybody know how many chain structure needs to download to full sync. my computer already downloaded about 10 M chain structure after reaching to highest block.

  • eth

    eth Correct answer

    5 years ago

    For Geth, in another terminal, attach to the Geth console, such as geth attach. This will allow you to keep your syncing node running, without restarting, and you will not see the noisy logs as you would if you simply ran "geth console" without other parameters.

    In the console, run eth.syncing

    > eth.syncing
    {
      currentBlock: 745600,
      highestBlock: 889152,
      startingBlock: 745553
    }
    

    You can then see where you are (currentBlock), and the block you still have to reach (highestBlock). (The difference between them is the number of blocks you have left remaining.)

    You can run eth.syncing a few times to check your progress, and it will return false when done. You can then use eth.blockNumber and also compare with a blockchain explorer, as other answers here mention.

    Thanks for the answer, just note that `geth attach` doesn't work if you have the `--mine` flag specified (for test chains) so if you use that you should also probably use a mining script

    I use `geth` version 1.4.6 and `eth.syncing` just returns `true` or `false`. What's the new version of the `eth.syncing` command?

    @TMOTTM It might be a bug and I suggest "New issue" at https://github.com/ethereum/go-ethereum/issues

    more info was added to the output but this is still a valid way to check.

    Function `web3.eth.isSyncing()` will return `false` **also** when syncing has not yet started (or is currently not running). So one cannot rely solely on this function in order to determine the status of the Ethereum client. As you mentioned, probably need to combine the results of `web3.eth.getBlockNumber()` and a blockchain explorer into the decision-making.

License under CC-BY-SA with attribution


Content dated before 7/24/2021 11:53 AM