Cool things to see and do on a bitcoin node

Here is a list of cool things you can see, do and find out on a bitcoin node. Specifically for full nodes running in CLI or daemon mode - not GUI client.

Get Block Count

Get the total number of blocks in your version of the blockchain - the one on your local node. If it is up to date then this will be the number of blocks in total verified on the bitcoin blockchain.

bitcoin-cli getblockcount
685608

Get the time (in UTC not blockheight) a block was mined

Get the hash, get the block verbosely and convert the unix epoch time into human readable. Use the mediantime.

Mediantime is the median time of the past 11 block timestamps

bitcoin-cli getblockhash 100000
bitcoin-cli getblock 000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506 2
date -d @1293622620
Wed 29 Dec 2010 11:37:00 AM UTC

Some dates:

  • block 100,000: Wed 29 Dec 2010 11:37:00 AM UTC
  • block 200,000: Sat 22 Sep 2012 09:57:08 AM UTC
  • block 300,000: Sat 10 May 2014 05:54:38 AM UTC
  • block 400,000: Thu 25 Feb 2016 03:52:57 PM UTC
  • block 500,000: Mon 18 Dec 2017 06:14:46 PM UTC
  • block 600,000: Fri 18 Oct 2019 11:09:37 PM UTC
  • current blockcount 695599: Fri 13 Aug 2021 06:00:35 PM UTC

The number of blocks per gregorean year:

365 days * 24 hours * 6 blocks an hour
52560

Get the Genesis Block

Get the block hash at height 0:

ubuntu@btc:~$ bitcoin-cli getblockhash 0
000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

Verbosely get the block by the hash:

ubuntu@btc:~$ bitcoin-cli getblock 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f 2
{
  "hash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
  "confirmations": 695440,
  "strippedsize": 285,
  "size": 285,
  "weight": 1140,
  "height": 0,
  "version": 1,
  "versionHex": "00000001",
  "merkleroot": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
  "tx": [
    {
      "txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
      "hash": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
      "version": 1,
      "size": 204,
      "vsize": 204,
      "weight": 816,
      "locktime": 0,
      "vin": [
        {
          "coinbase": "04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73",
          "sequence": 4294967295
        }
      ],
      "vout": [
        {
          "value": 50.00000000,
          "n": 0,
          "scriptPubKey": {
            "asm": "04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f OP_CHECKSIG",
            "hex": "4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac",
            "type": "pubkey"
          }
        }
      ],
      "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000"
    }
  ],
  "time": 1231006505,
  "mediantime": 1231006505,
  "nonce": 2083236893,
  "bits": "1d00ffff",
  "difficulty": 1,
  "chainwork": "0000000000000000000000000000000000000000000000000000000100010001",
  "nTx": 1,
  "nextblockhash": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048"
}

Decode the hex field - with the iconic Chancellor on brink evidence

ubuntu@btc:~$ echo “01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000” | xxd -r -p
????M??EThe Times 03/Jan/2009 Chancellor on brink of second bailout for banks?????*CAg????UH'g?q0?\֨(?9 ?yb??a޶I???L?8??U???\8M??
                                                 ?W?Lp+k?_?

Get Info

There are a few ways to get information

bitcoin-cli help | grep info
getblockchaininfo
getmempoolinfo
gettxoutsetinfo ( "hash_type" )
getmemoryinfo ( "mode" )
getrpcinfo
getmininginfo
getaddednodeinfo ( "node" )
getnetworkinfo
getpeerinfo
getdescriptorinfo "descriptor"
getindexinfo ( "index_name" )
getaddressinfo "address"
getwalletinfo