<p>What you can do it traverse back from the chain tip via RPC:</p>

<ol>
<li>call <code>getbestblockhash</code> (RPC)</li>
<li>Use blockhash to call <code>getblock</code> (RPC)</li>
<li>Read <code>size</code> -> store it somewhere (CSV file, etc.)</li>
<li>Read <code>previousblockhash</code> and use it as blockhash for <code>getblock</code></li>
<li>Goto step 2</li>
</ol>

CC BY-SA 3.0
2017-06-02T18:40:05.723Z
2017-06-02T18:40:05.723Z
Jonas Schnelli
<p>I am looking to do some research on the blockchain, is there anyway to easily the size of each block while i download it - i have seen graphs from coinbase etc, but these are not accurate for me as for the first 12 months they put the blockchain size as 0MB - Any ideas welcome, i have looked through the log file of bitcoin during the download and while it gives me data about the number of tx in the block etc it doesn't contain the size</p>

<bitcoind>
How to log sizes of each block
tets1234324
# How to log sizes of each block

(Asked by: username_0 on 2017-06-01)

I am looking to do some research on the blockchain, is there anyway to easily the size of each block while i download it - i have seen graphs from coinbase etc, but these are not accurate for me as for the first 12 months they put the blockchain size as 0MB - Any ideas welcome, i have looked through the log file of bitcoin during the download and while it gives me data about the number of tx in the block etc it doesn't contain the size

**Tags:** bitcoind


---

## 1 answers

### Answer by username_1 on 2017-06-02. Score: 1

What you can do it traverse back from the chain tip via RPC:

1. call `getbestblockhash` (RPC)
2. Use blockhash to call `getblock` (RPC)
3. Read `size` -> store it somewhere (CSV file, etc.)
4. Read `previousblockhash` and use it as blockhash for `getblock`
5. Goto step 2


---

