Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/clean-beds-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@confio/relayer': patch
---

Update relayer demo to use oysternet and nyancat
41 changes: 27 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,31 +61,41 @@ Reads the configuration and starts relaying packets.
1. Init the configuration

```sh
ibc-setup init --src relayer_test_1 --dest relayer_test_2
ibc-setup init --src oysternet --dest nyancat
```

- creates relayer's home directory at `~/.ibc-setup`
- creates `app.yaml` inside relayer's home with `src`, `dest` and newly generated `mnemonic`
- pulls default `registry.yaml` to relayer's home
- funds addresses on both sides so relayer can pay the fee while relaying packets
- funds addresses on `oysternet` so relayer can pay the fee while relaying packets

> **NOTE:** Test blockchains `relayer_test_1` and `relayer_test_2` are running in the public. You do not need to start any blockchain locally to complete the quick start guide.
> **NOTE:** Both testnets are running in the public. You do not need to start any blockchain locally to complete the quick start guide.

> **NOTE:** Run `ibc-setup balances` to see the amount of tokens on each address.

2. Create `ics20` channel
2. Get testnet tokens for `nyancat`

- Find your relayer address on nyancat via: `ibc-setup keys list | grep nyancat`
- Join IrisNet discord with [this invite link](https://discord.gg/X6dZZxs3#nyncat-faucet)
- Go to the `nyancat-faucet` channel
- Request tokens at this address in the above channel: `$faucet iaa1fxmqew9dgg44jdf3l34zwa8rx7tcf42wz8ehjk`
- Check you have tokens on oysternet and nyancat via `ibc-setup balances`

[Original Instructions from IrisNet](https://github.com/irisnet/testnets/tree/master/nyancat#faucet)

3. Create `ics20` channel

```sh
ibc-setup ics20
ibc-setup ics20 -v
```

- creates a new connection on source and desination chains
- saves connection ids to `app.yaml` file
- creates a new channel

3. Start the relayer in the verbose mode and 10s frequency polling
4. Start the relayer in the verbose mode and 10s frequency polling
```sh
ibc-relayer start -v --poll 10
ibc-relayer start -v --poll 15
```

### Send tokens between chains
Expand All @@ -106,23 +116,26 @@ Reads the configuration and starts relaying packets.

```sh
wasmd keys add sender
JSON=$(jq -n --arg addr $(wasmd keys show -a sender) '{"denom":"umuon","address":$addr}')
curl -X POST --header "Content-Type: application/json" --data "$JSON" http://49.12.73.189:8001/credit
JSON=$(jq -n --arg addr $(wasmd keys show -a sender) '{"denom":"usponge","address":$addr}')
curl -X POST --header "Content-Type: application/json" --data "$JSON" https://faucet.oysternet.cosmwasm.com/credit
```

3. Create another account to send tokens to
3. Create a valid IrisNet address to send tokens to

```sh
wasmd keys add receiver
RCPT=$(ibc-setup keys list | grep nyancat | cut -d' ' -f2)
```

TODO: setup irisnet binary and make real account there

4. Send tokens
```sh
wasmd tx ibc-transfer transfer transfer <channel-id> $(wasmd keys show -a receiver) 200umuon --from $(wasmd keys show -a sender) --node http://168.119.254.205:26657 --chain-id network-1 --fees 2000umuon
wasmd tx ibc-transfer transfer transfer <channel-id> "$RCPT" 200usponge --from $(wasmd keys show -a sender) --node http://rpc.oysternet.cosmwasm.com:80 --chain-id oysternet-1 --fees 2000usponge --packet-timeout-height 0-0
```
- replace `<channel-id>` with the channel id obtained while configuring the relayer (2nd point)
- if you cleared out the terminal, query the channel
```sh
# replace `connection-id` with value of `srcConnection` property from `~/.ibc-setup/app.yaml` file
ibc-setup channels --chain relayer_test_1 --connection <connection-id>
ibc-setup channels --chain oysternet
```
5. Observe the relayer output

Expand Down
37 changes: 14 additions & 23 deletions demo/registry.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
version: 1

chains:
musselnet:
chain_id: musselnet-4
oysternet:
chain_id: oysternet-1
# Bech32 prefix for addresses
prefix: wasm
# This determines the gas payments we make (and defines the fee token)
gas_price: 0.025umayo
gas_price: 0.025usponge
# The path we use to derive the private key from the mnemonic
# Note: The hd paths shown have no meaningful relationship to the existing chains.
# It is recommended practice to use a different hd_path than those commonly used for user accounts.
hd_path: m/44'/1234'/0'/1'
# If you include an optional faucet, it will load the relayer with tokens in `ibc-setup init`
faucet: https://faucet.musselnet.cosmwasm.com
faucet: https://faucet.oysternet.cosmwasm.com
# You can optionally define a default ics20_port that will be used instead of transfer if no flags set
ics20_port: 'transfer'
# You can include multiple RPC endpoints and it will rotate through them if
# one is down (TODO)
rpc:
- https://rpc.musselnet.cosmwasm.com
- http://rpc.oysternet.cosmwasm.com:80
local_wasm:
chain_id: testing
prefix: wasm
Expand All @@ -34,24 +34,6 @@ chains:
ics20_port: 'custom'
rpc:
- http://localhost:26658
relayer_test_1:
chain_id: network-1
prefix: wasm
gas_price: 0.01umuon
hd_path: m/44'/1234'/0'/4'
ics20_port: 'transfer'
faucet: http://49.12.73.189:8001
rpc:
- http://168.119.254.205:26657
relayer_test_2:
chain_id: network-2
prefix: wasm
gas_price: 0.01umuon
hd_path: m/44'/1234'/0'/5'
ics20_port: 'transfer'
faucet: http://49.12.73.189:8002
rpc:
- http://188.34.162.78:26657
cosmoshub-4:
chain_id: cosmoshub-4
prefix: cosmos
Expand All @@ -63,3 +45,12 @@ chains:
ics20_port: 'transfer'
rpc:
- https://rpc.cosmos.network:443
nyancat:
# This is a long-living testnet by IrisNet
chain_id: nyancat-8
prefix: iaa
gas_price: 0.2unyan
hd_path: m/44'/118'/0'/0/0
ics20_port: 'transfer'
rpc:
- http://34.80.202.172:26657/