14

How can I view the current size, preferably in bytes, of the blockchain? Is there a CLI command for bitcoind? Or a website that displays the size?

5

If you have the bitcoin client running in server mode, you can pass it the getblockchaininfo command. This is the current output:

{
  "chain": "main",
  "blocks": 525329,
  "headers": 525329,
  "bestblockhash": "000000000000000000192cf4d557fb2265855713b0fd208a6490bca81137bce4",
  "difficulty": 4306949573981.513,
  "mediantime": 1527792344,
  "verificationprogress": 0.9999976722383654,
  "chainwork": "000000000000000000000000000000000000000001e6cf0d64537cc800fc54f8",
  "pruned": false,
  "softforks": [
    {
      "id": "bip34",
      "version": 2,
      "reject": {
        "status": true
      }
    },
    {
      "id": "bip66",
      "version": 3,
      "reject": {
        "status": true
      }
    },
    {
      "id": "bip65",
      "version": 4,
      "reject": {
        "status": true
      }
    }
  ],
  "bip9_softforks": {
    "csv": {
      "status": "active",
      "startTime": 1462060800,
      "timeout": 1493596800,
      "since": 419328
    },
    "segwit": {
      "status": "active",
      "startTime": 1479168000,
      "timeout": 1510704000,
      "since": 481824
    }
  }
}

The blocks field is the current number of blocks in the block chain. You can also get this information from BlockExplorer or use the Direct Link to the block count.

If you want the size in bytes, look at the size of your blk0001.dat file, currently 528Mb.

  • Upvoted. Interesting file size though, mine is only 550MB. – klemen Aug 31 '11 at 9:15
  • Thanks for that correction. I was checking on a machine that had multiple copies of many blocks in it. (Don't ask.) – David Schwartz Aug 31 '11 at 9:37
  • @David Schartz How did you know that there were multiple copies in the block database files? – Flow Aug 31 '11 at 9:42
  • It was due to a bug I introduced while working on the bitcoin client. I didn't realize they were still there. I figured when I fixed the bug, they'd go away. It's strange, the client still works perfectly fine with them there. (I'm cleaning them out now.) – David Schwartz Aug 31 '11 at 9:44
4

Go to http://blockexplorer.com/q/getblockcount.

Other statistics are available at http://blockexplorer.com/q.

  • 1
    Is the block size in bytes always the same or is there something like an average block size? – Flow Aug 31 '11 at 19:31
  • 1
    It depends on how many transactions are in the block. You can find out the size of a block by looking at it on blockexplorer.com. The average size for the last 1000 blocks (which will be not representative of the entire chain) is roughly 22Kb (blockexplorer.com/q/avgblocksize). – Peter Sep 2 '11 at 9:13

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.