Iterates over Bitcoin blocks, decoding data inside Bitcoin Core's blocks directory.
Features:
* Blocks are returned in height order, it avoids following reorgs (see max_reorg
parameter)
* Blocks come with metadata like all block's previous outputs, it allows computing transactions fee or verifying scripts in the blockchain.
Running iterate example on threadripper 1950X, Testnet @ 2090k, Mainnet @ 709k. Spinning disk.
| Network | --skip--prevout
| --max-reorg
| utxo-db
| Memory | Time |
|---------|-------------------|---------------|----------:|-------:|--------:|
| Mainnet | false | 6 | no | TODO | TODO |
| Mainnet | true | 6 | no | TODO | TODO |
| Mainnet | false | 6 | 1 run | TODO | TODO |
| Mainnet | false | 6 | 2 run | TODO | TODO |
| Testnet | false | 40 | no | 123MB | 3m:03s | | Testnet | true | 40 | no | 1.4GB | 9m:07s | | Testnet | false | 40 | 1 run | 247MB | 16m:12s | | Testnet | false | 40 | 2 run | 221MB | 8m:32s |
Run examples with:
cargo run --release --example iterate
blocks*.dat
while blocks_iterator is doing one pass keeping out-order-blocks in memory (the latter is faster at the expense of higher memory usage)