Coder Social home page Coder Social logo

checkthechain's Introduction

โ›“๐Ÿ” Check the Chain (ctc) ๐Ÿ”Žโ›“

ctc is a tool for collecting and analyzing data from Ethereum and other EVM chains

It can be used as either 1) a python package or 2) a cli tool

ctc is in beta, please report bugs to the issue tracker

Features

  • data collection: collects data from archive nodes robustly and efficiently
  • data storage: stores collected data on disk so that it only needs to be collected once
  • data coding: handles data encoding and decoding automatically by default
  • data analysis: computes derived metrics and other quantitative data summaries
  • data visualization: plots data to maximize data interpretability
  • protocol specificity: includes functionality for protocols like Chainlink, Uniswap, ERC20, and more
  • command line interface: performs many block explorer tasks in the terminal

For detailed information check out the documentation

Contents

  1. Example Usage
    1. ERC20: get all token transfers and balances of an ERC20
    2. Uniswap: get swaps, mints, and burns of a Uniswap pair
    3. Chainlink: get historical data for a Chainlink feed
    4. DAO: get DAO proposals and votes
  2. Installation
  3. FAQ
  4. Similar Projects
๐Ÿ“œ Legal Disclaimer ๐Ÿ“œ ctc is available under either the MIT license or the Apache license at your option. As stated in both licenses, ctc comes with no warranty of any kind. The authors of ctc accept no responsibility for any damages or negative outcomes that result from using ctc or ctc-derived data. ctc is not audited and using it as a basis for making financial decisions is not recommended.

Example Usage

for more examples see examples in the docs

Get all token transfers of an ERC20

# python

from ctc import evm

# get token transfers
transfers = await evm.async_get_erc20_transfers(
    token='0x956f47f50a910163d8bf957cf5846d573e7f87ca',
    event_name='Transfer',
)

# get holdings of each address for a given block
holdings = await evm.async_get_erc20_balances_from_transfers(transfers=transfers, block=12345789)
# bash

ctc erc20 transfers 0x956f47f50a910163d8bf957cf5846d573e7f87ca \
    --export transfers.csv

ctc erc20 balances 0x956f47f50a910163d8bf957cf5846d573e7f87ca \
    --export balances.csv \
    --block 12345789

Get DAO proposals and votes

# python

from ctc import evm

dao_address = '0x0bef27feb58e857046d630b2c03dfb7bae567494'

proposals = await evm.async_get_events(
    contract_address=dao_address,
    event_name='ProposalCreated',
)

votes = await evm.async_get_events(
    contract_address=dao_address,
    event_name='VoteCast',
    include_timestamps=True,
)
# bash

DAO="0x0bef27feb58e857046d630b2c03dfb7bae567494"

ctc events $DAO ProposalCreated --export proposals.csv
ctc events $DAO VoteCast --export votes.csv

Get historical data for a Chainlink feed

# python

from ctc.protocols import chainlink_utils

feed = '0x31e0a88fecb6ec0a411dbe0e9e76391498296ee9'

data = await chainlink_utils.async_get_feed_data(feed)
# bash

ctc chainlink 0x31e0a88fecb6ec0a411dbe0e9e76391498296ee9 --export data.csv

Get swaps, mints, and burns of a Uniswap pool

# python

from ctc.protocols import uniswap_v2_utils

pool = '0x94b0a3d511b6ecdb17ebf877278ab030acb0a878'

swaps = await uniswap_v2_utils.async_get_pool_swaps(pool)
mints = await uniswap_v2_utils.async_get_pool_mints(pool)
burns = await uniswap_v2_utils.async_get_pool_burns(pool)
# bash

POOL="0x94b0a3d511b6ecdb17ebf877278ab030acb0a878"

ctc uniswap swaps $POOL --export swaps.csv
ctc uniswap mints $POOL --export mints.csv
ctc uniswap burns $POOL --export burns.csv

Installation

Two steps:

  1. pip install checkthechain
  2. run ctc setup in terminal to specify data provider and data storage path

If your shell's PATH does not include python scripts you may need to do something like python3 -m pip ... and python3 -m ctc ...

Detailed instructions can be found in the installation documentation.

ctc requires python >= 3.7 (supports 3.7, 3.8, 3.9, 3.10, and 3.11).

FAQ

  • What are the goals of ctc?
    1. Treat historical data as a first-class feature: This means having historical data functionality well-integrated into each part of the of the API. It also means optimizing the codebase with historical data workloads in mind.
    2. Protocol-specific functionality: This means having built-in support for popular on-chain protocols.
    3. Terminal-based block explorer: This means supporting as many block explorer tasks as possible from the terminal. And doing so in a way that is faster than can be done with a web browser.
    4. Clean API emphasizing UX: With ctc most data queries can be obtained with a single function call. No need to instantiate objects. RPC inputs/outputs are automatically encoded/decoded by default.
    5. Maximize data accessibility: Blockchains contain vast amounts of data, but accessing this data can require large amounts of time, effort, and expertise. ctc aims to lower the barrier to entry on all fronts.
  • Why use async?
    • async is a natural fit for efficiently querying large amounts of data from an archive node. All ctc functions that fetch external data use async. For tips on using async see this section in the docs. Future versions of ctc will include some wrappers for synchronous code.
  • Do I need an archive node?
    • If you want to query historical data, you will need an archive node. You can either run one yourself or use a third-party provider such as Alchemy, Quicknode, or Moralis. You can also use ctc to query current (non-historical) data using a non-archive node.
  • Is ctc useful for recent, non-historical data?
    • Yes, ctc has lots of functionality for querying the current state of the chain.

Similar Projects

  • ethereum-etl ETL tools for bulk data gathering in python
  • Trueblocks optimized EVM local indexing engine
  • cast cli EVM swiss army knife (rust)
  • seth cli EVM swiss army knife (bash / js)
  • ethereal cli EVM swiss army knife (go)
  • web3.py official Ethereum python client
  • ape general python framework for many tasks including smart contract dev
  • ethtx.info EVM transaction trace visualizer

checkthechain's People

Contributors

jamierumbelow avatar joeysantoro avatar kayaba-attribution avatar mattsse avatar rafaelugolini avatar sslivkoff avatar wuwe1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

checkthechain's Issues

NameError: name 'ctc' is not defined

I am getting NameError: name 'ctc' is not defined. However, if you see the attached image you will notice that bash confirms the version of ctc.
Screenshot 2023-03-06 at 13 43 53

Module ctc.evm has not attribute(s)

Hi,

Attempting run some basic queries (these directly are from the doc example pages):

e.g.

from ctc import evm
  contract_address = '0xd8da6bf26964af9d7eed9e03e53415d37aa96045'
  transactions = await evm.async_get_transactions_from_address(address)
  len(transactions)

results in:

> ---------------------------------------------------------------------------
> AttributeError                            Traceback (most recent call last)
> /tmp/ipykernel_3288/4106459712.py in async-def-wrapper()
>       4 len(transactions)
>       5 
> ----> 6 
> 
> AttributeError: module 'ctc.evm' has no attribute 'async_get_transactions_from_address'

While calling other evm.async_X methods work absolutely fine, is something wrong with the namespace?

e.g.

from ctc import evm

dao_address = '0x0bef27feb58e857046d630b2c03dfb7bae567494'

proposals = await evm.async_get_events(
    contract_address=dao_address,
    event_name='ProposalCreated',
)

returns as expected

Any ideas here? I have tried installing via pip and building directly from source (at current repo state) - same odd result for both routes.

Thanks - I love the tooling here.

