Add initial support for Ocular to automate part of Hermes configuration #2187
Description
Summary
Add a hermes config add <CHAIN_ID>
CLI to automatically populate a new section in the Hermes configuration file with data for chain <CHAIN_ID>
based on data from the chain-registry.
Problem Definition
Developers and beginner relayer users do not have access to their own full nodes for relaying or reading on-chain state from production. Even with full nodes available, it can difficult to configure correctly the config.toml
of Hermes.
Proposal
We can use the chain-registry data to populate correctly a config.toml section for Hermes, for any chain present in the registry. Ocular is a Rust library to access the information stored in the chain-registry. In here we describe some ways in which Hermes can make use of Ocular.
In particular for the present issue, we'll likely depend on the ocular API method fn chain_info(chain_id: String) -> ChainInfo
to be able to fetch chain information from the chain registry. The description of ChainInfo
is not yet available, but the section "Ocular requirement B" from the issue linked above provides details about it. From the resulting ChainInfo
we can generate a Hermes chain configuration section in config.toml
.
Update: On the ocular side, initial support is now available for our use-case: PeggyJV/ocular#63
Acceptance Criteria
- add
hermes config add <CHAIN_ID>
with the details provided above - we're not interested path information (i.e., channel filter), so we can skip populating the
[chains.packet_filter]
section
For Admin Use
- Not duplicate issue
- Appropriate labels applied
- Appropriate milestone (priority) applied
- Appropriate contributors tagged
- Contributor assigned/self-assigned