paradigmxyz / cryo

cryo is the easiest way to extract blockchain data to parquet, csv, json, or python dataframes
Apache License 2.0
1.12k stars 97 forks source link

`blocks` argument "latest" doesn't work in `cryo_python` #152

Closed Evan-Kim2028 closed 8 months ago

Evan-Kim2028 commented 8 months ago

Version python_cryo 0.3.0

Description the blocks argument doesn't seem to support "latest" parameter.

example code:

cryo.freeze(
    "erc20_metadata",
    blocks=["18.7M"], 
   # blocks=["18.7M:latest"] # note this doesn't work either
    rpc="https://eth.merkle.io",
    reorg_buffer=1000,
    max_concurrent_chunks=15, 
    chunk_size=len(univ2_pools_tokens),
    inner_request_size=10000,
    output_dir="data",
    subdirs=["univ2_pools_tokens"],
    contract=["0x222b876b787bc0660c091078b8e06b5ac36e8f78"],
    hex=True,
)

error:

     [28](https://file+.vscode-resource.vscode-cdn.net/home/evan/Documents/cryo_uniswap/tests/~/Documents/cryo_uniswap/.venv/lib/python3.10/site-packages/cryo/_freeze.py:28)     raise Exception('invalid format for datatype(s)')
     [30](https://file+.vscode-resource.vscode-cdn.net/home/evan/Documents/cryo_uniswap/tests/~/Documents/cryo_uniswap/.venv/lib/python3.10/site-packages/cryo/_freeze.py:30) cli_args = _args.parse_cli_args(**kwargs)
---> [31](https://file+.vscode-resource.vscode-cdn.net/home/evan/Documents/cryo_uniswap/tests/~/Documents/cryo_uniswap/.venv/lib/python3.10/site-packages/cryo/_freeze.py:31) return await _cryo_rust._freeze(datatypes, **cli_args)

RustPanic: rust future panicked: unknown error
Evan-Kim2028 commented 8 months ago

this apparently works now. Closing issue