Read, decode, and verify blockchain block flat files.
Check out the crate documentation in your browser by running, from
the root of the veemon
workspace:
cd crates/decoder && cargo doc --open
The tool provides the following commands for various operations:
stream
: Stream data continuously.decode
: Decode files from input to output.help
: Print this message or the help of the given subcommand(s).
You can use the following options with the commands for additional functionalities:
-h, --help
: Print help information about specific command and options.-V, --version
: Print the version information of the tool.
Here are some examples of how to use the commands:
- To stream data continuously from
stdin
:
cargo run -p decoder --example cli stream
cat example0017686312.dbin | cargo run -p decoder --example cli stream
This will output decoded header records as bytes into stdout
- To check a folder of dbin files:
cargo run -p decoder --example cli decode --input ./input_files/ --compression true
So, if using test data from a test-assets/
folder in the root of the veemon
repo:
cargo run -p decoder --example cli decode --input test-assets/benchmark_files/pre_merge
This will store the block headers as json format in the output folder.
By passing --headers-dir
a folder of assumed valid block headers can be provided to compare
with the input flat files. Valid headers can be pulled from the sync committee subprotocol for post-merge data.
- Run
cargo bench
in the root directory of the project - Benchmark results will be output to the terminal
- Benchmark time includes reading from disk & writing output to disk
- Results can be found in
target/criterion/report/index.html
For proper benchmarking of future improvements, fixes and features please compare baselines. Refer to the end of this section of Criterion documentation for more information on creating and comparing baselines.