16

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?

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.

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`
  • 1
    Using 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 Apr 22 '17 at 15:03
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

2

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

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%)
  • Nice! Love the output. – raidfive Jul 31 '17 at 0:25
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.

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.

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 ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.