Enable pandas output support in cryo
mainBy default, cryo uses polars for its output. If you require cryo to output results using pandas instead, you must install pandas in your environment.
pip install pandasrepository·main·Indexed 23 days ago
https://github.com/paradigmxyz/cryoA tool for extracting blockchain data to parquet, csv, or json formats. It includes a CLI for data acquisition, a Python implementation, and a specialized utility called `cryo_test` for comparing outputs across different RPCs, executables, or implementations to ensure consistency.
By default, cryo uses polars for its output. If you require cryo to output results using pandas instead, you must install pandas in your environment.
pip install pandasTo use the latest unreleased version of cryo, you can install it from source. This requires maturin and a Rust environment. Follow these steps:
maturin.maturin..whl file using pip.pip install maturin
git clone https://github.com/paradigmxyz/cryo
cd cryo/crates/python
maturin build --release
pip install --force-reinstall <OUTPUT_OF_MATURIN_BUILD>.whlThe cryo_test CLI tool is used to perform comparisons between different cryo outputs across various conditions. The tool follows a three-step lifecycle:
You can compare different RPC endpoints, different versions of the cryo executable, or compare the CLI output against the Python implementation.
The fastest way to install cryo is via pip. This method does not require a Rust toolchain to be installed on your system.
pip install cryoFor step-by-step guidance on using Cryo for blockchain data extraction and analysis, refer to the following external tutorials:
cryo_freeze crate provides functionality to extract EVM (Ethereum Virtual Machine) data into structured formats such as Parquet, CSV, or JSON. The primary entry points for data extraction are the collect and freeze functions, along with support for managing multiple datasets via multi_datasets.name=value syntax. This allows you to distinguish between different test environments in the resulting comparison data.The DiffMode type represents the state difference for an account during a transaction trace. It is parsed from Geth debug objects and contains two maps:
pre: A BTreeMap<Address, AccountState> representing the state before the transaction.post: A BTreeMap<Address, AccountState> representing the state after the transaction.When working with u256 columns, you can specify how they should be represented using the U256Type enum. This affects both the underlying ColumnType and the naming convention used for the column suffixes.
U256Type | ColumnType | Suffix | Description |
|---|---|---|---|
Binary | Binary | _binary | Binary representation |
String | String | _string | String representation |
F32 | Float32 | _f32 | 32-bit float |
F64 | Float64 | _f64 | 64-bit float |
U32 | UInt32 | _u32 | 32-bit unsigned integer |
U64 | UInt64 | _u64 | 64-bit unsigned integer |
Decimal128 | Decimal128 | _d128 | Decimal128 representation |
cryo., it is treated as a python interface command. Otherwise, it is treated as a cli interface command.The cryo CLI uses an ExecutionEnv to manage runtime behavior. This environment is constructed based on the following command-line arguments:
--dry: Enables dry-run mode.--verbose / --no-verbose: Controls the logging verbosity level.--report: Enables or disables reporting (controlled by --no-report).--report-dir <DIR>: Specifies the directory where reports are saved.--bar <N>: Controls the display of a progress bar (enabled if --no-verbose is not set).Verbosity levels are determined by the combination of --verbose and --no-verbose flags:
--no-verbose only: Level 0--verbose only: Level 2If a Dataset implementation does not provide a custom sort order via default_sort(), cryo applies a fallback logic through base_default_sort().
The fallback attempts to sort by the following columns in order, provided they exist in the dataset's column_types():
block_numbertransaction_index (Note: if log_index is present, transaction_index is skipped to prioritize log-level ordering)log_index