Fails to run with version `0.3.0b1`

Could be my python version (3.8), but the cli fails to run due to a problem parsing the version.
Getting the error:

invalid literal for int() with base 10: '0b1'

Changing the version to something like 0.3.2 fixes it (requires removing the config and running the setup again)

ctc setup fails on Polygon, `table not found in db: network_1__erc20_metadata`

(venv) david@david-Inspiron-5502:~/projects/ctc-playground$ ctc setup --debug
# Setting up ctc...

Running setup process for ctc 0.3.0

Each step is optional
- by default, setup process will leave existing settings unchanged
- setup can be rerun multiple times idempotently

Can skip options by pressing enter at each prompt
old_config has unknown version, using default config


## Network Setup


Most ctc operations require an RPC provider

Would you like to specify an RPC provider? (default = yes) 

What is the RPC provider URL? https://polygon-mainnet.g.alchemy.com/v2/<ALCHEMY_API_KEY>
Provider using: chain_id = 137, network = polygon
What should this node be called? (default = alchemy__137) 
Would you like to specify additional RPC providers? (default = no) 

Have metadata for the following networks:

      โ”‚              name  โ”‚       chain_id  
โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
   1  โ”‚           mainnet  โ”‚              1  
   2  โ”‚           ropsten  โ”‚              3  
   3  โ”‚           rinkeby  โ”‚              4  
   4  โ”‚            goerli  โ”‚              5  
   5  โ”‚          optimism  โ”‚             10  
   6  โ”‚             kovan  โ”‚             42  
   7  โ”‚               bnb  โ”‚             56  
   8  โ”‚    optimism_kovan  โ”‚             69  
   9  โ”‚       bnb_testnet  โ”‚             97  
  10  โ”‚            gnosis  โ”‚            100  
  11  โ”‚              heco  โ”‚            128  
  12  โ”‚           polygon  โ”‚            137  
  13  โ”‚            fantom  โ”‚            250  
  14  โ”‚   optimism_goerli  โ”‚            420  
  15  โ”‚             metis  โ”‚          1,088  
  16  โ”‚          moonbeam  โ”‚          1,284  
  17  โ”‚         moonriver  โ”‚          1,285  
  18  โ”‚    fantom_testnet  โ”‚          4,002  
  19  โ”‚            klaytn  โ”‚          8,217  
  20  โ”‚          arbitrum  โ”‚         42,161  
  21  โ”‚    avalanche_fuji  โ”‚         43,113  
  22  โ”‚         avalanche  โ”‚         43,114  
  23  โ”‚    polygon_mumbai  โ”‚         80,001  
  24  โ”‚  arbitrum_rinkeby  โ”‚        421,611  
  25  โ”‚           harmony  โ”‚  1,666,600,000  
  26  โ”‚   harmony_testnet  โ”‚  1,666,700,000  

Would you like to add metadata for additional networks? (default = no) 

Using 26 networks in config

Which network to use as default?
    1. arbitrum (chain_id = 42161)
    2. arbitrum_rinkeby (chain_id = 421611)
    3. avalanche (chain_id = 43114)
    4. avalanche_fuji (chain_id = 43113)
    5. bnb (chain_id = 56)
    6. bnb_testnet (chain_id = 97)
    7. fantom (chain_id = 250)
    8. fantom_testnet (chain_id = 4002)
    9. gnosis (chain_id = 100)
    10. goerli (chain_id = 5)
    11. harmony (chain_id = 1666600000)
    12. harmony_testnet (chain_id = 1666700000)
    13. heco (chain_id = 128)
    14. klaytn (chain_id = 8217)
    15. kovan (chain_id = 42)
    16. mainnet (chain_id = 1)
    17. metis (chain_id = 1088)
    18. moonbeam (chain_id = 1284)
    19. moonriver (chain_id = 1285)
    20. optimism (chain_id = 10)
    21. optimism_goerli (chain_id = 420)
    22. optimism_kovan (chain_id = 69)
    23. polygon (chain_id = 137) (default)
    24. polygon_mumbai (chain_id = 80001)
    25. rinkeby (chain_id = 4)
    26. ropsten (chain_id = 3)
(default = polygon (chain_id = 137))

(default = polygon (chain_id = 137))
> 

Network setup complete


## Data Root Directory

Where should ctc store data? (specify a directory path) (default = /home/david/ctc_data) 
creating directory: /home/david/ctc_data/dbs
creating directory: /home/david/ctc_data/logs
creating directory: /home/david/ctc_data/evm
creating directory: /home/david/ctc_data/logs/rpc
creating directory: /home/david/ctc_data/logs/db

Do you want to disable ctc logging? (default = no) 


## Database Setup

ctc stores its collected chain data in an sql database

Creating database at path /home/david/ctc_data/dbs/ctc.db

[WARNING] ctc config file does not exist; use `ctc setup` on command line to generate a config file

Actively using 10 schema(s) across 1 network(s)
    - schemas:
        - block_timestamps
        - block_gas
        - blocks
        - contract_abis
        - contract_creation_blocks
        - erc20_metadata
        - dex_pools
        - chainlink
        - 4byte
        - coingecko
    - network: 137

Schemas to create:
- block_timestamps [network = 137]
- block_gas [network = 137]
- blocks [network = 137]
- contract_abis [network = 137]
- contract_creation_blocks [network = 137]
- erc20_metadata [network = 137]
- dex_pools [network = 137]
- chainlink [network = 137]
- 4byte [network = None]
- coingecko [network = None]

All tables created


## Creating Configuration File

Config file created at /home/david/.config/ctc/config.json


## Populating Database

Populating database with metadata of common ERC20 tokens...

