14
2
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?
14
2
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.
4
Go to http://blockexplorer.com/q/getblockcount.
Other statistics are available at http://blockexplorer.com/q.
1Is the block size in bytes always the same or is there something like an average block size? – Flow – 2011-08-31T19:31:56.567
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 http://blockexplorer.com/. The average size for the last 1000 blocks (which will be not representative of the entire chain) is roughly 22Kb (http://blockexplorer.com/q/avgblocksize).
Upvoted. Interesting file size though, mine is only 550MB. – klemen – 2011-08-31T09:15:30.167
Thanks for that correction. I was checking on a machine that had multiple copies of many blocks in it. (Don't ask.) – David Schwartz – 2011-08-31T09:37:48.697
@David Schartz How did you know that there were multiple copies in the block database files? – Flow – 2011-08-31T09:42:19.703
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 – 2011-08-31T09:44:36.440