Configuration
TLDR
Run ctc setup on the command line to create the config. Run it again to edit the config.
ctc uses a configuration file to control its behavior.
Setting Config Parameters
Users do not need to directly create or edit ctc config files. Instead, all config parameters can be adjusted by using the setup wizard by running ctc setup on the command line. This can be used both for creating new configs and modifying the current config.
By default ctc will looks for a config file at ~/.config/ctc/config.json. But if the CTC_CONFIG_PATH environment variable is set, it will use that path instead.
ctc can also function under a “no-config” mode, where ctc setup does not need to be run. To use this mode, simply set the ETH_RPC_URL to an RPC provider url.
Config Parameters
The config file consists of key-value pairs. The keys:
config_spec_version: thectcversion used to create the configdata_dir: the directory wherectcstores its dataproviders: metadata about RPC providersnetworks: metadata about networks including their names andchain_id’sdefault_network: default network to usedefault_providers: default provider for each networkdb_configs: database configuration informationlog_rpc_calls: whether to log rpc callslog_sql_queries: whether to log sql queries
A python type specification for the config can be found in the config typedefs file.
Reading Config Parameters
On the command line, running ctc config will print information about the config including its location on the filesystem and its current values.
In python, the ctc.config module has many functions for getting config data:
from ctc import config
config_path = config.get_config_path()
data_dir = config.get_data_dir()
providers = config.get_providers()