[ENTERING DEBUGGER]
Traceback (most recent call last):
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/toolcli/command_utils/execution.py", line 56, in run_cli
    execute_parsed_command(parse_spec=parse_spec, args=args)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/toolcli/command_utils/execution.py", line 84, in execute_parsed_command
    execute_command_spec(
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/toolcli/command_utils/execution.py", line 130, in execute_command_spec
    asyncio.run(coroutine)
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/toolcli/command_utils/execution.py", line 143, in _async_execute_in_context_manager
    await function(**args)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/ctc/cli/commands/admin/setup_command.py", line 96, in async_setup_command
    await setup_utils.async_setup_ctc(
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/ctc/config/setup_utils/main_setup.py", line 106, in async_setup_ctc
    await db_setup.async_populate_db_tables(
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/ctc/config/setup_utils/stages/db_setup.py", line 102, in async_populate_db_tables
    await default_erc20s.async_intake_default_erc20s(
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/ctc/config/setup_utils/default_data/default_erc20s.py", line 37, in async_intake_default_erc20s
    await db.async_upsert_erc20s_metadata(
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/ctc/db/schemas/erc20_metadata/erc20_metadata_statements.py", line 61, in async_upsert_erc20s_metadata
    await asyncio.gather(*coroutines)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/ctc/db/schemas/erc20_metadata/erc20_metadata_statements.py", line 43, in async_upsert_erc20_metadata
    toolsql.insert(
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/toolsql/crud_utils/create.py", line 28, in insert
    return insert_row(
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/toolsql/crud_utils/create.py", line 55, in insert_row
    statement = create_insert_statement(
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/toolsql/crud_utils/create.py", line 184, in create_insert_statement
    table = sqlalchemy_utils.create_table_object_from_db(
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/toolsql/sqlalchemy_utils/table_utils.py", line 122, in create_table_object_from_db
    raise exceptions.TableNotFound(
toolsql.exceptions.TableNotFound: table not found in db: network_1__erc20_metadata

> /home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/toolsql/sqlalchemy_utils/table_utils.py(122)create_table_object_from_db()
-> raise exceptions.TableNotFound(
(Pdb) c

Error: `(sqlite3.OperationalError) near "ON": syntax error`

When I run any command, I get the error :

(sqlite3.OperationalError) near "ON": syntax error

Googling seems to indicate an incompatibly SQLite version (version >=3.24 needed)

When I run python3.8 -c "import sqlite3; print(sqlite3.sqlite_version)" I get : 3.22.0

Running this command solves the issue :

sudo apt-get install sqlite3

This updated sqlite3 to 3.31.1 and now everything works fine

I'm using WSL

more than one match found in sequence, FIXED, TODO: add more tests

I am not able to retrieve a contract abi or call all on a contract. I have tried multiple contracts and they all seem to return the same error of "more than one match found in sequence". Below is an example using the Dai Contract.

I'm running python version 3.9.12 on mac osx 12.5.1.

ctc abi 0x6B175474E89094C44Da98b954EedeAC495271d0F
fetching mainnet abi from etherscan: 0x6B175474E89094C44Da98b954EedeAC495271d0F
more than one match found in sequence

ctc call all 0x6B175474E89094C44Da98b954EedeAC495271d0F
fetching mainnet abi from etherscan: 0x6B175474E89094C44Da98b954EedeAC495271d0F
more than one match found in sequence

cg graphs not working on windows

After installing python and ctc, and going through the setup, it seems like the graphs for cg are not displaying correctly.
image
This is on both cmd, and powershell.

Installation failure from source code

Trying to install ctc from source code and getting this error:

 Building wheel for multidict (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/jingjunyin/Desktop/Dev/ctc/venv/bin/python /Users/jingjunyin/Desktop/Dev/ctc/venv/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/p0/pgdsn3d57h7cfzbq5j87q6lc0000gn/T/tmp4ccia85i
       cwd: /private/var/folders/p0/pgdsn3d57h7cfzbq5j87q6lc0000gn/T/pip-install-hjomo5dm/multidict
  Complete output (66 lines):
  *********************
  * Accelerated build *
  *********************
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.14.6-x86_64-cpython-38
  creating build/lib.macosx-10.14.6-x86_64-cpython-38/multidict
  copying multidict/_multidict_py.py -> build/lib.macosx-10.14.6-x86_64-cpython-38/multidict
  copying multidict/_abc.py -> build/lib.macosx-10.14.6-x86_64-cpython-38/multidict
  copying multidict/__init__.py -> build/lib.macosx-10.14.6-x86_64-cpython-38/multidict
  copying multidict/_multidict_base.py -> build/lib.macosx-10.14.6-x86_64-cpython-38/multidict
  copying multidict/_compat.py -> build/lib.macosx-10.14.6-x86_64-cpython-38/multidict
  running egg_info
  writing multidict.egg-info/PKG-INFO
  writing dependency_links to multidict.egg-info/dependency_links.txt
  writing top-level names to multidict.egg-info/top_level.txt
  reading manifest file 'multidict.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no previously-included files matching '*.pyc' found anywhere in distribution
  warning: no previously-included files found matching 'multidict/_multidict.html'
  warning: no previously-included files found matching 'multidict/*.so'
  warning: no previously-included files found matching 'multidict/*.pyd'
  warning: no previously-included files found matching 'multidict/*.pyd'
  no previously-included directories found matching 'docs/_build'
  adding license file 'LICENSE'
  writing manifest file 'multidict.egg-info/SOURCES.txt'
  copying multidict/__init__.pyi -> build/lib.macosx-10.14.6-x86_64-cpython-38/multidict
  copying multidict/py.typed -> build/lib.macosx-10.14.6-x86_64-cpython-38/multidict
  running build_ext
  building 'multidict._multidict' extension
  creating build/temp.macosx-10.14.6-x86_64-cpython-38
  creating build/temp.macosx-10.14.6-x86_64-cpython-38/multidict
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/Users/jingjunyin/Desktop/Dev/ctc/venv/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c multidict/_multidict.c -o build/temp.macosx-10.14.6-x86_64-cpython-38/multidict/_multidict.o -O2 -std=c99 -Wall -Wsign-compare -Wconversion -fno-strict-aliasing -pedantic
  multidict/_multidict.c:1:10: fatal error: 'Python.h' file not found
  #include "Python.h"
           ^~~~~~~~~~
  1 error generated.
  /private/var/folders/p0/pgdsn3d57h7cfzbq5j87q6lc0000gn/T/pip-build-env-ngt7mbxd/overlay/lib/python3.8/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'multidict._multilib' as data is deprecated, please list it in `packages`.
      !!
  
  
      ############################
      # Package would be ignored #
      ############################
      Python recognizes 'multidict._multilib' as an importable package,
      but it is not listed in the `packages` configuration of setuptools.
  
      'multidict._multilib' has been automatically added to the distribution only
      because it may contain data files, but this behavior is likely to change
      in future versions of setuptools (and therefore is considered deprecated).
  
      Please make sure that 'multidict._multilib' is included as a package by using
      the `packages` configuration field or the proper discovery methods
      (for example by using `find_namespace_packages(...)`/`find_namespace:`
      instead of `find_packages(...)`/`find:`).
  
      You can read more about "package discovery" and "data files" on setuptools
      documentation page.
  
  
  !!
  
    check.warn(importable)
  error: command '/usr/bin/clang' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for multidict
  Running setup.py clean for multidict
Successfully built checkthechain
Failed to build aiohttp numpy pandas yarl frozenlist multidict
ERROR: Could not build wheels for aiohttp, numpy, pandas, yarl, frozenlist, multidict which use PEP 517 and cannot be installed directly

install problems

any help on this? fwiw this is a fairly new m1 and i havent done anything in python on it until now

log.log

Missing data when calling `ctc address`

~ ยป ctc address 0x11e52c75998fe2E7928B191bfc5B25937Ca16741
Address 0x11e52c75998fe2e7928b191bfc5b25937ca16741
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
- checksum: 0x11e52c75998fe2E7928B191bfc5B25937Ca16741
- address type: EOA
- ETH balance: 5194625828346759363
- transaction count: 3714
- first transaction:

"First transaction" is blank.
Also, suggest formatting the ETH balance with decimals.

ctc cg SYMBOL varying errors

when querying individual tokens using ctc cg SYMBOL, certain symbols e.g. LINK, ETH, SOL (any blue chips) will result in too many token_ids for symbol.

This error does not occur when querying minor coins, e.g.: ctc cg KCS or ctc cg MIOTA

(Using Windows 10, PowerShell)
image

`ctc config file does not exist` even after running `ctc setup`

I've run ctc setup with all defaults, once after initial install, and once again when I saw the above warning. However, the warning doesn't seem to go away.

I thought maybe it was an errant warning, so I tried tracing a tx hash and got this

Task exception was never retrieved
future: <Task finished name='Task-2' coro=<async_eth_get_transaction_receipt() done, defined at /Library/Python/3.8/site-packages/ctc/rpc/rpc_executors/rpc_transaction_executors.py:90> exception=ConfigInvalid("provider should have keys: {'convert_reverts_to_none', 'session_kwargs', 'network', 'chunk_size', 'name', 'url', 'protocol'}")>
Traceback (most recent call last):
  File "/Library/Python/3.8/site-packages/ctc/rpc/rpc_executors/rpc_transaction_executors.py", line 100, in async_eth_get_transaction_receipt
    response = await rpc_request.async_send(request, provider=provider)
  File "/Library/Python/3.8/site-packages/ctc/rpc/rpc_request.py", line 102, in async_send
    full_provider = rpc_provider.get_provider(provider)
  File "/Library/Python/3.8/site-packages/ctc/rpc/rpc_provider.py", line 15, in get_provider
    return ctc.config.get_default_provider()
  File "/Library/Python/3.8/site-packages/ctc/config/config_values.py", line 143, in get_default_provider
    network = get_default_network()
  File "/Library/Python/3.8/site-packages/ctc/config/config_values.py", line 44, in get_default_network
    return config_read.get_config().get('default_network')
  File "/Library/Python/3.8/site-packages/ctc/config/config_read.py", line 111, in get_config
    config_validate.validate_config(config)
  File "/Library/Python/3.8/site-packages/ctc/config/config_validate.py", line 68, in validate_config
    key_validator(value=value, config=config)
  File "/Library/Python/3.8/site-packages/ctc/config/config_validate.py", line 142, in validate_providers
    raise spec.ConfigInvalid(
ctc.spec.exceptions.config_exceptions.ConfigInvalid: provider should have keys: {'convert_reverts_to_none', 'session_kwargs', 'network', 'chunk_size', 'name', 'url', 'protocol'

Error installing: module "toolcli" has no attribute "print"

โฏ pip3 --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
โฏ python3 --version
Python 3.8.10
โฏ pip3 --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
โฏ python3 -m ctc setup
ctc initializing...

This process will make sure each of the following is completed:
- setup config path
- setup data directory
- setup networks and providers

Each step can be skipped depending on what you need
- this wizard can be rerun multiple times idempotently
- by default, wizard will leave current settings unchanged


module 'toolcli' has no attribute 'print'
โฏ pip install toolcli
Requirement already satisfied: toolcli in ./.local/lib/python3.8/site-packages (0.6.6)
Requirement already satisfied: rich>=12.1.0 in ./.local/lib/python3.8/site-packages (from toolcli) (12.5.1)
Requirement already satisfied: typing_extensions>=0.4.0 in ./.local/lib/python3.8/site-packages (from toolcli) (4.3.0)
Requirement already satisfied: pygments<3.0.0,>=2.6.0 in ./.local/lib/python3.8/site-packages (from rich>=12.1.0->toolcli) (2.13.0)
Requirement already satisfied: commonmark<0.10.0,>=0.9.0 in ./.local/lib/python3.8/site-packages (from rich>=12.1.0->toolcli) (0.9.1)

ctc dex chart always return this waning

ctc dex chart 0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8
getting events from node, block range: [15195555, 15666020]
/Users/dual/opt/anaconda3/envs/web3/lib/python3.9/site-packages/ctc/rpc/rpc_protocols/rpc_http_async.py:35: UserWarning: request failed with code 429 retrying in 1.8541545285809442s
warnings.warn(
/Users/dual/opt/anaconda3/envs/web3/lib/python3.9/site-packages/ctc/rpc/rpc_protocols/rpc_http_async.py:35: UserWarning: request failed with code 429 retrying in 1.7716537108027812s
warnings.warn(
/Users/dual/opt/anaconda3/envs/web3/lib/python3.9/site-packages/ctc/rpc/rpc_protocols/rpc_http_async.py:35: UserWarning: request failed with code 429 retrying in 1.0137542644038302s
warnings.warn(
/Users/dual/opt/anaconda3/envs/web3/lib/python3.9/site-packages/ctc/rpc/rpc_protocols/rpc_http_async.py:35: UserWarning: request failed with code 429 retrying in 1.025351231137594s

ctc dex chart always returns could not determine dex class of pool

Hello, first of all thank you for working on this tool because it's truly awesome. I have a little problem when i try to get the chart of a given pool. Whenever i try to get the chart i always get the following error: could not determine dex class of pool. Here is the command i tried to use: ctc dex chart 0x5c6Ee304399DBdB9C8Ef030aB642B10820DB8F56
I tried the same thing both from a Windows 10 machine using an Infura mainnet node and a Linux machine with a self hosted node, both using Geth.
It looks like the line dex_pool = await db.async_query_dex_pool(address=pool, network=network) in line 120 of dex_class_utils.py always returns None. Am i doing something wrong?

Installation issue

I'm trying to install ctc for OP network. The issue is that the installer setup some tables under the network_10 naming schema, but then it tries to populate network_1 db tables, which obviously don't exits, so I get table not found in db.

ctc setup fails with non-default data root directory

(venv) david@david-Inspiron-5502:~/projects/ctc-playground$ ctc setup --debug
# Setting up ctc...

Running setup process for ctc 0.3.0

Each step is optional
- by default, setup process will leave existing settings unchanged
- setup can be rerun multiple times idempotently

Can skip options by pressing enter at each prompt
old_config has unknown version, using default config


## Network Setup


Most ctc operations require an RPC provider

Would you like to specify an RPC provider? (default = yes) 

What is the RPC provider URL? https://polygon-mainnet.g.alchemy.com/v2/<ALCHEMY_API_KEY>
Provider using: chain_id = 137, network = polygon
What should this node be called? (default = alchemy__137) 
Would you like to specify additional RPC providers? (default = no) 

Have metadata for the following networks:

      โ”‚              name  โ”‚       chain_id  
โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
   1  โ”‚           mainnet  โ”‚              1  
   2  โ”‚           ropsten  โ”‚              3  
   3  โ”‚           rinkeby  โ”‚              4  
   4  โ”‚            goerli  โ”‚              5  
   5  โ”‚          optimism  โ”‚             10  
   6  โ”‚             kovan  โ”‚             42  
   7  โ”‚               bnb  โ”‚             56  
   8  โ”‚    optimism_kovan  โ”‚             69  
   9  โ”‚       bnb_testnet  โ”‚             97  
  10  โ”‚            gnosis  โ”‚            100  
  11  โ”‚              heco  โ”‚            128  
  12  โ”‚           polygon  โ”‚            137  
  13  โ”‚            fantom  โ”‚            250  
  14  โ”‚   optimism_goerli  โ”‚            420  
  15  โ”‚             metis  โ”‚          1,088  
  16  โ”‚          moonbeam  โ”‚          1,284  
  17  โ”‚         moonriver  โ”‚          1,285  
  18  โ”‚    fantom_testnet  โ”‚          4,002  
  19  โ”‚            klaytn  โ”‚          8,217  
  20  โ”‚          arbitrum  โ”‚         42,161  
  21  โ”‚    avalanche_fuji  โ”‚         43,113  
  22  โ”‚         avalanche  โ”‚         43,114  
  23  โ”‚    polygon_mumbai  โ”‚         80,001  
  24  โ”‚  arbitrum_rinkeby  โ”‚        421,611  
  25  โ”‚           harmony  โ”‚  1,666,600,000  
  26  โ”‚   harmony_testnet  โ”‚  1,666,700,000  

Would you like to add metadata for additional networks? (default = no) 

Using 26 networks in config

Which network to use as default?
    1. arbitrum (chain_id = 42161)
    2. arbitrum_rinkeby (chain_id = 421611)
    3. avalanche (chain_id = 43114)
    4. avalanche_fuji (chain_id = 43113)
    5. bnb (chain_id = 56)
    6. bnb_testnet (chain_id = 97)
    7. fantom (chain_id = 250)
    8. fantom_testnet (chain_id = 4002)
    9. gnosis (chain_id = 100)
    10. goerli (chain_id = 5)
    11. harmony (chain_id = 1666600000)
    12. harmony_testnet (chain_id = 1666700000)
    13. heco (chain_id = 128)
    14. klaytn (chain_id = 8217)
    15. kovan (chain_id = 42)
    16. mainnet (chain_id = 1)
    17. metis (chain_id = 1088)
    18. moonbeam (chain_id = 1284)
    19. moonriver (chain_id = 1285)
    20. optimism (chain_id = 10)
    21. optimism_goerli (chain_id = 420)
    22. optimism_kovan (chain_id = 69)
    23. polygon (chain_id = 137) (default)
    24. polygon_mumbai (chain_id = 80001)
    25. rinkeby (chain_id = 4)
    26. ropsten (chain_id = 3)
(default = polygon (chain_id = 137))

(default = polygon (chain_id = 137))
> 

Network setup complete


## Data Root Directory

Where should ctc store data? (specify a directory path) (default = /home/david/ctc_data) /home/david/projects/ctc-playground
creating directory: /home/david/projects/ctc-playground/dbs
creating directory: /home/david/projects/ctc-playground/logs
creating directory: /home/david/projects/ctc-playground/evm
creating directory: /home/david/projects/ctc-playground/logs/rpc
creating directory: /home/david/projects/ctc-playground/logs/db

Do you want to disable ctc logging? (default = no) 


## Database Setup

ctc stores its collected chain data in an sql database

Creating database at path /home/david/projects/ctc-playground/dbs/ctc.db

[WARNING] ctc config file does not exist; use `ctc setup` on command line to generate a config file
[ENTERING DEBUGGER]
Traceback (most recent call last):
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3361, in _wrap_pool_connect
    return fn()
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 320, in connect
    return _ConnectionFairy._checkout(self)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 884, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 486, in checkout
    rec = pool._do_get()
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 256, in _do_get
    return self._create_connection()
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 266, in _create_connection
    return _ConnectionRecord(self)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 381, in __init__
    self.__connect()
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 677, in __connect
    with util.safe_reraise():
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
    compat.raise_(
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
    raise exception
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 673, in __connect
    self.dbapi_connection = connection = pool._invoke_creator(self)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 578, in connect
    return dialect.connect(*cargs, **cparams)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 598, in connect
    return self.dbapi.connect(*cargs, **cparams)
sqlite3.OperationalError: unable to open database file

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/toolcli/command_utils/execution.py", line 56, in run_cli
    execute_parsed_command(parse_spec=parse_spec, args=args)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/toolcli/command_utils/execution.py", line 84, in execute_parsed_command
    execute_command_spec(
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/toolcli/command_utils/execution.py", line 130, in execute_command_spec
    asyncio.run(coroutine)
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/toolcli/command_utils/execution.py", line 143, in _async_execute_in_context_manager
    await function(**args)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/ctc/cli/commands/admin/setup_command.py", line 96, in async_setup_command
    await setup_utils.async_setup_ctc(
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/ctc/config/setup_utils/main_setup.py", line 80, in async_setup_ctc
    db_data = db_setup.setup_dbs(
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/ctc/config/setup_utils/stages/db_setup.py", line 61, in setup_dbs
    _delete_incomplete_chainlink_schemas()
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/ctc/config/setup_utils/stages/db_setup.py", line 130, in _delete_incomplete_chainlink_schemas
    metadata = toolsql.create_metadata_object_from_db(
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/toolsql/sqlalchemy_utils/metadata_utils.py", line 41, in create_metadata_object_from_db
    return _create_metadata_object_from_engine(engine=engine)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/toolcache/cache_decorator.py", line 136, in new_f
    return execute_with_cache(
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/toolcache/cache_decorator.py", line 236, in execute_with_cache
    output = old_f(*args, **kwargs)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/toolsql/sqlalchemy_utils/metadata_utils.py", line 62, in _create_metadata_object_from_engine
    metadata.reflect(bind=engine)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/sql/schema.py", line 4829, in reflect
    with inspection.inspect(bind)._inspection_context() as insp:
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/inspection.py", line 64, in inspect
    ret = reg(subject)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/engine/reflection.py", line 182, in _engine_insp
    return Inspector._construct(Inspector._init_engine, bind)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/engine/reflection.py", line 117, in _construct
    init(self, bind)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/engine/reflection.py", line 128, in _init_engine
    engine.connect().close()
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3315, in connect
    return self._connection_cls(self, close_with_result=close_with_result)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 96, in __init__
    else engine.raw_connection()
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3394, in raw_connection
    return self._wrap_pool_connect(self.pool.connect, _connection)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3364, in _wrap_pool_connect
    Connection._handle_dbapi_exception_noconnection(
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2198, in _handle_dbapi_exception_noconnection
    util.raise_(
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
    raise exception
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3361, in _wrap_pool_connect
    return fn()
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 320, in connect
    return _ConnectionFairy._checkout(self)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 884, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 486, in checkout
    rec = pool._do_get()
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 256, in _do_get
    return self._create_connection()
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 266, in _create_connection
    return _ConnectionRecord(self)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 381, in __init__
    self.__connect()
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 677, in __connect
    with util.safe_reraise():
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
    compat.raise_(
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
    raise exception
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 673, in __connect
    self.dbapi_connection = connection = pool._invoke_creator(self)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 578, in connect
    return dialect.connect(*cargs, **cparams)
  File "/home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 598, in connect
    return self.dbapi.connect(*cargs, **cparams)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file
(Background on this error at: https://sqlalche.me/e/14/e3q8)

> /home/david/projects/ctc-playground/venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py(598)connect()
-> return self.dbapi.connect(*cargs, **cparams)
(Pdb) c

Feature: Build rate limiter to respect Alchemy's Free Tier CUPS

Hi ctc looks magnificent. With the following command I think I'm getting rate limited by Alchemy as I'm getting 429'd:

ctc uniswap chart 0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640

As you can see here.
https://user-images.githubusercontent.com/42708283/193460468-32a6de08-b897-41af-ba10-cd08ada71f93.mov

From what I read, ctc is exceeding compute requests per second. Is there another archival node provider recommended to use instead, or is it possible to implement some of the suggestions found here:
https://docs.alchemy.com/reference/throughput#retries

`ctc erc20 balances xxxx` issue

OS: Win11 + WSL/Ubuntu 20.04

Just upgraded to the latest version.

(base) caleb@CORUSCANT:/$ ctc erc20 balances 0x11e52c75998fe2E7928B191bfc5B25937Ca16741
searching for creation block of 0x11e52c75998fe2E7928B191bfc5B25937Ca16741
- trying block: 0
- trying block: 14537156
Traceback (most recent call last):
  File "/home/caleb/miniconda3/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/caleb/miniconda3/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/__main__.py", line 4, in <module>
    ctc.cli.run_cli()
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/cli/cli_run.py", line 163, in run_cli
    toolcli.run_cli(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcli/command_utils/execution.py", line 55, in run_cli
    execute_parsed_command(parse_spec=parse_spec, args=args)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcli/command_utils/execution.py", line 74, in execute_parsed_command
    execute_command_spec(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcli/command_utils/execution.py", line 122, in execute_command_spec
    asyncio.run(function(**args))
  File "/home/caleb/miniconda3/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/home/caleb/miniconda3/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/cli/commands/data/erc20/balances_command.py", line 151, in async_balances_command
    transfers = await evm.async_get_erc20_transfers(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/evm/erc20_utils/erc20_events.py", line 30, in async_get_erc20_transfers
    transfers = await event_utils.async_get_events(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/evm/event_utils/event_crud.py", line 45, in async_get_events
    start_block = await block_utils.async_get_contract_creation_block(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/evm/block_utils/block_search.py", line 62, in async_get_contract_creation_block
    result = await search_utils.async_binary_search(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/toolbox/search_utils.py", line 124, in async_binary_search
    raise NoMatchFound('could not find match')
ctc.toolbox.search_utils.NoMatchFound: could not find match
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f1b8e6b7c10>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f1b8c42cee0>, 1622.7398384)]']
connector: <aiohttp.connector.TCPConnector object at 0x7f1b8ea3f250>
sys:1: RuntimeWarning: coroutine 'async_get_erc20_symbol' was never awaited

I run the python sample and get "Exception: no default network specified"

I run this:
https://ctc.readthedocs.io/en/latest/python/protocols/chainlink.html

I get this Error Message:

Output exceeds the [size limit](command:workbench.action.openSettings?[). Open the full output data [in a text editor](command:workbench.action.openLargeOutput?892f1b88-5b61-4594-a1b3-9f12baf5b467)
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
Cell In [48], line 5
      3 feed = '0x31e0a88fecb6ec0a411dbe0e9e76391498296ee9'
      4 await chainlink_utils.async_resolve_feed_address(feed)
----> 5 data = await chainlink_utils.async_get_feed_datum(feed)
      6 data 

File ~/.pyenv/versions/3.9.13/lib/python3.9/site-packages/ctc/protocols/chainlink_utils/chainlink_data/feed_datum.py:57, in async_get_feed_datum(feed, fields, normalize, invert, block, provider)
     53 feed = await chainlink_feed_metadata.async_resolve_feed_address(feed)
     55 if fields == 'answer':
---> 57     result = await rpc.async_eth_call(
     58         to_address=feed,
     59         function_abi=chainlink_spec.feed_function_abis['latestAnswer'],
     60         block_number=block,
     61         provider=provider,
     62         fill_empty=True,
     63         empty_token=None,
     64     )
     66     if not isinstance(result, (int, float)):
     67         raise Exception('invalid rpc result')

File ~/.pyenv/versions/3.9.13/lib/python3.9/site-packages/ctc/rpc/rpc_executors/rpc_state_executors.py:66, in async_eth_call(to_address, from_address, gas, gas_price, value_sent, block_number, call_data, function_parameters, provider, decode_response, delist_single_outputs, package_named_outputs, fill_empty, empty_token, function_abi, function_name, contract_abi, n_parameters, parameter_types, function_selector)
     53 request = rpc_constructors.construct_eth_call(
     54     to_address=to_address,
...
--> 145     raise Exception('no default network specified')
    147 if not isinstance(network, int):
    148     if isinstance(network, str):

Exception: no default network specified

Happens to me on my M1 Macbook and Google Colab.

ModuleNotFoundError: No module named 'toolstr.charts'

When running ctc setup after successfully installing checkthechain I get the following error:

ModuleNotFoundError: No module named 'toolstr.charts'

Seems like maybe the wrong version of toolstr is depended on by the package? Looks like a great tool by the way!

db empty, commands that require read from db seem to fail

Great project!
I found some issues when using commands that require reads from the db (using sqlite backend).

ctc uniswap chart 0x7a809081f991eCfe0aB2727C7E90D2Ad7c2E411E
gives following error:

KeyError: 'block_timestamps__network_1'
db exists in the location specified in the config, but is empty

Update Readme with dependencies

Specifically, I'm trying to install and got an error because I don't have gcc installed.
On linux this can be done with:

sudo apt-get install build-essential

feature: RPC Caching

The cache system for events is extremely useful if you are not running an archive node yourself because you can quickly get blocked by infura limits.

What do you think about implementing a similar system for RPC calls?

# cache the call if you pass a specific block number
rpc.async_eth_call(
    ...,
    block_number=block_number
)
# don't cache the call if `latest` is used
rpc.async_eth_call(
    ....,
)

My main use case for now is on async_eth_call and async_eth_get_code

`ctc ens` not successful

% ctc ens vitalik.eth                               
Tried to read 32 bytes.  Only got 0 bytes
sys:1: RuntimeWarning: coroutine 'async_resolve_name' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

not sure what to make of this. rpc was configured properly, like ctc decode call works for me.

anything else i need to configure in order to use the ens command?

fix: Networking broken on Apple M1

After running ctc setup to config my RPC url, and then running llama pools, I got the following error:

ConnectionKey(host='yields.llama.fi', port=443, is_ssl=True, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=None)

The RPC URL is valid and works fine on other projects. Wonder what's the causes of it and it would be great to have better error message display. Thanks!

Setup error when not using default ctc_data location

When running ctc setup the installation was failing with a warning that the sqlite db file could not be opened because it was not created when using a custom ctc_data location (see below). When I switched to using the default home directory, it worked as expected:

## Data Root Directory

Where should ctc store data? (specify a directory path) (default = /home/michael/ctc_data) /home/michael/ctc_test/ctc_data
creating directory: /home/michael/ctc_test/ctc_data/dbs
creating directory: /home/michael/ctc_test/ctc_data/logs
creating directory: /home/michael/ctc_test/ctc_data/evm
creating directory: /home/michael/ctc_test/ctc_data/logs/rpc
creating directory: /home/michael/ctc_test/ctc_data/logs/db

Do you want to disable ctc logging? (default = no)


## Database Setup

ctc stores its collected chain data in an sql database

Creating database at path /home/michael/ctc_test/ctc_data/dbs/ctc.db

[WARNING] ctc config file does not exist; use `ctc setup` on command line to generate a config file
(sqlite3.OperationalError) unable to open database file

`ctc fei pcv` not working

OS: WSL/Ubuntu 20.04
Python 3.8.10

Fresh install, using Alchemy as the provider, on mainnet.

Error:

(base) caleb@CORUSCANT:~/fei-protocol-core$ ctc fei pcv
fetching abi from etherscan: 0xff6f59333cfd8f4ebc14ad0a0e181a83e655d257
saving contract_abi to: /home/caleb/.ctcdata/mainnet/contract_abis/contract__0xff6f59333cfd8f4ebc14ad0a0e181a83e655d257/contract__0xff6f59333cfd8f4ebc14ad0a0e181a83e655d257.json
Traceback (most recent call last):
  File "/home/caleb/miniconda3/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/caleb/miniconda3/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/__main__.py", line 4, in <module>
    ctc.cli.run_cli()
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/cli/cli_run.py", line 163, in run_cli
    toolcli.run_cli(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcli/command_utils/execution.py", line 55, in run_cli
    execute_parsed_command(parse_spec=parse_spec, args=args)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcli/command_utils/execution.py", line 74, in execute_parsed_command
    execute_command_spec(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcli/command_utils/execution.py", line 122, in execute_command_spec
    asyncio.run(function(**args))
  File "/home/caleb/miniconda3/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/home/caleb/miniconda3/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/protocols/fei_utils/cli/fei/pcv_command.py", line 30, in async_pcv_command
    FEI = directory.get_erc20_address('FEI')
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/directory/erc20s.py", line 86, in get_erc20_address
    metadata = get_erc20_metadata(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/directory/erc20s.py", line 53, in get_erc20_metadata
    erc20_data = load_filesystem_erc20_data(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcache/cache_decorator.py", line 135, in new_f
    return execute_with_cache(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcache/cache_decorator.py", line 210, in execute_with_cache
    output = old_f(*args, **kwargs)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/directory/erc20s.py", line 158, in load_filesystem_erc20_data
    return store_utils.load_file_data(path)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcache/cache_decorator.py", line 135, in new_f
    return execute_with_cache(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcache/cache_decorator.py", line 210, in execute_with_cache
    output = old_f(*args, **kwargs)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/toolbox/store_utils/store_crud.py", line 34, in load_file_data
    with open(path, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/caleb/.ctcdata/mainnet/erc20s/1inch.csv'
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f6770febee0>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f6770fd2f40>, 18023.4357274)]']
connector: <aiohttp.connector.TCPConnector object at 0x7f6770febcd0>

`ctc address` verbose mode not recognized

OS: Win11 + WSL / Ubuntu 20.04

(base) caleb@CORUSCANT:/$ ctc address -h
usage:
    ctc address ADDRESS [options]

description:
    summarize address

arguments:
    ADDRESS                 address to get summary of
    -v, --verbose           emit extra output
    --raw                   emit abi in raw json
    --network NAME_OR_ID    network name or id to scan address of
(base) caleb@CORUSCANT:/$ ctc addresss 0x11e52c75998fe2E7928B191bfc5B25937Ca16741 -v
usage: ctc  QUERY
ctc: error: unrecognized arguments: -v

Help message is not very clear

~ ยป ctc address                                       caleb@DESKTOP-8BF3E2A
usage: __main__.py [-h] [-v] [--network NETWORK]
                   [--new_dir_tempfile NEW_DIR_TEMPFILE]
                   address
__main__.py: error: the following arguments are required: address

__main__.py is confusing

Batch call fail on avax rpc provider due to rounding of id

Hi, awesome project!

Find an unexpected behavior of avax rpc. The response will round the id. I tried to dig into avalanchego but could not find out why. Simply change this line from 1e18 to 1e10 can address this. Don't know if it is a good choice, but it seems like 1e18 is also a random choice right?

https://github.com/fei-protocol/checkthechain/blob/main/src/ctc/rpc/rpc_request.py#L72

-> return [responses_by_id[subrequest["id"]] for subrequest in request]
(Pdb) l
133             for response in response_chunk
134         }
135         import pdb
136  
137         pdb.set_trace()
138  ->     return [responses_by_id[subrequest["id"]] for subrequest in request]
139  
140  
141     #
142     # # chunking
143     #
(Pdb) request
[{'jsonrpc': '2.0', 'method': 'eth_call', 'params': [{'to': '0xe28984e1ee8d431346d32bec9ec800efb643eef4', 'data': '0x0902f1ac'}, 'latest'], 'id': 972368151755465620}, {'jsonrpc': '2.0', 'method': 'eth_call', 'params': [{'to': '0xed8cbd9f0ce3c6986b22002f03c6475ceb7a6256', 'data': '0x0902f1ac'}, 'latest'], 'id': 544317960183964431}]
(Pdb) responses_by_id
{972368151755465600: {'jsonrpc': '2.0', 'id': 972368151755465600, 'result': '0x00000000000000000000000000000000000000000000147f7fac02df4d9487ce000000000000000000000000000000000000000000000000000006e65ba4eabf0000000000000000000000000000000000000000000000000000000062539ec0'}, 544317960183964400: {'jsonrpc': '2.0', 'id': 544317960183964400, 'result': '0x000000000000000000000000000000000000000000007fa87e9383ccb4fe800400000000000000000000000000000000000000000000000000002b039e10dbd90000000000000000000000000000000000000000000000000000000062539f6b'}}
(Pdb) 972368151755465600
972368151755465600
(Pdb) 972368151755465620
972368151755465620

`ctc setup` error

Env: Win11 + WSL (Ubuntu)
Python: 2.7.18
Pip: 20.0.2

After building from master, I cd into the scripts folder and run the following:

caleb@CORUSCANT:~$ ctc setup
'type' object is not subscriptable

I attempted to fix the error potentially by deleteing my ctc config folder. Same error.

RPC ERROR: query returned more than 10000 results

I've had some commands work but for most of them I'm getting something like: RPC ERROR: query returned more than 10000 results or RPC ERROR: query timeout exceeded. I'm not sure if this has something to do with my RPC provider or ctc so help is appreciated

Commands:

$ ctc erc20 transfers 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984
getting events from node, block range: [10861674, 16551277]
RPC ERROR: query returned more than 10000 results
$ POOL="0x94b0a3d511b6ecdb17ebf877278ab030acb0a878" && ctc uniswap swaps $POOL --export swaps.csv
getting events from node, block range: [12125707, 16551166]
RPC ERROR: query timeout exceeded

`ctc ens` bug

OS: WSL/Ubuntu 20.04
Python 3.8.10
RPC: HTTP Alchemy API

(base) caleb@CORUSCANT:~/fei-protocol-core$ ctc ens kryptoklob.eth
fetching abi from etherscan: 0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85
saving contract_abi to: /home/caleb/.ctcdata/mainnet/contract_abis/contract__0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85/contract__0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85.json
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ kryptoklob.eth โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
- address: 0x11e52c75998fe2e7928b191bfc5b25937ca16741
- owner: 0x11e52c75998fe2e7928b191bfc5b25937ca16741
- resolver: 0x4976fb03c32e5b8cfe2b6ccb31c09ba78ebaba41
- namehash: 0xe5e3e30326d8180ff080e07c5a926d021ffc236d5a94da8471e5993fb5da023e
- expiration: 2025-05-04 05:06:00Z
fetching abi from etherscan: 0x4976fb03c32e5b8cfe2b6ccb31c09ba78ebaba41
sleeping 5.284180641174316 seconds for etherscan ratelimit
/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/evm/abi_utils/abi_io/contract_abi_backends/etherscan_contract_abis.py:35: RuntimeWarning: coroutine 'sleep' was never awaited
  asyncio.sleep(sleep_time)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Traceback (most recent call last):
  File "/home/caleb/miniconda3/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/caleb/miniconda3/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/__main__.py", line 4, in <module>
    ctc.cli.run_cli()
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/cli/cli_run.py", line 163, in run_cli
    toolcli.run_cli(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcli/command_utils/execution.py", line 55, in run_cli
    execute_parsed_command(parse_spec=parse_spec, args=args)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcli/command_utils/execution.py", line 74, in execute_parsed_command
    execute_command_spec(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcli/command_utils/execution.py", line 122, in execute_command_spec
    asyncio.run(function(**args))
  File "/home/caleb/miniconda3/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/home/caleb/miniconda3/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/protocols/ens_utils/cli/ens_command.py", line 54, in ens_command
    text_records = await ens_utils.async_get_text_records(name=name)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/protocols/ens_utils/resolver.py", line 99, in async_get_text_records
    text_changes = await async_get_text_changes(name=name, node=node)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/protocols/ens_utils/resolver.py", line 109, in async_get_text_changes
    events = await evm.async_get_events(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/evm/event_utils/event_crud.py", line 58, in async_get_events
    events = await backend_utils.async_run_on_backend(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/toolbox/backend_utils/backend_crud.py", line 37, in async_run_on_backend
    return await function(**function_kwargs)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/evm/event_utils/event_backends/filesystem_events.py", line 359, in async_get_events_from_filesystem
    event_abi = await abi_utils.async_get_event_abi(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/evm/abi_utils/abi_io/event_abi_io.py", line 19, in async_get_event_abi
    contract_abi = await contract_abi_io.async_get_contract_abi(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/evm/abi_utils/abi_io/contract_abi_io.py", line 31, in async_get_contract_abi
    return await backend_utils.async_run_on_backend(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/toolbox/backend_utils/backend_crud.py", line 37, in async_run_on_backend
    return await function(**function_kwargs)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/evm/abi_utils/abi_io/contract_abi_io.py", line 71, in async_download_contract_abi
    contract_abi = await async_transfer_contract_abi(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/evm/abi_utils/abi_io/contract_abi_io.py", line 44, in async_transfer_contract_abi
    return await backend_utils.async_transfer_backends(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/toolbox/backend_utils/backend_crud.py", line 87, in async_transfer_backends
    result = await get(backend=from_backend, **get_kwargs)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/evm/abi_utils/abi_io/contract_abi_io.py", line 31, in async_get_contract_abi
    return await backend_utils.async_run_on_backend(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/toolbox/backend_utils/backend_crud.py", line 37, in async_run_on_backend
    return await function(**function_kwargs)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/evm/abi_utils/abi_io/contract_abi_backends/etherscan_contract_abis.py", line 49, in async_get_contract_abi_from_etherscan
    raise Exception(
Exception: could not obtain contract abi from etherscan for 0x4976fb03c32e5b8cfe2b6ccb31c09ba78ebaba41
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f1ab3f72e80>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f1ab33c2dc0>, 18561.8661614)]']
connector: <aiohttp.connector.TCPConnector object at 0x7f1ab3f72eb0>

timestamp helper

Hey folks,

While using the library I always wanted to query events with timestamps instead of block numbers and this helper was very handy. Should I create a PR to add this to the library? If yes, where would be the best place to put it?

from ctc import spec, evm


async def async_get_timestamp_from_events(df: spec.DataFrame) -> spec.DataFrame:
    """
    Get the timestamp of block from events
    """
    if "block_number" not in df:
        raise Exception("block_number not found in DataFrame")

    block_numbers = list(df["block_number"].unique())
    blocks = await evm.async_get_blocks(block_numbers)

    blocks_timestamp = dict(
        zip(block_numbers, [block["timestamp"] for block in blocks])
    )
    df["timestamp"] = df["block_number"].map(blocks_timestamp)

    return df

Running `ctc QUERY` (without additional args) gives error

OS: WSL/Ubuntu 20.04
Python 3.8.10

Expected behavior: probably should give an example subcommand or show help for this command?

Actual behavior:

(base) caleb@CORUSCANT:~/fei-protocol-core$ ctc QUERY
Traceback (most recent call last):
  File "/home/caleb/miniconda3/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/caleb/miniconda3/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/__main__.py", line 4, in <module>
    ctc.cli.run_cli()
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/cli/cli_run.py", line 163, in run_cli
    toolcli.run_cli(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcli/command_utils/execution.py", line 55, in run_cli
    execute_parsed_command(parse_spec=parse_spec, args=args)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcli/command_utils/execution.py", line 74, in execute_parsed_command
    execute_command_spec(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcli/command_utils/execution.py", line 110, in execute_command_spec
    function(**args)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/cli/commands/root_command.py", line 58, in root_command
    metadata = directory.get_erc20_metadata(symbol=item)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/directory/erc20s.py", line 53, in get_erc20_metadata
    erc20_data = load_filesystem_erc20_data(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcache/cache_decorator.py", line 135, in new_f
    return execute_with_cache(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcache/cache_decorator.py", line 210, in execute_with_cache
    output = old_f(*args, **kwargs)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/directory/erc20s.py", line 158, in load_filesystem_erc20_data
    return store_utils.load_file_data(path)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcache/cache_decorator.py", line 135, in new_f
    return execute_with_cache(
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/toolcache/cache_decorator.py", line 210, in execute_with_cache
    output = old_f(*args, **kwargs)
  File "/home/caleb/miniconda3/lib/python3.8/site-packages/ctc/toolbox/store_utils/store_crud.py", line 34, in load_file_data
    with open(path, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/caleb/.ctcdata/mainnet/erc20s/1inch.csv'

Fresh install of ctc fails on `ctc fei` command

OS: Ubuntu 20.04 via WSL / Win11
Python Version: 3.8

caleb@CORUSCANT:~$ ctc fei
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/caleb/.local/lib/python3.8/site-packages/ctc/__main__.py", line 4, in <module>
    ctc.cli.run_cli()
  File "/home/caleb/.local/lib/python3.8/site-packages/ctc/cli/cli_run.py", line 163, in run_cli
    toolcli.run_cli(
  File "/home/caleb/.local/lib/python3.8/site-packages/toolcli/command_utils/execution.py", line 55, in run_cli
    execute_parsed_command(parse_spec=parse_spec, args=args)
  File "/home/caleb/.local/lib/python3.8/site-packages/toolcli/command_utils/execution.py", line 74, in execute_parsed_command
    execute_command_spec(
  File "/home/caleb/.local/lib/python3.8/site-packages/toolcli/command_utils/execution.py", line 110, in execute_command_spec
    function(**args)
  File "/home/caleb/.local/lib/python3.8/site-packages/ctc/cli/commands/root_command.py", line 58, in root_command
    metadata = directory.get_erc20_metadata(symbol=item)
  File "/home/caleb/.local/lib/python3.8/site-packages/ctc/directory/erc20s.py", line 53, in get_erc20_metadata
    erc20_data = load_filesystem_erc20_data(
  File "/home/caleb/.local/lib/python3.8/site-packages/toolcache/cache_decorator.py", line 135, in new_f
    return execute_with_cache(
  File "/home/caleb/.local/lib/python3.8/site-packages/toolcache/cache_decorator.py", line 210, in execute_with_cache
    output = old_f(*args, **kwargs)
  File "/home/caleb/.local/lib/python3.8/site-packages/ctc/directory/erc20s.py", line 158, in load_filesystem_erc20_data    return store_utils.load_file_data(path)
  File "/home/caleb/.local/lib/python3.8/site-packages/toolcache/cache_decorator.py", line 135, in new_f
    return execute_with_cache(
  File "/home/caleb/.local/lib/python3.8/site-packages/toolcache/cache_decorator.py", line 210, in execute_with_cache
    output = old_f(*args, **kwargs)
  File "/home/caleb/.local/lib/python3.8/site-packages/ctc/toolbox/store_utils/store_crud.py", line 34, in load_file_data
    with open(path, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/caleb/.ctcdaaaata/mainnet/erc20s/1inch.csv'

'more than one match found in sequence' when having additional RPC provider

Hi,

new user here. I keep getting 'more than one match found in sequence' (probably this): https://github.com/fei-protocol/checkthechain/blob/55cdad220d106a16205f8299fc3ad595cb36ba07/src/ctc/toolbox/search_utils.py#L66
for various commands, e.g.

Some random USDC tx:

ctc 0x65dacb1027ed5aaf82daa98a449151fe77bb10e73727c4823e388710bb7eb33d
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Transaction Summary โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
- hash: 0x65dacb1027ed5aaf82daa98a449151fe77bb10e73727c4823e388710bb7eb33d
- from: 0x6c6b6b70c31edfd9c0fb8070c713c06ee687aad2
- to: 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
- block number: 15648723
- transaction index: 76
- nonce: 15
- type: legacy (0)
- call data length: 138
more than one match found in sequence

WETH withdrawals:

ctc events 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 Withdrawal
more than one match found in sequence

Using Python 3.10.4 & checkthechain==0.3.0 installed with pip within a conda 4.14.0 env.

btw. during installation had to do ctc setup --overwrite, otherwise the config file would not appear.

Specify network

What happens with the --network flag? My default network is Mumbai, but I want to run a command in another network; how do I do this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.