chaincodec-cli-0.2.0 is not a library.
chaincodec-cli
ChainCodec command-line tool — decode EVM events, verify CSDL schemas, run golden tests, and benchmark decode throughput.
Install
Or build from source:
# binary: target/release/chaincodec
Commands
decode — decode a raw EVM log
Decode a raw log entry into a human-readable event using a CSDL schema:
JSON output (default):
Table output (--output table):
Schema : ERC20Transfer
Chain : ethereum
Field Value
------ ------------------------------------------
from 0xd8da6bf26964af9d7eed9e03e53415d37aa96045
to 0xab5801a7d398351b8be11c439e05c5b3259aec9b
value 1000000
verify — validate a CSDL schema file
Check that a CSDL file is syntactically valid and that the fingerprint matches the event signature:
# ✓ ERC20Transfer v1 — fingerprint matches
# ✓ ERC20Approval v1 — fingerprint matches
list — list all registered schemas
Show all schemas loaded from a CSDL directory:
NAME VERSION EVENT FINGERPRINT
ERC20Transfer 1 Transfer 0xddf252ad...
ERC20Approval 1 Approval 0x8c5be1e5...
UniswapV3Swap 1 Swap 0xc42079f9...
AaveV3Supply 1 Supply 0x2b627736...
...
53 schemas loaded
test — run golden fixture tests
Run a directory of golden JSON fixtures through the decoder and assert the output matches:
running 30 golden tests
✓ erc20-transfer
✓ erc20-approval
✓ uniswap-v3-swap
✓ aave-v3-supply
...
30 passed, 0 failed
Golden fixture format (fixtures/evm/erc20-transfer.json):
bench — benchmark decode throughput
Measure events/sec for a given schema and thread count:
Benchmarking ERC20Transfer x 1,000,000 events
Single-thread : 1,024,311 events/sec
8-thread Rayon: 6,187,442 events/sec
Speedup : 6.04x
Latency (single-thread)
P50 : 0.82 µs
P95 : 1.21 µs
P99 : 2.14 µs
Global flags
| Flag | Default | Description |
|---|---|---|
--output |
json |
Output format: json or table |
--schema-dir |
schemas/ |
Directory with CSDL schemas |
--chain |
ethereum |
Chain slug for context |
--log-level |
warn |
Log level: trace, debug, info, warn, error |
License
MIT — see LICENSE