Iterates over Bitcoin blocks, decoding data inside Bitcoin Core's blocks directory.
- Blocks are returned in height order, it avoids following reorgs (see
- Blocks come with metadata like all block's previous outputs, it allows computing transactions fee.
Memory requirements and performance
Running iterate example on threadripper 1950X, Testnet @ 1970k, Mainnet @ 681k
Run examples with:
cargo run --release --example iterate
- iterate iterate over blocks and print block fee
- heaviest find the transaction with greatest weight
- most_output find the transaction with most output
- bitcoin-iterate this project inspired blocks_iterator, the differences are:
- bitcoin-iterate is C-based
- bitcoin-iterate it's more suited for shell piping, while blocks_itearator is intended to use as a rust library
- bitcoin-iterate doesn't give previous outputs information
- bitcoin-iterate is making two passage over
blocks*.datwhile blocks_iterator is doing one pass keeping out-order-blocks in memory (the latter is faster at the expense of higher memory usage)
- rust-bitcoin-indexer this project requires longer setup times (about 9 hours indexing) and a postgre database, once the indexing is finished it allows fast queries on relational database.
- electrs specifically intended for the Electrum protocol