-
Notifications
You must be signed in to change notification settings - Fork 4
📝 Configuration
web3cli
should work out of the box for most cases. Sometimes however the need may arise to change its default behaviour. This is done by changing its configuration settings.
web3cli
reads its settings from three places, in this order of priority:
- From environment variables
- From the
web3cli.yaml
file in the working directory - From the
web3cli.yaml
file in your your home folder, more precisely$HOME/.web3cli/config/web3cli.yaml
If the same setting is present in both configuration files, the one in the working directory wins. Similarly, a setting specified via an environment variable wins on either config file.
Please refer to the example configuration file for a list of all settings that can be changed.
All settings can be overridden via environment variables.
For example, the default_chain
settings can be overridden by setting the env variable WEB3CLI_DEFAULT_CHAIN
:
WEB3CLI_DEFAULT_CHAIN=avax w3 chain get # output: avax
You can edit the configuration files using w3 config
.
For example, run w3 config set default_chain avax
to set Avalanche as the default chain. This will modify the web3cli.yaml
file in your home folder.
To modify the config file in the working directory, add the --no-global
flag. Remember that local settings always win over global ones.
To show the whole configuration that will be used by web3cli
, run w3 config get
.
To show a specific setting, just add the setting name: w3 config get default_chain