How to check Bitcoind block chain download progress level

16

5

I have installed bitcoind on ubuntu server, and when I run screen -x for btc it says error -10 blockchain is downloading.

How do I know the progress level? currently 125600 blocks are downloaded, but how many blocks yet to go? where do i check the blockchain download progress level? does it has capability to resume if the server is powered off?

Stephen Paulraj

Posted 2013-05-13T09:02:29.290

Reputation: 161

Answers

12

Do

cd /home/

then

nano block.sh

copy the code below and paste (right click if you use putty) to the script.

#!/bin/bash
while true ; do
    clear
    echo "Press enter to break loop. Script will loop every 3 seconds"
    echo "script by Nixsy 18th august 2013"
    echo "If loop freezes press CTRL+C"
    echo ""
    echo -e "    \033[31mdownloaded\e[0m/\033[32mavailable\e[0m"
    echo -e "    \033[31m"`bitcoin-cli getblockcount 2>&1`"\e[0m"/"\033[32m"`wget -O - http://blockchain.info/q/getblockcount 2>/dev/null`"\e[0m"
    read -t 3 -n 3 && break
done

When you have copied the text to nano hold CTRL+X and then press Y to save.

In terminal type or copy from below followed by the enter key.

chmod +x block.sh

to start the script type.

./block.sh

This is just a little edit of the script from Lohoris, It will clear the screen then loop the script every 3 seconds until a key press.

Credit to Lohoris for the original script.

Nixsy

Posted 2013-05-13T09:02:29.290

Reputation: 121

6

As of 2019, you can use the following script

echo `bitcoin-cli getblockcount 2>&1`/`wget -O - http://blockchain.info/q/getblockcount 2>/dev/null`

o0'.

Posted 2013-05-13T09:02:29.290

Reputation: 5 180

1Using Bitcoin Core Daemon v0.14.0 Error: There is no RPC client functionality in bitcoind anymore. Use the bitcoin-cli utility instead./463021

Simply replace "bitcoind" with "bitcoin-cli" to see progress. – Matt Jensen 2017-04-22T15:03:58.773

4

I just installed bitcoind on an RPi and wanted to do this exact thing. Thought I'd post what worked for me:

$ bitcoin-cli getblockcount
7437

Block height is 366678 at the time of this post...long way to go

Justin O'Brien

Posted 2013-05-13T09:02:29.290

Reputation: 106

2

You can see the current total amount of blocks on public block chain browsers:

Steven Roose

Posted 2013-05-13T09:02:29.290

Reputation: 10 855

2

I wanted a nicer output.

Based off @o0'. answer ...

BC_CURRENT=`./bitcoin-cli getblockcount 2>&1`; BC_HEIGHT=`wget -O - http://blockchain.info/q/getblockcount 2>/dev/null`; perl -E "say sprintf('Block %s of %s (%.2f%%)', $BC_CURRENT, $BC_HEIGHT, ($BC_CURRENT/$BC_HEIGHT)*100)";

Outputs ...

Block 360693 of 471139 (76.56%)

farinspace

Posted 2013-05-13T09:02:29.290

Reputation: 121

Nice! Love the output.raidfive 2017-07-31T00:25:04.607

1

The easiest way is to run birtcoind getinfo, then compare the nHeight to a block explorer, which should give you a ratio of how completed it is. Keep in mind that earlier blocks sync fastest, so 50% of black may not be 50% of the time required to sync.

nuggetbram

Posted 2013-05-13T09:02:29.290

Reputation: 151

1

If you have bitcoin cli installed. The below command will help.

echo `bitcoin-cli getblockcount 2>&1`/`wget -O - http://blockchain.info/q/getblockcount 2>/dev/null`

Sample output

365320/512421

This is slight improvement of above answer. But it returned Error: Command line contains unexpected token 'getblockcount', see bitcoind -h for a list of options./512421 in my case. Hope it helps someone.

SMJ

Posted 2013-05-13T09:02:29.290

Reputation: 121

1

tail -f .bitcoin/debug.log

You will see the progress % in the end of every line.

2019-05-21T15:53:22Z UpdateTip: new best=00000000000007463022a75f47fbce4832d885cccfddc66b9ae6d332888f825d height=181720 version=0x00000001 log2_work=68.184645 tx=3482689 date='2012-05-26T22:08:18Z' progress=0.008422 cache=256.7MiB(1838887txo)

Here, in case you did not find it above:

... progress=0.008422 ...

Luciano Bargmann

Posted 2013-05-13T09:02:29.290

Reputation: 11