Skip to content

Commit

Permalink
chore: added sample config file to run in devnet with configured conn…
Browse files Browse the repository at this point in the history
…ection
  • Loading branch information
bcsainju committed Apr 5, 2024
1 parent 1d8c73c commit cf75be8
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 46 deletions.
38 changes: 26 additions & 12 deletions docs/e2e-integration-test-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ To run the demo, the following software needs to be installed.
$ git clone https://github.com/icon-project/ibc-relay/
$ cd ibc-relay/
$ docker build -t relayer .
$ cd ..
```

2. Build the builder image for bundling contracts:
2. Build the builder image in IBC-Integration repo for bundling contracts:

```bash
make build-builder-img
Expand Down Expand Up @@ -44,7 +45,8 @@ To run the demo, the following software needs to be installed.
```bash
git clone https://github.com/icon-project/goloop.git
cd goloop
make gochain-icon-image
make gochain-icon-image
cd ..
```

* Build a `goloop` image
Expand All @@ -53,6 +55,7 @@ To run the demo, the following software needs to be installed.
git clone https://github.com/icon-project/goloop/
cd goloop/
make goloop-icon-image
cd ..
```

* Build an `archway` or `neutron` image
Expand All @@ -63,6 +66,7 @@ To run the demo, the following software needs to be installed.
git clone https://github.com/archway-network/archway/
cd archway
docker build -f Dockerfile.deprecated -t archway . --build-arg arch=aarch64
cd ..
```

**For Neutron:**
Expand All @@ -71,6 +75,7 @@ To run the demo, the following software needs to be installed.
git clone https://github.com/neutron-org/neutron.git
cd neutron
make build-docker-image
cd ..
```

ℹ️ Change the image name and version of Archway/Neutron in `e2e-config.yaml` or `e2e-config-neutron.yaml`.
Expand All @@ -83,14 +88,14 @@ To conduct tests for IBC integration system, carefully adhere to the provided in

Prior to initiating the tests, ensure proper configuration of essential environment variables, which play a pivotal role in the testing process:

- **`E2E_CONFIG_PATH`**: Set this variable to the absolute path of your chosen configuration file. For Archway, utilize `sample-config-archway.yaml`, and for Neutron, employ `sample-config-neutron.yaml`.
- **`TEST_CONFIG_PATH`**: Set this variable to the absolute path of your chosen configuration file. For Archway, utilize `sample-config-archway.yaml`, and for Neutron, employ `sample-config-neutron.yaml`.
- **`GOLOOP_IMAGE_ENV`**: Indicate the name of the Goloop image.
- **`GOLOOP_IMAGE_TAG_ENV`**: Specify the version of the Goloop image.

Here's an example of environment variable configuration:

```bash
export E2E_CONFIG_PATH=/home/User/IBC-integration/sample-config-archway.yaml
export TEST_CONFIG_PATH=/home/User/IBC-integration/sample-config-archway.yaml
export GOLOOP_IMAGE_ENV=goloop-icon
export GOLOOP_IMAGE_TAG_ENV=latest
```
Expand Down Expand Up @@ -122,17 +127,26 @@ Depending on your specific testing requirements, employ the appropriate commands
go test -v ./test/e2e -timeout 0
```

- To execute the end-to-end hopchain tests:
```bash
export TEST_CONFIG_PATH=/Users/bcs/Documents/bchain/IBC-integration/test/testsuite/sample-config-ics20.yaml; go test -v ./test/e2e-hopchain -timeout 0
```
ℹ️ The hopchain tests expects remote chain deployments with respective keys for each chain in the expected folders and synced with remote chains.
- To run the integration tests:
```bash
go test -v ./test/integration -timeout 0
```

#### 3. Set Up the Demo Test Environment (Optional)
#### 5. Set Up the Hpchain Test Environment (Optional)
- To execute the end-to-end hopchain tests:
```bash
export TEST_CONFIG_PATH=/home/User/IBC-integration/test/testsuite/sample-config-ics20.yaml;
make e2e-hopchain
```
ℹ️ The hopchain tests expects remote chain deployments with respective keys for each chain in the expected folders and synced with remote chains. To use existing relay config, the config should be placed at /home/User/IBC-integration/test/relayer/data/config/config.yaml and the parameters **ics20_app** should be populated with ics20_app deployed address and the flag **use_existing_config** should be true. To create new connection and channels, the param should be set to false and ics20_app value should be empty. The test case assumes following temporary address for reception.
- centauriReceiver = "centauri16tv5rylr402xcu4yqvtk945q6mtzatf0p5hnet"
- archwayReceiver = "archway1t2tljzac36aapdmlxr9688s7qez8ctft8ehwsm"
- iconReceiver = "hxac1f0b75d2c05692fdea027fdd0d8475650c72d6"

Necessary configured keys should exist at appropriate location for chain/relayer at /home/User/IBC-integration/test/chains/{chain_name}/data and test/relayer/data/keys/{chain_id}


#### 5. Set Up the Demo Test Environment (Optional)

If necessary, establish the e2e demo test environment by executing the following command:

Expand All @@ -142,10 +156,10 @@ make e2e-demo-setup

During the setup process, distinct configuration files are generated in the `test/e2e-demo/ibc-config` directory. These files include contract addresses, along with wallets containing mnemonic/private keys. These keys are essential for conducting subsequent tests.

#### 4. Clean Up the Demo Test Environment (Optional)
#### 6. Clean Up the Demo Test Environment (Optional)

Upon completion of the testing process, if you've set up the e2e demo environment, you can execute the following command to perform a cleanup:

