9 releases
new 0.0.8 | Mar 6, 2025 |
---|---|
0.0.7 | Mar 5, 2025 |
0.0.2 | Feb 27, 2025 |
#57 in Magic Beans
679 downloads per month
Used in 6 crates
(5 directly)
81KB
3K
SLoC
BRK Parser
A very fast and simple Rust library which reads raw block files (blkXXXXX.dat) from Bitcoin Core node and creates an iterator over all the requested blocks in sequential order (0, 1, 2, ...).
The element returned by the iterator is a tuple which includes the:
- Height:
Height
- Block:
Block
(frombitcoin-rust
) - Block's Hash:
BlockHash
(also frombitcoin-rust
)
Example
src/main.rs
Requirements
Even though it reads blkXXXXX.dat files, it needs bitcoind
to run with the RPC server to filter out block forks.
Peak memory should be around 500MB.
Comparaison
biter | bitcoin-explorer (deprecated) | blocks_iterator | |
---|---|---|---|
Runs with bitcoind |
Yes ✅ | No ❌ | Yes ✅ |
Runs without bitcoind |
No ❌ | Yes ✅ | Yes ✅ |
0..=855_000 |
4mn 10s | 4mn 45s | > 2h |
800_000..=855_000 |
0mn 52s (4mn 10s if first run) | 0mn 55s | > 2h |
Benchmarked on a Macbook Pro M3 Pro
Dependencies
~16MB
~232K SLoC