forked from cosmos/ibc-go
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR cosmos#557: Pull chain data from Chain Registry, Add paths n…
…ew cmd, & Improve CLI experience/quick-start guide * use chain registry + formatting fixes * remove fetch commands and add chain and path fetching behind chains and paths cmd trees * actually fetch a chains assetlist.json file from chain registry * fix quick-start guide * small fixes to README.md * more small fixes to README.md * fix tabs in README.md * fix tabs in README.md * undo last changes * minor changes to readme * added ds_store * Merge PR cosmos#564: Add command for creating a new blank path * add command to create a new blank path in the config * add retries & cleanup CreateClients * use tagged lens version Co-authored-by: Dan Kanefsky <[email protected]> Co-authored-by: Jack Zampolin <[email protected]>
- Loading branch information
1 parent
54f5f9c
commit b11c34f
Showing
19 changed files
with
566 additions
and
450 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,5 @@ two-chains/ibc-* | |
two-chains/.relayer | ||
two-chains/*.log | ||
test/setup/valkeys/*.json | ||
test/keys/ | ||
test/keys/ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,46 +40,58 @@ To quickly setup the IBC relayer on a canonical path (i.e. path being actively u | |
|
||
``` | ||
$ git clone [email protected]:cosmos/relayer.git | ||
$ git checkout v1.0.0 | ||
$ git checkout v2.0.0 | ||
$ cd relayer && make install | ||
``` | ||
2. Initialize the relayer's configuration. | ||
2. Initialize the relayer's configuration directory/file | ||
```shell | ||
$ rly config init | ||
``` | ||
|
||
3. Ensure the chains you want to configure have the pertinent config files [here](https://github.com/cosmos/relayer/tree/main/interchain/chains). Don't see the chain you want to relay on? Please open a PR to add this metadata to the GitHub repo! | ||
3. Ensure the chains you want to configure have the pertinent config files [here](https://github.com/cosmos/chain-registry). | ||
|
||
> **NOTE:** Don't see the chain you want to relay on? | ||
> Please open a PR to add this metadata to the GitHub repo! | ||
4. In our example we will configure the relayer to operate between the Cosmos Hub & Osmosis. The fetch cmd will retrieve the relevant chain configurations from [GitHub](https://github.com/cosmos/relayer/tree/main/interchain/chains) & add them to the relayers config file. | ||
4. In our example we will configure the relayer to operate between the Cosmos Hub & Osmosis. | ||
The `chains add` cmd will retrieve the relevant chain configurations from [chain-registry](https://github.com/cosmos/chain-registry) & add them to the relayers config file. | ||
|
||
```shell | ||
$ rly fetch chain cosmoshub-4 | ||
$ rly fetch chain osmosis-1 | ||
$ rly chains add cosmoshub osmosis | ||
``` | ||
|
||
5. The relayer connects to a node on the respective networks, via the configured RPC endpoints for each chain. Ensure the `rpc-addr` field for both chains in `config.yaml` points to a valid RPC endpoint. | ||
|
||
> **NOTE:** Strangelove maintains archive nodes for a number of networks and provides them for public usage. Chains that we maintain endpoints for are preconfigured. | ||
> **NOTE:** Strangelove maintains archive nodes for a number of networks and provides them for public usage. Chains that we maintain endpoints for are preconfigured. | ||
6. Either import or create new keys for the relayer to use when signing and relaying transactions. | ||
|
||
> **NOTE:** `key-name` is an identifier of your choosing. | ||
6. Either import or create new keys for the relayer to use when signing and | ||
relaying transactions. | ||
`key-name` is an identifier of your choosing. | ||
**Create**(add): | ||
|
||
```shell | ||
$ rly keys add cosmoshub-4 [key-name] | ||
$ rly keys add osmosis-1 [key-name] | ||
``` | ||
OR | ||
|
||
7. Edit the relayer's config file to assign the chain-specific keys created or imported above to the | ||
specific chain's configuration. Default file location is `~/.relayer/config/config.yaml` | ||
`key-name` is the same as Step 7. | ||
**Import**(restore): | ||
```shell | ||
$ rly keys restore cosmoshub-4 [key-name] "mnemonic words here" | ||
$ rly keys restore osmosis-1 [key-name] "mnemonic words here" | ||
``` | ||
|
||
7. Edit the relayer's "key:" values in the config file to match the `key-name`'s chosen above. This step is necessary if you chose a `key-name` other than "default" | ||
|
||
> **NOTE:** Default file location is `~/.relayer/config/config.yaml`. | ||
|
||
8. Both relayer accounts, i.e. the two keys we just added or imported, need to be | ||
funded with tokens on the appropriate network in order to successfully relay transactions | ||
between the IBC-connected networks. How this occurs depends on the network, | ||
context and environment, e.g. local or test networks can use a faucet. | ||
between the IBC-connected networks. | ||
How this occurs depends on the network, context and environment, e.g. local or test networks can use a faucet. | ||
|
||
9. Ensure both relayer accounts are funded by querying each. | ||
|
||
|
@@ -88,14 +100,18 @@ To quickly setup the IBC relayer on a canonical path (i.e. path being actively u | |
$ rly q balance osmosis-1 | ||
``` | ||
|
||
10. Fetch and configure the relevant path configuration files for the two chains. | ||
10. Fetch and configure the relevant path configuration files for the two chains. | ||
`paths fetch` will check for the relevant `path.json` files for all configured chains in the [interchain](https://github.com/cosmos/relayer/tree/main/interchain) directory | ||
|
||
> **NOTE:** Don't see the path metadata for paths you want to relay on? | ||
> Please open a PR to add this metadata to the GitHub repo! | ||
```shell | ||
$ rly fetch paths | ||
$ rly paths fetch | ||
``` | ||
11. Finally, we start the relayer on the path. The relayer will periodically update | ||
the clients and listen for IBC messages to relay. | ||
11. Finally, we start the relayer on the path. | ||
The relayer will periodically update the clients and listen for IBC messages to relay. | ||
```shell | ||
$ rly paths list | ||
|
@@ -111,7 +127,7 @@ steps are typically performed: | |
``` | ||
$ git clone [email protected]:cosmos/relayer.git | ||
$ git checkout v1.0.0-rc2 | ||
$ git checkout v2.0.0 | ||
$ cd relayer && make install | ||
``` | ||
|
@@ -121,26 +137,34 @@ steps are typically performed: | |
$ rly config init | ||
``` | ||
|
||
3. Add relevant chain configurations to the relayer's configuration. See the | ||
[Chain](https://pkg.go.dev/github.com/cosmos/relayer/relayer#Chain) type for | ||
more information. | ||
3. Add relevant chain configurations to the relayer's configuration. | ||
See the [Chain](https://pkg.go.dev/github.com/strangelove-ventures/relayer/relayer#Chain) type for more information. | ||
e.g. chain configuration: | ||
```shell | ||
# chain_a_config.json | ||
# cosmoshub-4.json | ||
{ | ||
"chain-id": "chain-a", | ||
"rpc-addr": "http://127.0.0.1:26657", | ||
"account-prefix": "cosmos", | ||
"gas-adjustment": 1.5, | ||
"gas-prices": "0.001umuon", | ||
"trusting-period": "10m" | ||
"type": "cosmos", | ||
"value": { | ||
"key": "test-key", | ||
"chain-id": "cosmoshub-4", | ||
"rpc-addr": "https://cosmoshub-4.technofractal.com:443", | ||
"grpc-addr": "https://gprc.cosmoshub-4.technofractal.com:443", | ||
"account-prefix": "cosmos", | ||
"keyring-backend": "test", | ||
"gas-adjustment": 1.3, | ||
"gas-prices": "0.025uatom", | ||
"debug": true, | ||
"timeout": "10s", | ||
"output-format": "json", | ||
"sign-mode": "direct" | ||
} | ||
} | ||
``` | ||
```shell | ||
$ rly chains add -f chain_a_config.json | ||
$ rly chains add -f cosmoshub-4.json | ||
$ rly chains add -f chain_b_config.json | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.