How to log sizes of each block

1

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

tets1234324

Posted 2017-06-01T18:44:53.370

Reputation: 11

Answers

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

Jonas Schnelli

Posted 2017-06-01T18:44:53.370

Reputation: 5 465