```bash
make e2e-demo-clean
```
```
2 changes: 1 addition & 1 deletion test/e2e-hopchain/hopchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ type Paths struct {

func (h *HopchainTestSuite) TestICS20(relayer ibc.Relayer) {
testcase := "ics20"
time.Sleep(5 * time.Second)
time.Sleep(15 * time.Second)
ctx := context.WithValue(context.TODO(), "testcase", testcase)
createdChains := h.GetChains()
fmt.Println(len(createdChains))
Expand Down
89 changes: 62 additions & 27 deletions test/relayer/data/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,31 @@ global:
memo: ""
light-cache-size: 20
chains:
centauri-testnet-1:
ibc-icon:
type: icon
value:
key-directory: /home/relayer/.relayer/keys
chain-id: ibc-icon
rpc-addr: https://tt.net.solidwallet.io/jvm-rpc/api/v3/
timeout: 10s
keystore: godwallet
password: gochain
icon-network-id: 3
btp-network-id: 46
btp-network-type-id: 1
start-height: 0
ibc-handler-address: cxfbe3f5e12b455310b27475a5b12816bfb9e85ad1
first-retry-block-after: 0
block-interval: 2000
revision-number: 0
localnet-1:
type: cosmos
value:
key-directory: /home/relayer/.relayer/keys/centauri-testnet-1
key: default
chain-id: centauri-testnet-1
rpc-addr: http://docker.for.mac.host.internal:50001
account-prefix: centauri
key-directory: /home/relayer/.relayer/keys/localnet-1
key: fd
chain-id: localnet-1
rpc-addr: https://tt.net.solidwallet.io:443/archway-rpc/
account-prefix: archway
keyring-backend: test
gas-adjustment: 1.3
gas-prices: 0.00stake
Expand All @@ -27,33 +44,51 @@ chains:
signing-algorithm: ""
broadcast-mode: batch
min-loop-duration: 0s
ibc-icon:
type: icon
test-1:
type: cosmos
value:
key-directory: /home/relayer/.relayer/keys
chain-id: ibc-icon
rpc-addr: http://docker.for.mac.host.internal:9082/api/v3/
key-directory: /home/relayer/.relayer/keys/test-1
key: default
chain-id: test-1
rpc-addr: https://tt.net.solidwallet.io:443/centauri2-rpc/
account-prefix: centauri
keyring-backend: test
gas-adjustment: 1.3
gas-prices: 0.00stake
min-gas-amount: 1000000
max-gas-amount: 0
debug: true
timeout: 10s
keystore: godwallet
password: gochain
icon-network-id: 3
btp-network-id: 3
btp-network-type-id: 1
start-height: 0
ibc-handler-address: cx15a26637bc4aa8508b65e6b5176b32487324ca55
first-retry-block-after: 0
block-interval: 2000
revision-number: 0
block-timeout: ""
output-format: json
sign-mode: direct
extra-codecs: []
coin-type: 118
signing-algorithm: ""
broadcast-mode: batch
min-loop-duration: 0s
paths:
TestE2EHopchainTestSuite-TestE2E_hopchain-path-0:
centauri-archway:
src:
chain-id: centauri-testnet-1
client-id: 08-wasm-1
connection-id: connection-1
chain-id: test-1
client-id: 07-tendermint-42
connection-id: connection-32
dst:
chain-id: localnet-1
client-id: 07-tendermint-6
connection-id: connection-3
src-channel-filter:
rule: ""
channel-list: []
centauri-icon:
src:
chain-id: test-1
client-id: 08-wasm-41
connection-id: connection-31
dst:
chain-id: ibc-icon
client-id: ics08-tendermint-0
connection-id: connection-0
client-id: ics08-tendermint-1
connection-id: connection-1
src-channel-filter:
rule: ""
channel-list: []
11 changes: 5 additions & 6 deletions test/testsuite/sample-config-ics20.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ chains:
ibc_ics: "$BASE_PATH/artifacts/icon/ibc-0.1.0-optimized.jar"
ibc_ics_client: "$BASE_PATH/artifacts/icon/tendermint-0.1.0-optimized.jar"
ibc_ics20_client: "$BASE_PATH/artifacts/icon/ics-08-tendermint-0.1.0-optimized.jar"
# ics20_app: "cxa5d0ef8e648657703e12ebcef5a6c1383e2896d0"
ics20_app: "cx954ca124424f243009c546c331f2854fc975b006"
- name: centauri
version: "3"
environment: remote
Expand Down Expand Up @@ -63,15 +63,14 @@ chains:
connection: "$BASE_PATH/artifacts/archway/cw_xcall_ibc_connection_latest.wasm"
dapp: "$BASE_PATH/artifacts/archway/cw_mock_dapp_multi.wasm"
mockdapp: "$BASE_PATH/artifacts/archway/cw_mock_ibc_dapp.wasm"
ibc_ics20_client: "$BASE_PATH/artifacts/centauri/cw_wasm_light_client_icon.wasm"
- name: archway
version: "3"
environment: remote
contracts_path: "$BASE_PATH/artifacts/archway"
config_path: "$BASE_PATH/test/chains/archway/data"
keystore_file: fd
keystore_file: relayer
keystore_password: test
rpc_uri: https://tt.net.solidwallet.io:443/archway-rpc/
rpc_uri: https://tt.net.solidwallet.io:443/archway-rpc
chain_config:
type: cosmos
name: archway
Expand Down Expand Up @@ -101,8 +100,8 @@ relayer:
image: relayer/relayer
tag: ics20
use_existing_keys: true
# use_existing_config: true
use_existing_config: true
keys:
icon: godwallet:gochain
centauri: default
archway: relayer
archway: fd

0 comments on commit cf75be8

Please sign in to comment.