getblockcount is returning incorrect count I am very new to bitcoin but finally managed to get it all installed and compiled. I am following along with Mastering Bitcoin.

There is an example to use getrawtransaction as follows:

bitcoin-cli getrawtransaction  0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2.

I get the error no such mempool transaction. Using block explorer, this transaction appears in block 277316. 

I noticed that when I run bitcoin-cli getblockcount, I only get 180024, which was mined in 2012. Why am I getting such old data?
I get the error no such mempool transaction. Using block explorer, this transaction appears in block 277316. 


Unless you're running with the -txindex command line option, or a txindex=1 line in your bitcoin.conf file, getrawtransaction only works for mempool transactions (not transactions already in the blockchain).


  I noticed that when I run bitcoin-cli getblockcount, I only get 180024, which was mined in 2012. Why am I getting such old data?


Presumably your bitcoind is still synchronizing with the network. This may take hours (or even days, on slow hardware).