-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce crate ibc-chain-registry
and hermes config auto
to automatically generate a config file
#2533
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem like the CLI parameter names for the hermes config auto
command adhere to ADR 010. Are users supposed to be able to pass in as many chain IDs and key names as they would like? Or are users only able to supply two chain IDs and two key names?
There's also a fair bit of duplicated code. For example, AssetList::fetch
and ChainData::fetch
are essentially the same functions. select_healthy_rpc
and select_healthy_grpc
as well. While you'd typically abstract these into traits, it looks like doing that with these functions isn't currently possible due to them being async
, unless we want to pull in the async-trait crate, but that doesn't really seem worth it to me.
Co-authored-by: Sean Chen <seanchen11235@gmail.com>
I will rename every parameter. I also think
They are able to pass in as many chain_id and key_names as they'd like.
Done. |
Co-authored-by: Sean Chen <seanchen11235@gmail.com>
Co-authored-by: Sean Chen <seanchen11235@gmail.com>
Co-authored-by: Sean Chen <seanchen11235@gmail.com>
Co-authored-by: Sean Chen <seanchen11235@gmail.com>
Co-authored-by: Sean Chen <seanchen11235@gmail.com>
@romac Done ! |
@romac Now that v1 is released, can we re-open this PR and get it merged for v1.1? 🙂 |
Yep, let's re-open all the PRs in v1.1 milestone |
@AlianBenabdallah Looks like there are some merge conflicts that need to be resolved, but once that's done, we can merge this 🙂 |
It is done and ready to merge ! |
…matically generate a config file (informalsystems#2533) * tmp * read from chain registry * add crate to load data from chain registry * dependencies * incomplete * chain-registry crate ready * chain-registry ready * minor changes * command implemented, todo: tests and doc * added test, fixed empty grpc issue * fmt * minor change * Update top level comments Co-authored-by: Sean Chen <seanchen11235@gmail.com> * Update relayer-cli/src/commands/config/auto.rs Co-authored-by: Sean Chen <seanchen11235@gmail.com> * Update chain-registry/src/relayer_config.rs Co-authored-by: Sean Chen <seanchen11235@gmail.com> * Update relayer-cli/src/commands/config/auto.rs Co-authored-by: Sean Chen <seanchen11235@gmail.com> * Update chain-registry/src/relayer_config.rs Co-authored-by: Sean Chen <seanchen11235@gmail.com> * Update chain-registry/src/relayer_config.rs Co-authored-by: Sean Chen <seanchen11235@gmail.com> * Apply suggestions from code review Co-authored-by: Sean Chen <seanchen11235@gmail.com> * renamed parameters * small improvement * fixed chain_id * use websocketclient * better error handling * merge trait fetch and filename -> fetchable, use tokio::test * wss instead of ws * Apply suggestions from code review Co-authored-by: Sean Chen <seanchen11235@gmail.com> * sort error in alphabetical order * Apply suggestions from code review Co-authored-by: Romain Ruetschi <romain@informal.systems> * use PathBuf, remove &str instead of String, replace unwrap by error * fix dependency issues, better error handling * support fetch ibc path * Flesh our relayer_config docs a bit * minor changes * Document the `AutoCmd` type * support PacketFilters + documentation * fmt * new tests * fmt * context oriented query * different code structure * add comments * remove todo statement * even more tests * add tests for formatter * clippy + fmt * more and more tests * update comment to add constraint on get_configs * check filter len * documentation improvements * fmt and add is_empty to ChannelFilters * changelog update * Formatting nits * More formatting nits * auto key support * More formatting nits * Clean up changelog entries a bit * Split utils.rs into fetchable.rs and constants.rs. Fixed tests + apply review * bug fix + removed keys argument from get_config + guide/doc update * delete example_config.toml, update log info and doc * renamed chain-registry to ibc-chain-registry, moved relayer_config.rse to relayer-cli/chain_registry, minor code improvements * fetch more data from chain.json * changelog update * remove explorers because it can be duplicated and cause an error, add more deserialization tests * rename tests * fix doc * update doc * remove keys argument, read from last commit * change --path to --output * Fix clippy warnings * Skip serialiazing `proof_specs` setting if default by turning it into an `Option` * Typo * Fix clippy warning * Formatting and case * Refactor `config auto` code a bit * Add tracing to chain-registry * Refactor chain_registry in Hermes CLI * Refactor `hermes_config` a little * Revert "Refactor chain_registry in Hermes CLI" This reverts commit 39ec5da. * revert commit 39ec5da and code refactoring * update guide * fix cargo toml * add new config params * Remove an unneeded `?` Co-authored-by: Sean Chen <seanchen11235@gmail.com> Co-authored-by: Romain Ruetschi <romain@informal.systems>
Closes: #2187
Status
Ready for review
config.toml
Description
hermes config auto [OPTIONS] --output <PATH> -chains <CHAIN_NAME_1[:<KEY1>] CHAIN_NAME_2[:<KEY2>]> [--commit <COMMIT_HASH>]
which fetches data from the chain-registry and automatically generates a config file.Design choices
PR author checklist:
unclog
.docs/
).Reviewer checklist:
Files changed
in the GitHub PR explorer.