Skip to content

Commit

Permalink
docs: update icamauth (#1905)
Browse files Browse the repository at this point in the history
* docs: update icamauth

* docs: restructure icamauth docs

* docs: update links

* docs: fix dead links
  • Loading branch information
yaruwangway authored Nov 16, 2022
1 parent 037d23a commit 26c891b
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ Updated Modules in V8 Rho
## New Modules in Rho V8
- [Global Fee](./globalfee.md)
- [Group](./group.md)
- [ICA-Mauth](./icamauth/)
- [ICA-Mauth](./icamauth.md)

21 changes: 13 additions & 8 deletions docs/modules/icamauth/README.md → docs/modules/icamauth.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The following command allows you to query all the allowed message types on a hos
gaiad q interchain-accounts host params
```

The following tutorial will demonstrate how to use Interchain Accounts through the [icamauth module](../../../x/icamauth).
The following tutorial will demonstrate how to use Interchain Accounts through the [icamauth module](../../x/icamauth).

## Setup preparation
We will run two Cosmos-SDK chains (controller chain: `test-0` and host chain: `test-1`) and a relayer to connect these two chains. We will create an account on chain `test-0` and call it `alice`, and register an Interchain Account (that we'll call `alice_ica`) on chain `test-1` for `alice` on chain `test-0`. We will also create a standard account, `bob` on chain `test-1`.
Expand All @@ -26,15 +26,20 @@ Through these 3 accounts, we can test if:
### Prepare to run two chains
We've simplified the setup process via several shell scripts. If you'd like to learn more about what's happening under the hood we suggest you inspect the files more closely.

Set up the two chains, create the keys for `alice` and `bob`, and start running both chains in different terminals:
Set up the two chains by [`init_chain_controller.sh`](https://github.com/cosmos/gaia/blob/main/docs/modules/icamauth_scripts/init_chain_controller.sh) and [`init_chain_host.sh`](https://github.com/cosmos/gaia/blob/main/docs/modules/icamauth_scripts/init_chain_host.sh), create the keys for `alice` and `bob`, and start running both chains in different terminals:
```shell
source ./docs/modules/icamauth/init_chain_controller.sh
cd gaia

source ./docs/modules/icamauth_scripts/init_chain_controller.sh
```
and ni another temrinal:
and in another terminal:
```shell
source ./docs/modules/icamauth/init_chain_host.sh
cd gaia

source ./docs/modules/icamauth_scripts/init_chain_host.sh
```


### Setting up a Hermes relayer
You can download or build the Hermes binary from the source code.
#### Download the Hermes binary
Expand Down Expand Up @@ -65,9 +70,9 @@ export PATH="$HOME/.hermes/bin:$PATH"
```

#### Create the IBC connection
Run the following command in `gaia/docs/modules/icamauth` directory to create an IBC connection:
Run the following script [`gaia/docs/modules/icamauth_scripts/hermes_setup.sh`](https://github.com/cosmos/gaia/blob/main/docs/modules/icamauth_scripts/hermes_setup.sh) to create an IBC connection:
```shell
cd ./docs/modules/icamauth
cd ./docs/modules/icamauth_scripts
source hermes_setup.sh
```

Expand Down Expand Up @@ -168,7 +173,7 @@ gaiad tx bank send $BOB $ALICE_ICA 100stake --gas-prices 0.025stake --home $HOME
Create a new IBC channel using Hermes:

```shell
hermes --config ./docs/modules/icamauth/rly-config.toml create channel --a-chain test-0 --a-connection connection-0 --a-port transfer --b-port transfer
hermes --config ./docs/modules/icamauth_scripts/rly-config.toml create channel --a-chain test-0 --a-connection connection-0 --a-port transfer --b-port transfer
```

Initiate the IBC token transfer:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

BINARY=$(which gaiad)
# please do not reveal your mnemonic in production !!!
MNEMONIC_RLY0=`cat docs/modules/icamauth/rly0-mnemonic.txt`
MNEMONIC_RLY0=`cat docs/modules/icamauth_scripts/rly0-mnemonic.txt`
MNEMONIC_ALICE="captain six loyal advice caution cost orient large mimic spare radar excess quote orchard error biology choice shop dish master quantum dumb accident between"
CHAINID_0=test-0
HOME_0=$HOME/test-0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

BINARY=$(which gaiad)
# please do not reveal your mnemonic in production !!!
MNEMONIC_RLY1=`cat docs/modules/icamauth/rly1-mnemonic.txt`
MNEMONIC_RLY1=`cat docs/modules/icamauth_scripts/rly1-mnemonic.txt`
MNEMONIC_BOB="uphold train large action document mixed exact cherry input evil sponsor digital used child engine fire attract sing little jeans decrease despair unfair what"
CHAINID_1=test-1
HOME_1=$HOME/test-1
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 26c891b

Please # to comment.