Skip to content

Commit

Permalink
Fix guide commands (informalsystems#2585)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlianBenabdallah authored Aug 24, 2022
1 parent 5a35317 commit ccc84c0
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 47 deletions.
6 changes: 3 additions & 3 deletions guide/src/tutorials/local-chains/identifiers.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ __`connection-<n>`__ for connections
For example `connection-0` is assigned to the first connection created on `ibc-1`:

```shell
hermes tx conn-init --b-chain ibc-1 --a-chain ibc-0 --b-client 07-tendermint-0 --a-client 07-tendermint-0
hermes tx conn-init --dst-chain ibc-1 --src-chain ibc-0 --dst-client 07-tendermint-0 --src-client dummyclientname
```

```json
Expand All @@ -68,7 +68,7 @@ Success: OpenInitConnection(
),
counterparty_connection_id: None,
counterparty_client_id: ClientId(
"07-tendermint-0",
"dummyclientname",
),
},
),
Expand All @@ -83,7 +83,7 @@ We will create a second connection on `ibc-1` with identifier `connection-1` in
For example `channel-0` is assigned to the first channel created on `ibc-1`:

```shell
hermes tx chan-open-init --b-chain ibc-1 --a-chain ibc-0 --b-connection connection-0 --b-port transfer --a-port transfer
hermes tx chan-open-init --dst-chain ibc-1 --src-chain ibc-0 --dst-connection connection-0 --dst-port transfer --src-port transfer
```

```json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ Follow the steps below to connect three chains together and relay packets betwee
- Two packets from `ibc-0` to `ibc-1` from source channel `channel-0`

```shell
hermes tx ft-transfer --receiver-chain ibc-1 --sender-chain ibc-0 --sender-port transfer --sender-channel channel-0 --amount 9999 --timeout-height-offset 1000 --number-msgs 2
```
hermes tx ft-transfer --dst-chain ibc-1 --src-chain ibc-0 --src-port transfer --src-channel channel-0 --amount 9999 --timeout-seconds 1000 --number-msgs 2
```

```json
Success: [
Expand All @@ -242,7 +242,7 @@ Follow the steps below to connect three chains together and relay packets betwee
- Two packets from `ibc-1` to `ibc-2` from source channel `channel-1`

```shell
hermes tx ft-transfer --receiver-chain ibc-2 --sender-chain ibc-1 --sender-port transfer --sender-channel channel-1 --amount 9999 --timeout-height-offset 1000 --number-msgs 2
hermes tx ft-transfer --dst-chain ibc-2 --src-chain ibc-1 --src-port transfer --src-channel channel-1 --amount 9999 --timeout-seconds 1000 --number-msgs 2
```

```json
Expand Down
139 changes: 98 additions & 41 deletions guide/src/tutorials/local-chains/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,50 @@ If this is not the first time you are running the script, you can manually stop
killall gaiad
```

> __NOTE__: If you have any `Docker` containers running that might be using the same ports as `gaiad` (e.g. port 26657 or port 9090), please ensure you stop them first before proceeding to the next step.
> __NOTE__: If you have any `Docker` containers running that might be using the same ports as `gaiad` (e.g. port 27010-27012), please ensure you stop them first before proceeding to the next step.
Make sure that `$HOME/.gm` does not contain any `ibc-*` or `node-*` file. Otherwise, remove them manually with `gm rm` or simply :

```shell
rm -r $HOME/.gm/node-*
rm -r $HOME/.gm/ibc-*
```

### Start the chains with `gm`

Make sure you have the `$HOME/.gm/gm.toml` that we configured in the previous section [Install Gaiad Manager](gaiad-manager.md) and run the `gm` command below to start the chains.

```shell
gm start
```

This configures and starts two __`gaiad`__ instances, one named __`ibc-0`__ and the other __`ibc-1`__

```mermaid
graph TD
A[gm] -->|start| C(start chains)
C -->|gaiad| D[ibc-0]
C -->|gaiad| E[ibc-1]
```

If the command runs successfully you should see a message similar to the one below in the terminal:

```shell
Creating network1 config...
network1 started, PID: 99468, LOG: $HOME/.gm/network1/log
Creating network2 config...
network2 started, PID: 99538, LOG: $HOME/.gm/network2/log
Creating ibc-0 config...
ibc-0 started, PID: 99645, LOG: $HOME/.gm/ibc-0/log
Creating ibc-1 config...
ibc-1 started, PID: 99750, LOG: $HOME/.gm/ibc-1/log
```
Run the below command to check the status of the chains

```bash
gm status
```


### Configuration file

Expand Down Expand Up @@ -93,18 +136,60 @@ trust_threshold = { numerator = '1', denominator = '3' }
To see the keys generated by `gm`, run the command below

```bash
gm key
gm keys
```

This will generate an output similar to the one below (albeit all on the same line):
```json
{
"name": "testkey",
"type": "local",
"address": "cosmos1tc3vcuxyyac0dmayf887t95tdg7qpyql48w7gj",
"pubkey": "cosmospub1addwnpepqgg7ng4ycm60pdxfzdfh4hjvkwcr3da59mr8k883vsstx60ruv7kur4525u",
"mnemonic": "[24 words mnemonic]"
}
```
"$HOME/go/bin/gaiad" keys list --keyring-backend test --keyring-dir "$HOME/.gm/ibc-0"
- name: validator
address: cosmos1a5545h09sdzwgjpraasgkvu0f585lc33k9h4kx
pubkey: cosmospub1addwnpepqw5j24lg0ya34umnrn7akxuks3as2ktggndxg37cnfsx2fl5xkl8ymte6c2
mnemonic: "confirm path season shiver adjust order quarter now empower crystal busy foam pony web chaos bachelor magnet imitate audit wear spike chunk garlic sport"
- name: wallet
address: cosmos14czpvfgzcr06astyylahshcexzwm0j9ne6h5p5
pubkey: cosmospub1addwnpepqdcmngqappsxp6jp53atfx6kt5p7d6vce4un3mfvsa8gtml5n8lj2yh29q9
mnemonic: "brass exhibit artist beef album canvas liar fine water wave bus rose sunny permit strategy eight stove legal sustain vessel offer great book loan"
- name: wallet1
address: cosmos1qs5nmmf7jall4sm38fjssxfw5ay87mfp22p3xm
pubkey: cosmospub1addwnpepqtxfgjxg8xrc9xrzqyfs3ud6svmu7wrt608s80d0t0g93rylu4kd7kpckj6
mnemonic: "puzzle pole beyond announce clip else cause airport index pencil intact camp leisure pole nasty put meat cover garage ripple chief unfair destroy spatial"
- name: wallet2
address: cosmos1n7qyhjkfp8szpy7ury7vlejd5wcfc2ysdd9xlx
pubkey: cosmospub1addwnpepq2nuh2a9x9wd6ad78dcft3e8tuds5xs4ypeterl0zenw9ejt0tdvk38yd3z
mnemonic: "february slab crane panther harbor judge artefact ghost clay torch stay cave enrich narrow sausage expand tomato margin wool repeat squeeze couch fork unhappy"
"$HOME/go/bin/gaiad" keys list --keyring-backend test --keyring-dir "$HOME/.gm/ibc-1"
- name: validator
address: cosmos14eg9y3kjlrepk8lmdavw8u5l472sl8e6xv99yk
pubkey: cosmospub1addwnpepq0q4f0aaaq2wycg7y3x8j8gfacazdf3xlxujkjguy2k3gq654jwuyn58hhq
mnemonic: "clarify concert lens mobile hover lucky bulk home elite fix school jungle draw soul excess siren advice accuse shallow copper model absorb salon mystery"
- name: wallet
address: cosmos120jm7xkv49erxty6ec9trs85j8yfgjwwdlsrtz
pubkey: cosmospub1addwnpepqgs0llcm64e7yrpx7hs9fmzqefnwxzfxnujf3qgysdpv8w5aalu2z2e86gs
mnemonic: "shine again similar wheel also frozen equal win ask grit artist quality subject twenty pet scrub olympic ladder puppy balcony blood exotic buddy gather"
- name: wallet1
address: cosmos18ccme8td0zdktcy7dafhurdhx7x8xxx0s445y2
pubkey: cosmospub1addwnpepq045d9qjrkvfxdx39849qdcrny0zr8z2elx6z7kjkgezrvw2enepx98pyxf
mnemonic: "join skill day disease canal alpha sweet sing icon donor relief little wheat borrow silver allow child silent teach then flower deliver arena library"
- name: wallet2
address: cosmos1x45ucdaa3fegemh3x2xp0qtnxl2gv533e2fg6g
pubkey: cosmospub1addwnpepq0ryrcm08l8x5wskhd5dczrduj535fxs9w7wky04ux97amljcffe6ewxymg
mnemonic: "wish burden unfair subway club pulp wood helmet whip decline between maid defense sniff cash guard cargo travel donor nasty saddle tumble service fringe"
"$HOME/go/bin/gaiad" keys list --keyring-backend test --keyring-dir "$HOME/.gm/node-0"
[]
"$HOME/go/bin/gaiad" keys list --keyring-backend test --keyring-dir "$HOME/.gm/node-1"
[]
```

Next, we will need to associate a private key with chains `ibc-0` and `ibc-1` which `hermes` will use to sign transactions.
Expand All @@ -116,39 +201,11 @@ gm hermes keys
If successful, the command should show an output similar to:

```
Success: Added key testkey ([ADDRESS]) on [CHAIN ID] chain
```

### Starting the chains with `gm`

Make sure you have the `$HOME/.gm/gm.toml` that we configured in the previous section [Install Gaiad Manager](gaiad-manager.md) and run the `gm` command below to start the chains.

```bash
gm start
```

This configures and starts two __`gaiad`__ instances, one named __`ibc-0`__ and the other __`ibc-1`__

```mermaid
graph TD
A[gm] -->|start| C(start chains)
C -->|gaiad| D[ibc-0]
C -->|gaiad| F[ibc-1]
```

If the command runs successfully you should see a message similar to the one below in the terminal:

```shell
network1 started, PID: 99468, LOG: /Users/testuser/.gm/network1/log
network2 started, PID: 99538, LOG: /Users/testuser/.gm/network2/log
ibc-0 started, PID: 99645, LOG: /Users/testuser/.gm/ibc-0/log
ibc-1 started, PID: 99750, LOG: /Users/testuser/.gm/ibc-1/log
SUCCESS: Added key testkey ([ADDRESS]) on [CHAIN ID] chain
```
Run the below command to check the status of the chains

```bash
gm status
```
> __TROUBLESHOOTING__:
> - If the command does not out output anything, make sure the path to Hermes' binary is set in `$HOME/.gm/gm.toml`.
### $HOME/.gm directory

Expand Down

0 comments on commit ccc84c0

Please sign in to comment.