Skip to content

Commit

Permalink
Moved relayer/cli to relayer-cli, relayer/relay to relayer (informals…
Browse files Browse the repository at this point in the history
…ystems#183)

* Moved relayer/cli to relayer-cli, relayer/relay to relayer

* Updated CHANGELOG

* Changed paths in documentation and CI
  • Loading branch information
greg-szabo committed Jul 29, 2020
1 parent 21f637f commit 50dbd1c
Show file tree
Hide file tree
Showing 47 changed files with 24 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ jobs:
TRUSTED_HEADER="$(curl -s http://localhost:26657/status)"
HASH="$(echo "${TRUSTED_HEADER}" | jq -r .result.sync_info.latest_block_hash)"
HEIGHT="$(echo "${TRUSTED_HEADER}" | jq -r .result.sync_info.latest_block_height)"
cargo run --bin relayer -- -c relayer/relay/tests/config/fixtures/relayer_conf_example.toml light init -x "${HASH}" -h "${HEIGHT}" chain_A
cargo run --bin relayer -- -c relayer/tests/config/fixtures/relayer_conf_example.toml light init -x "${HASH}" -h "${HEIGHT}" chain_A
- name: Set up chain_b
run: |
TRUSTED_HEADER="$(curl -s http://localhost:26557/status)"
HASH="$(echo "${TRUSTED_HEADER}" | jq -r .result.sync_info.latest_block_hash)"
HEIGHT="$(echo "${TRUSTED_HEADER}" | jq -r .result.sync_info.latest_block_height)"
cargo run --bin relayer -- -c relayer/relay/tests/config/fixtures/relayer_conf_example.toml light init -x "${HASH}" -h "${HEIGHT}" chain_B
cargo run --bin relayer -- -c relayer/tests/config/fixtures/relayer_conf_example.toml light init -x "${HASH}" -h "${HEIGHT}" chain_B
- name: Run relayer in the background
run: |
cargo run --bin relayer -- -c relayer/relay/tests/config/fixtures/relayer_conf_example.toml start --reset &
cargo run --bin relayer -- -c relayer/tests/config/fixtures/relayer_conf_example.toml start --reset &
sleep 3
- uses: actions-rs/cargo@v1
with:
command: run
args: --bin relayer -- -v -c relayer/relay/tests/config/fixtures/relayer_conf_example.toml query connection end chain_A testconnection
args: --bin relayer -- -v -c relayer/tests/config/fixtures/relayer_conf_example.toml query connection end chain_A testconnection
# - uses: actions-rs/cargo@v1
# with:
# command: test
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [pending_version]

* Refactored `relayer/cli` into `relayer-cli` folder. ([#180](https://github.com/informalsystems/ibc-rs/issues/180))
* Refactored `relayer/relay` into `relayer` folder. ([#180](https://github.com/informalsystems/ibc-rs/issues/180))

## [0.0.1]

*July 1st, 2020*
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

members = [
"modules",
"relayer/relay",
"relayer/cli",
"relayer",
"relayer-cli",
]
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Sample output:
> Replace `HASH` and `HEIGHT` with the appropriate values (from step 1 above) in the following command.

```bash
ibc-rs $ cargo run --bin relayer -- -c ./relayer/relay/tests/config/fixtures/relayer_conf_example.toml light init -x HASH -h HEIGHT chain_A
ibc-rs $ cargo run --bin relayer -- -c ./relayer/tests/config/fixtures/relayer_conf_example.toml light init -x HASH -h HEIGHT chain_A
```

3. Repeat step 1 and 2 above for `chain_B`.
Expand All @@ -81,20 +81,20 @@ Sample output:
4. Finally, start the main relayer thread, along with the light clients and IBC event monitor threads:

```bash
ibc-rs $ cargo run --bin relayer -- -c ./relayer/relay/tests/config/fixtures/relayer_conf_example.toml start --reset
ibc-rs $ cargo run --bin relayer -- -c ./relayer/tests/config/fixtures/relayer_conf_example.toml start --reset
```

The `--reset` flag only needs to be passed once, for initializing the trusted headers based on the hash & height stored from steps 1-3 above.

Beside the basic relayer `start` command, the following are also available:

- `listen` will start only the monitor part of the relayer, without the light client functionality;
- `query`can be used to initiate various queries against one of the chains, for example: `cargo run --bin relayer -- -v -c ./relayer/relay/tests/config/fixtures/relayer_conf_example.toml query connection end chain_A testconnection` will look up the connection with identifier `testconnection` on chain `chain_A`.
- `query`can be used to initiate various queries against one of the chains, for example: `cargo run --bin relayer -- -v -c ./relayer/tests/config/fixtures/relayer_conf_example.toml query connection end chain_A testconnection` will look up the connection with identifier `testconnection` on chain `chain_A`.
Note: Currently these commands fail in the response deserialization code and will be fixed as soon as the protobuf encoding is available for tendermint and cosmos-sdk implementations.

The `relayer/cli/src/commands.rs` file contains further description of the CLI subcommands.
The `relayer-cli/src/commands.rs` file contains further description of the CLI subcommands.

**Note:** Add a `-v` flag to the commands above to see detailed log output, eg. `cargo run --bin relayer -- -v -c ./relayer/relay/tests/config/fixtures/relayer_conf_example.toml run`
**Note:** Add a `-v` flag to the commands above to see detailed log output, eg. `cargo run --bin relayer -- -v -c ./relayer/tests/config/fixtures/relayer_conf_example.toml run`

## Contributing

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions relayer/cli/Cargo.toml → relayer-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ authors = [
]

[dependencies]
relayer = { path = "../relay" }
relayer-modules = { path = "../../modules" }
relayer = { path = "../relayer" }
relayer-modules = { path = "../modules" }
tendermint = { git = "https://github.com/informalsystems/tendermint-rs.git", branch = "master" }

abscissa_tokio = "0.5.1"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl Runnable for QueryChannelEndCmd {
status_info!("Options", "{:?}", opts);

// run without proof:
// cargo run --bin relayer -- -c relayer/relay/tests/config/fixtures/simple_config.toml query channel end ibc-test firstport firstchannel --height 3 -p false
// cargo run --bin relayer -- -c relayer/tests/config/fixtures/simple_config.toml query channel end ibc-test firstport firstchannel --height 3 -p false
let chain = CosmosSDKChain::from_config(chain_config).unwrap();
let res = chain.query::<ChannelEnd>(
ChannelEnds(opts.port_id, opts.channel_id),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ impl Runnable for QueryClientStateCmd {
status_info!("Options", "{:?}", opts);

// run with proof:
// cargo run --bin relayer -- -c relayer/relay/tests/config/fixtures/simple_config.toml query client state ibc-test ethbridge --height 3
// cargo run --bin relayer -- -c relayer/tests/config/fixtures/simple_config.toml query client state ibc-test ethbridge --height 3
//
// run without proof:
// cargo run --bin relayer -- -c relayer/relay/tests/config/fixtures/simple_config.toml query client state ibc-test ethbridge --height 3 -p false
// cargo run --bin relayer -- -c relayer/tests/config/fixtures/simple_config.toml query client state ibc-test ethbridge --height 3 -p false
//
// Note: currently both fail in amino_unmarshal_binary_length_prefixed().
// To test this start a Gaia node and configure a client using the go relayer.
Expand Down Expand Up @@ -274,7 +274,7 @@ impl QueryClientConnectionsCmd {

/// Command to handle query for client connections
/// To run without proof:
/// cargo run --bin relayer -- -c relayer/relay/tests/config/fixtures/relayer_conf_example.toml query client connections chain_A clientidone -h 4 -p false
/// cargo run --bin relayer -- -c relayer/tests/config/fixtures/relayer_conf_example.toml query client connections chain_A clientidone -h 4 -p false
impl Runnable for QueryClientConnectionsCmd {
fn run(&self) {
let config = app_config();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl Runnable for QueryConnectionEndCmd {

let chain = CosmosSDKChain::from_config(chain_config).unwrap();
// run without proof:
// cargo run --bin relayer -- -c relayer/relay/tests/config/fixtures/simple_config.toml query connection end ibc-test connectionidone --height 3 -p false
// cargo run --bin relayer -- -c relayer/tests/config/fixtures/simple_config.toml query connection end ibc-test connectionidone --height 3 -p false
let res =
chain.query::<ConnectionEnd>(Connections(opts.connection_id), opts.height, opts.proof);

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion relayer/relay/Cargo.toml → relayer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [
]

[dependencies]
relayer-modules = { path = "../../modules" }
relayer-modules = { path = "../modules" }
tendermint = { git = "https://github.com/informalsystems/tendermint-rs.git", branch = "master" }
tendermint-rpc = { git = "https://github.com/informalsystems/tendermint-rs.git", branch = "master", features=["client"] }
anomaly = "0.2.0"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 50dbd1c

Please sign in to comment.