Checking bitcoin sync status on command line

If anyone runs plane bitcoind (on *nux systems), as in any other case, it will take a while to sync all the blocks from the network. The question is, how can you see what is the current status without using some fancy UI client?

The idea is simple:

  1. Get current local block count
  2. Get the blockcount from blockchain
  3. The difference is what you want

So, one of the possibilities is to create a simple bash script:

Note: when we run bitcoind command we must provide a reference to a valid bitcoin.conf file. So just simply adjust it to the correct path on your system.

Now let’s run it and get the result


Happy syncing :)

Posted in Bitcoin Tagged with: ,
  • Jon Drews

    Had to make a few changes to get this to work (using CentOS 6)


    blockCount=$(bitcoin-cli getblockcount)
    blockChain=$(curl 2>/dev/null)
    if [[ “$blockDiff” = 0 ]];
    echo “up to date”
    echo “$blockDiff blocks behind”
    exit 0