-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more content mostly in the configuration section (#542)
- Loading branch information
Showing
4 changed files
with
212 additions
and
5 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
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 |
---|---|---|
@@ -1 +1,174 @@ | ||
# Configuration | ||
|
||
In order to run the relayer, you will need to have a configuration file. | ||
|
||
Currently the relayer does not store the configuration information in the local disk. Every command executed through the relayer requires the configuration file localtion to be passed as a parameter. | ||
|
||
The relayer currently also does not support adding the sections below programmatically. You will need to use a text editor to create the file and add content to it. | ||
|
||
The format supported for the configuration file is [TOML](https://toml.io/en/) | ||
|
||
```bash | ||
relayer -c config.toml | ||
``` | ||
## Sections | ||
|
||
Each configuration file should have one `global` and two `chains` sections (one for each chain). | ||
|
||
### [global] | ||
|
||
The global section has parameters that apply globally concerning the relayer operation. | ||
|
||
#### Parameters | ||
|
||
* __timeout__: Specify the maximum amount of time (duration) that the operations should take before timing out. Default value is `10s` (10 seconds) | ||
|
||
* __strategy__: Specify the strategy to be used by the relayer. Currently only `naive` is supported | ||
|
||
* __log_level__: Specify the verbosity for the relayer logging output. Valid options are 'error', 'warn', 'info', 'debug', 'trace'. Default value is `info`. | ||
|
||
Here's an example for the `global` section: | ||
|
||
```toml | ||
[global] | ||
timeout = '10s' | ||
strategy = 'naive' | ||
log_level = 'info' | ||
``` | ||
|
||
### [[chains]] | ||
|
||
A `chains` section has parameters related to a chain that the relayer can send transactions and execute queries. It also has parameters related to the light client configuration peers for the chain. | ||
|
||
#### Parameters | ||
|
||
* __id__: Specify the chain ID. For example `ibc-0` | ||
|
||
* __rpc_addr__: Specify the RPC address and port where the chain RPC server listens on. For example `tcp://localhost:26657` | ||
|
||
* __grpc_addr__: Specify the GRPC address and port where the chain GRPC server listens on. For example `tcp://localhost:9090` | ||
|
||
* __account_prefix__: Specify the prefix used by the chain. For example `cosmos` | ||
|
||
* __key_name__: Specify the name of the private key JSON file. This is the filename for the private key used to sign transactions on this chain. Don't specify the file extension, for example if the filename for the private key is `testkey.json`, specify only `testkey` for this parameter. | ||
|
||
* __store_prefix__: Specify the prefix that will be used by the chain store. For example `ibc`. | ||
|
||
* __gas__: Specify the maximum amount of gas to be used as the gas limit for a transaction. Default value is `300000` | ||
|
||
* __clock_drift__: Specify the maximum amount of time to tolerate a clock drift. The clock drift parameter defines how much new (untrusted) header's Time can drift into the future. Default value is `5s` | ||
|
||
* __trusting_period__: Specify the amount of time to be used as the trusting period. It should be significantly less than the unbonding period (e.g. unbonding period = 3 weeks, trusting period = 2 weeks). Default value is `14days` (336 hours) | ||
|
||
For example if you want to add a configuration for a chain named `ibc-0`: | ||
|
||
```toml | ||
[[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 | ||
clock_drift = '5s' | ||
trusting_period = '14days' | ||
``` | ||
|
||
### Light clients | ||
|
||
The configuration file also store information about the light client peers, but this configuration is automatically added by the relayer to the configuration file when running the [`relayer light add`](./light_clients.md) command | ||
|
||
|
||
### Example configuration file | ||
|
||
Here is an full example of a configuration file with two [local chains](./local_chains.md) configured and light client peers added: | ||
|
||
```toml | ||
[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 | ||
clock_drift = '5s' | ||
trusting_period = '14days' | ||
|
||
[chains.trust_threshold] | ||
numerator = '1' | ||
denominator = '3' | ||
|
||
[chains.peers] | ||
primary = '66E3B7083DF9DD1FC57A611929BF4C505E34AA88' | ||
|
||
[[chains.peers.light_clients]] | ||
peer_id = '66E3B7083DF9DD1FC57A611929BF4C505E34AA88' | ||
address = 'tcp://localhost:26657' | ||
timeout = '10s' | ||
trusted_header_hash = 'A24F654188BC3FC9EFE589FB33D513CE9AC86BFA48B063BDBF1D769750713E09' | ||
trusted_height = '15' | ||
|
||
[chains.peers.light_clients.store] | ||
type = 'disk' | ||
path = '/home/andy/development/github.com/informalsystems/ibc-rs/data/ibc-0/data/66E3B7083DF9DD1FC57A611929BF4C505E34AA88' | ||
|
||
[[chains.peers.light_clients]] | ||
peer_id = '2427F8D914A6862279B3326FA64F76E3BC06DB2E' | ||
address = 'tcp://localhost:26657' | ||
timeout = '10s' | ||
trusted_header_hash = '44E7C90BFA53256AD72B84286BFDA70FE87BBC7C0D80A1DB199C72A4FBE88FB6' | ||
trusted_height = '16' | ||
|
||
[chains.peers.light_clients.store] | ||
type = 'disk' | ||
path = '/home/andy/development/github.com/informalsystems/ibc-rs/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' | ||
gas = 200000 | ||
clock_drift = '5s' | ||
trusting_period = '14days' | ||
|
||
[chains.trust_threshold] | ||
numerator = '1' | ||
denominator = '3' | ||
|
||
[chains.peers] | ||
primary = '28ED8856CBACA85DA866AB99F50DB22A58DA35F4' | ||
|
||
[[chains.peers.light_clients]] | ||
peer_id = '28ED8856CBACA85DA866AB99F50DB22A58DA35F4' | ||
address = 'tcp://localhost:26557' | ||
timeout = '10s' | ||
trusted_header_hash = '66BD0E5ED1FA2022A036782F7D8444DB98DC0326B379BCA6BA75864295D1C910' | ||
trusted_height = '4' | ||
|
||
[chains.peers.light_clients.store] | ||
type = 'disk' | ||
path = '/home/andy/development/github.com/informalsystems/ibc-rs/data/ibc-1/data/28ED8856CBACA85DA866AB99F50DB22A58DA35F4' | ||
|
||
[[chains.peers.light_clients]] | ||
peer_id = 'A885BB3D3DFF6101188B462466AE926E7A6CD51E' | ||
address = 'tcp://localhost:26557' | ||
timeout = '10s' | ||
trusted_header_hash = '0325BFAA36407D1F11966AEC57D34131CB27B370D3698F284F09152ADE3423C4' | ||
trusted_height = '5' | ||
|
||
[chains.peers.light_clients.store] | ||
type = 'disk' | ||
path = '/home/andy/development/github.com/informalsystems/ibc-rs/data/ibc-1/data/A885BB3D3DFF6101188B462466AE926E7A6CD51E' | ||
``` | ||
|
||
## |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
# Light Clients |
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