17

I have started bitcoind on my linux box. How can I ask it what its status is? I assume it is downloading the blockchain and will continue to do so for hours or days. How can I find out where it is in this process?

Murch
  • 71,155
  • 33
  • 180
  • 600
Harry Pillsbury
  • 988
  • 1
  • 6
  • 20

4 Answers4

18

I found the easiest way to do this (version 0.12) is to issue the command (not case sensitive):

bitcoin-cli getblockchaininfo

Then, compare the blocks received field, to the headers field. The blocks received should increase steadily until it matches the headers field, at which point the client is synced.

Once the client is synced you can check if the client is accepting inbound transactions by issuing the command:

bitcoin-cli getconnectioncount 

If you have 0 connections, something is wrong. If you have 8 connections, then it means you are only doing outbound connections (which might be the case if you just want to use your client to execute your own personal transactions, not verify everyone else's). If you have more than 8 connections, then it means you are accepting inbound connections and are acting as a full node (good for you).

Two additional ways to get information about your node is to use GetNetTotals which returns information about network traffic, including bytes in, bytes out, and the current time, and GetNetworkInfo which provides information about your connections to other nodes.

Harry Pillsbury
  • 988
  • 1
  • 6
  • 20
11

You can also just tail the debug.log file in a new terminal window while bitcoind is running. It shows current block height i.e. height=181888 and percentage of download complete i.e. progress=68.189662 and keeps running in the window, so you see the progress.

On Linux: tail -f ~/.bitcoin/debug.log

On Mac: tail -f $HOME/Library/Application\ Support/Bitcoin/debug.log

Herald Smit
  • 210
  • 2
  • 7
  • 2
    log2_work is not a percentage of progress. It indicates how much the cummulative hashrate of the network is. For progress look at the 'progress=0..." field. – Pieter Wuille Nov 27 '17 at 20:45
  • ah thanks, was busy copying from the terminal and the numbers look the same. hehe – Herald Smit Nov 27 '17 at 20:48
7

run bitcoind getinfo, compare the block count to the current block height of several major block explorers such as:

https://blockchain.info/

https://www.blocktrail.com/BTC

https://blockexplorer.com/

http://blockr.io/

If your block count matches the block height from those sites, your block chain is in sync. If it does not match the difference in block height is how far you are behind (approximately 10 minutes per block)

Jane Miner
  • 266
  • 1
  • 3
3

bitcoin-cli getinfo will display the information you're looking for,

OR simply bitcoin-cli getblockcount and compare the blockcount in your machine with the one in a block-explorer online

jgm
  • 758
  • 5
  • 21
  • 2
    This call was removed in version 0.16.0. Use the appropriate fields from: - getblockchaininfo: blocks, difficulty, chain - getnetworkinfo: version, protocolversion, timeoffset, connections, proxy, relayfee, warnings - getwalletinfo: balance, keypoololdest, keypoolsize, paytxfee, unlocked_until, walletversion – SWD Mar 16 '18 at 08:27