Skip to content

Commit

Permalink
Adding more content, fixing content mostly in local chains file (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
andynog committed Jan 31, 2021
1 parent f53d0d9 commit a0a79ff
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 32 deletions.
2 changes: 1 addition & 1 deletion guide/src/commands.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Commands

The `Commands` section presents the commands current available in the IBC Relayer
The `Commands` section presents the commands current available in Hermes

## Sections

Expand Down
4 changes: 2 additions & 2 deletions guide/src/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Every command executed through the relayer requires the configuration file local

```bash
relayer -c config.toml [COMMAND]
hermes -c config.toml [COMMAND]
```

## Sections
Expand Down Expand Up @@ -86,7 +86,7 @@ The configuration file also store information about the light client peers, but
If you want to validate the configuration file you can run the relayer command below:

```shell
relayer -c config.toml config validate
hermes -c config.toml config validate
```

If the configuration file is valid the command above will show this message:
Expand Down
8 changes: 6 additions & 2 deletions guide/src/faq.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Frequently Asked Questions

Here are some of the most frequently asked questions concerning the IBC relayer.
Here are some of the most frequently asked questions concerning Hermes operating and functionality

#### Can I connect more than two chains using Hermes ?

[ANSWER]


> [TODO]
4 changes: 2 additions & 2 deletions guide/src/getting_started.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Getting Started

In order to run the relayer, please ensure you have all the [pre-requisites](./pre_requisites.md) installed on your machine.
In order to run Hermes, please ensure you have all the [pre-requisites](./pre_requisites.md) installed on your machine.

Once you have all the pre-requisites installed on your machine, you can [build and run the relayer](./setup.md) in your machine.
Once you have all the pre-requisites installed on your machine, you can [build and run Hermes](./setup.md) in your machine.

> The instructions on this guide have been tested on `Linux` and `MacOS` environments. Most of the commands should work on both environments. Even though you can build and run the relayer on `Windows` (since we develop it in Rust and it supports cross platform compilation) we have not tested the relayer on `Windows` and we do not support this environment at this time.
16 changes: 8 additions & 8 deletions guide/src/index.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# IBC Relayer Guide

This guide can be used to help you setup, configure and operate the IBC Relayer to transfer packets between two IBC enabled chains.
This guide can be used to help you setup, configure and operate Hermes to transfer packets between two IBC enabled chains.

## Sections
---
**[Introduction](./relayer.md)**

- The introduction gives a brief overview about the IBC Relayer
- The introduction gives a brief overview about Hermes

**[Getting Started](./getting_started.md)**

- The getting started section can help you setup, configure and run the IBC Relayer
- The getting started section can help you setup, configure and run Hermes

**[Tutorials](./tutorials.md)**

- This section provides some tutorials on how to operate and test the relayer
- This section provides some tutorials on how to operate and test Hermes

**[Commands Reference](./commands.md)**

- The commands will let you interact with the IBC Relayer using its command-line interface.
- The commands will let you interact with Hermes using its command-line interface.

**[Troubleshooting](./troubleshoot.md)**

- This section has the most frequently asked questions related to the IBC Relayer.
- This section provides some troubleshooting tips to help you solve the issues when running Hermes

**[Frequently Asked Questions](./faq.md)**

- This section provides some troubleshooting tips to help you solve the issues when running the IBC Relayer
- This section has the most frequently asked questions related to Hermes operation and functionality

**[Glossary](./glossary.md)**

Expand All @@ -35,7 +35,7 @@ This guide can be used to help you setup, configure and operate the IBC Relayer
---

**Other References and Useful Links:**
* [Relayer Github repository](https://github.com/informalsystems/ibc-rs) — The official Github repository for the IBC Relayer
* [Relayer Github repository](https://github.com/informalsystems/ibc-rs) — The official Github repository for Hermes ()
* [IBC Github repository](https://github.com/cosmos/ics) - The official repository for the Inter-blockchain protocol (IBC)

## Disclaimer
Expand Down
53 changes: 36 additions & 17 deletions guide/src/local_chains.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
### Start the local chains
# Start the local chains

To run the script to start the local chains, open a terminal and navigate to the `ibc-rs` repository folder

```bash
cd ibc-rs
```

#### Configuration
#### Stop and cleanup

If this is not the first time you are running the script, you can manually stop the two gaia instances and clean up the data executing the following commands:

Kill all `gaiad` processes:

```shell
killall gaiad
```

Remove the `data` directory (if present)
```shell
rm -rf data/
```

> __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.
### Configuration file

In order to run the script, you will need a `TOML` configuration file to be passed as a parameter. Please check the [`Configuration`](./config.md) section for more information about the relayer configuration file.

The following configuration file can be used for running the local chains:
The following configuration file in the `scripts` folder can be used for running the local chains:

##### loop_config.toml
#### loop_config.toml
```toml
[global]
timeout = '10s'
Expand Down Expand Up @@ -52,23 +69,22 @@ numerator = '1'
denominator = '3'
```

#### Stop and cleanup
### Running the script to start the chains

If this is not the first time you are running the script, you can manually stop the two gaia instances and clean up the data executing the following commands:
If you are currently in the `ibc-rs` repository folder, please change to the `scripts` folder:

```shell
killall gaiad
rm -rf data/
cd scripts
```

#### Run the script

Run the following script with the parameters below to start the chains:
Then run the following script with the parameters below to start the chains (`ibc-0` and `ibc-1`):

```bash
./dev-env loop_config.toml ibc-0 ibc-1
```

> __NOTE__: If the script above prompts you to delete the data folder just say `yes`
The script will configure and start two `gaiad` instances, one named `ibc-0` and the other `ibc-1`

```mermaid
Expand All @@ -82,9 +98,10 @@ graph TD
If the script runs successfully you should see a message similar to the one below in the terminal:

```shell
$ ./dev-env ./relayer-cli/tests/fixtures/two_chains.toml ibc-0 ibc-1
$ ./dev-env loop_chains.toml ibc-0 ibc-1

GAIA VERSION INFO: 4.0.0

GAIA VERSION INFO: 3.0.0
Generating gaia configurations...
Creating gaiad instance: home=./data | chain-id=ibc-0 | p2p=:26656 | rpc=:26657 | profiling=:6060 | grpc=:9090 | samoleans=:100000000000
Change settings in config.toml file...
Expand Down Expand Up @@ -118,16 +135,18 @@ balances:
pagination:
next_key: null
total: "0"
ibc-0 initialized. Watch file /home/user/development/github.com/informalsystems/ibc-rs/data/ibc-0.log to see its execution.
ibc-1 initialized. Watch file /home/user/development/github.com/informalsystems/ibc-rs/data/ibc-1.log to see its execution.
ibc-0 initialized. Watch file /home/andy/development/github.com/informalsystems/ibc-rs/scripts/data/ibc-0.log to see its execution.
ibc-1 initialized. Watch file /home/andy/development/github.com/informalsystems/ibc-rs/scripts/data/ibc-1.log to see its execution.
Building the Rust relayer...
Removing light client peers from configuration...
Adding primary peers to light client configuration...
Adding secondary peers to light client configuration...
Importing keys...
Done!

```

#### Data directory
### Data directory
The script creates a `data` directory in the current directory in order. The `data` directory contains the chain stores and configuration files.

The `data` directory has a tree structure similar to the one below:
Expand All @@ -153,4 +172,4 @@ data

#### Next Steps

In the next section [Relaying packets](./relay_packets.md) you will learn how to execute transactions and queries on the relayer in order to relay packets.
In the next section ["Relaying packets"](./relay_packets.md) you will learn how to execute transactions and queries on the relayer in order to relay packets.
86 changes: 86 additions & 0 deletions scripts/loop_config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
[global]
timeout = '10s'
strategy = 'naive'
log_level = 'error'

[[chains]]
id = 'ibc-0'
rpc_addr = 'tcp://localhost:26657'
grpc_addr = 'tcp://localhost:9090'
account_prefix = 'cosmos'
key_name = 'testkey'
store_prefix = 'ibc'
gas = 200000
max_msg_num = 4
max_tx_size = 1048576
clock_drift = '5s'
trusting_period = '14days'

[chains.trust_threshold]
numerator = '1'
denominator = '3'

[chains.peers]
primary = 'C1A9FC620F819B2DAE2A6BBE59360220EF2150A1'

[[chains.peers.light_clients]]
peer_id = 'C1A9FC620F819B2DAE2A6BBE59360220EF2150A1'
address = 'tcp://localhost:26657'
timeout = '10s'
trusted_header_hash = 'C5645F22EFBD5E86F4AAD69A5739B9A1F4A695E2140ADDF5C66DBC25322306C0'
trusted_height = '15'

[chains.peers.light_clients.store]
type = 'disk'
path = '/home/andy/development/github.com/informalsystems/ibc-rs/scripts/data/ibc-0/data/C1A9FC620F819B2DAE2A6BBE59360220EF2150A1'

[[chains.peers.light_clients]]
peer_id = '2427F8D914A6862279B3326FA64F76E3BC06DB2E'
address = 'tcp://localhost:26657'
timeout = '10s'
trusted_header_hash = 'C5645F22EFBD5E86F4AAD69A5739B9A1F4A695E2140ADDF5C66DBC25322306C0'
trusted_height = '15'

[chains.peers.light_clients.store]
type = 'disk'
path = '/home/andy/development/github.com/informalsystems/ibc-rs/scripts/data/ibc-0/data/2427F8D914A6862279B3326FA64F76E3BC06DB2E'

[[chains]]
id = 'ibc-1'
rpc_addr = 'tcp://localhost:26557'
grpc_addr = 'tcp://localhost:9091'
account_prefix = 'cosmos'
key_name = 'testkey'
store_prefix = 'ibc'
clock_drift = '5s'
trusting_period = '14days'

[chains.trust_threshold]
numerator = '1'
denominator = '3'

[chains.peers]
primary = '5F54ADAAC7883F92DC133BAC1A8793C19944874B'

[[chains.peers.light_clients]]
peer_id = '5F54ADAAC7883F92DC133BAC1A8793C19944874B'
address = 'tcp://localhost:26557'
timeout = '10s'
trusted_header_hash = '74400E4CDE2B6D86CDD969429C4774C2BE81C6B1D979514D50F44E36F2B7EA40'
trusted_height = '4'

[chains.peers.light_clients.store]
type = 'disk'
path = '/home/andy/development/github.com/informalsystems/ibc-rs/scripts/data/ibc-1/data/5F54ADAAC7883F92DC133BAC1A8793C19944874B'

[[chains.peers.light_clients]]
peer_id = 'A885BB3D3DFF6101188B462466AE926E7A6CD51E'
address = 'tcp://localhost:26557'
timeout = '10s'
trusted_header_hash = '74400E4CDE2B6D86CDD969429C4774C2BE81C6B1D979514D50F44E36F2B7EA40'
trusted_height = '4'

[chains.peers.light_clients.store]
type = 'disk'
path = '/home/andy/development/github.com/informalsystems/ibc-rs/scripts/data/ibc-1/data/A885BB3D3DFF6101188B462466AE926E7A6CD51E'

0 comments on commit a0a79ff

Please sign in to comment.