Efficiently read and extract data from Bitcoin Core blk files.
In order to run the examples, you need to have the blk files from the Bitcoin Core data directory and edit the permissions to allow the current user to read the files.
sudo chmod 664 /path/to/blk/dir/blk*
To build examples, run:
cargo build --examples --release
To run examples, use the following commands:
./target/release/examples/<example-name> /path/to/blk/dir <args>
or
cargo run --example <example-name> /path/to/blk/dir <args>
Usage: list-blocks <blk-dir> [--max-blocks <max-blocks>] [--max-files <max-block-files>]
list-blocks /path/to/blk/dir --max-blocks 10
list-non-standard /path/to/blk/dir --max-blocks 100000
Note: Block are indexed from 0, so if you want to read up to block 100000 inclusive, you need to pass --max-blocks 100001
.