Generating and Validating Config Files
Show usage
To see the available sub-commands for the config
command run:
hermes help config
The available sub-commands are the following:
DESCRIPTION:
Generate a new Hermes configuration file or validate an existing one
USAGE:
hermes config <SUBCOMMAND>
OPTIONS:
-h, --help Print help information
SUBCOMMANDS:
auto Automatically generate a config.toml for the specified chain(s)
help Print this message or the help of the given subcommand(s)
validate Validate the relayer configuration
Automatically generate configuration files for specified chains
Use config auto
to automatically generate a configuration file from the chain-registry.
WARNING: Currently,
default_gas
andmax_gas
parameters are set to default values; these should be manually reset. Thegas_price
parameter is set as the average gas price listed for the chain in the chain registry.
DESCRIPTION:
Automatically generate a config.toml for the specified chain(s)
USAGE:
hermes config auto [OPTIONS] --output <PATH> --chain <CHAIN1_NAME:OPTIONAL_KEY_NAME> --chain <CHAIN2_NAME:OPTIONAL_KEY_NAME>
OPTIONS:
--commit <COMMIT_HASH> Commit hash from which the chain configs will be generated. If
it's not set, the latest commit will be used.
-h, --help Print help information
REQUIRED:
--chains <CHAIN_NAME:OPTIONAL_KEY_NAME>...
Names of the chains to include in the configuration, together with an optional key name.
Either repeat this argument for every chain or pass a space-separated list of chains.
Every chain must be found in the chain registry.
--output <PATH>
Path to the configuration file
Example
Use config auto
to generate a configuration file that is able to relay between cosmoshub
and osmosis
. This command assumes the existence of a key file for cosmoshub-4
and osmosis-1
in $HOME/.hermes/keys
.
hermes config auto --output ~/example_config.toml --chain cosmoshub osmosis --chain
2022-08-16T17:27:26.966233Z INFO ThreadId(01) using default configuration from '~/.hermes/config.toml'
2022-08-16T17:27:27.800213Z INFO ThreadId(01) cosmoshub-4: uses key "key_cosmoshub"
2022-08-16T17:27:27.841167Z INFO ThreadId(01) osmosis-1: uses key "key_osmosis"
2022-08-16T17:27:27.841890Z WARN ThreadId(01) Gas parameters are set to default values.
SUCCESS Config file written successfully at '~/example_config.toml'
It is also possible to manually specify a key name for any chain.
hermes config auto --output ~/example_config.toml --chain cosmoshub:random_key osmosis --chain
2022-08-16T17:29:56.902499Z INFO ThreadId(01) using default configuration from '~/.hermes/config.toml'
2022-08-16T17:29:57.288874Z INFO ThreadId(01) cosmoshub-4: uses key "random_key"
2022-08-16T17:29:57.289728Z INFO ThreadId(01) osmosis-1: uses key "key_osmosis"
2022-08-16T17:29:57.290314Z WARN ThreadId(01) Gas parameters are set to default values.
SUCCESS "Config file written successfully : ~/example_config.toml."
WARNING : Do not forget to modify the gas settings before relaying !
Validate an existing configuration file
Use config validate
to perform a quick syntactic validation of
your configuration file.
DESCRIPTION:
Validate the relayer configuration
USAGE:
hermes config validate
OPTIONS:
-h, --help Print help information
Example
Validate the default config file, the path inferred automatically to be
$HOME/.hermes/config.toml
.
hermes config validate
Which should output something similar to:
Jul 12 16:31:07.017 INFO using default configuration from '$HOME/.hermes/config.toml'
SUCCESS: "validation passed successfully"
Validate a config file at an arbitrary location:
hermes --config $CONFIGPATH config validate
This one should fail validation because we mistakenly added two separate sections for the same chain ibc-1
:
error: hermes fatal error: config error: config file has duplicate entry for the chain 'ibc-1'