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?

4 Answers 4

19

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.

2
  • how do you accomplish this on a mac?
    – zero_cool
    Oct 29, 2017 at 18:35
  • Or for regtest mode, bitcoin-cli -regtest getblockchaininfo.
    – Jus12
    Nov 30, 2017 at 8:11
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

2
  • 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. Nov 27, 2017 at 20:45
  • ah thanks, was busy copying from the terminal and the numbers look the same. hehe Nov 27, 2017 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)

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

1
  • 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, 2018 at 8:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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