forked from cosmos/relayer
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add workflow to test deployment of relay locally (#92)
* ci: add workflow to test deployment of relay locally * temp: hotfix for nil pointer dereference * fix: seq number issue in archway module * chore: add separate relay start script * ci: add node repos as git submodules * fix: channel mock --------- Co-authored-by: viveksharmapoudel <[email protected]>
- Loading branch information
1 parent
26e15af
commit a33a152
Showing
12 changed files
with
295 additions
and
40 deletions.
There are no files selected for viewing
Submodule IBC-Integration
added at
1f59cf
Submodule gochain-btp
added at
4c7d22
Submodule icon-ibc-setup
added at
ebf04b
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,112 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT=$(readlink -f $0) | ||
SUBMODULE_DIR=$(dirname $SCRIPT) | ||
|
||
GPG_FINGERPRINT="C787AB518A0C08B7AE1E1ADA2809A1A84E32159A" | ||
|
||
ARCHWAY_CONTAINER='archway-node-1' | ||
|
||
cd $SUBMODULE_DIR | ||
|
||
# Correct path | ||
sed -i "s|^CONTRACTS_DIR=.*|CONTRACTS_DIR=$PWD/IBC-Integration|" ./icon-ibc-setup/consts.sh | ||
sed -i "s|^ICON_WALLET=.*|ICON_WALLET=$PWD/gochain-btp/data/godWallet.json|" ./icon-ibc-setup/consts.sh | ||
sed -i "s|^ARCHWAY_WALLET=.*|ARCHWAY_WALLET=default|" ./icon-ibc-setup/consts.sh | ||
|
||
# Import fd account | ||
pass init $GPG_FINGERPRINT | ||
|
||
echo "### Create default wallet" | ||
|
||
wallet=$(archwayd keys add default --keyring-backend test | awk -F\: '/address/ {print $2}' | tr -d '[:space:]') | ||
echo $wallet | ||
archwayd keys list | ||
|
||
echo "==> Starting icon node ..." | ||
cd $SUBMODULE_DIR/gochain-btp | ||
make ibc-ready | ||
|
||
echo "==> Starting archway node ..." | ||
cd ${SUBMODULE_DIR}/archway | ||
|
||
sed -i '/^archwayd add-genesis-account.*/a archwayd add-genesis-account "'"$wallet"'" 1000000000stake --keyring-backend=test' contrib/localnet/localnet.sh | ||
sed -i 's/latest/v0.4.0/' docker-compose.yaml | ||
docker compose -f docker-compose.yaml up -d | ||
sleep 60 | ||
|
||
echo "### Check archwayd start script content" | ||
cat contrib/localnet/localnet.sh | ||
docker ps | ||
|
||
echo "### Check archwayd genesis file" | ||
docker exec $ARCHWAY_CONTAINER cat /root/.archway/config/genesis.json | ||
|
||
echo "### Check archwayd keys list on node" | ||
docker exec $ARCHWAY_CONTAINER archwayd keys list | ||
|
||
echo "### Check archwayd keys list on local" | ||
archwayd keys list --keyring-backend os | ||
|
||
echo "### Get fd wallet address" | ||
fdwallet=$(docker exec $ARCHWAY_CONTAINER archwayd keys list --keyring-backend test | awk -F\: '/address/ {print $2}' | tr -d '[:space:]') | ||
|
||
echo "default: $wallet" | ||
echo "fd: $fdwallet" | ||
|
||
echo "### Checking docker logs" | ||
docker logs $ARCHWAY_CONTAINER | ||
echo "### Query balance of account" | ||
echo "default:" | ||
archwayd query bank balances $wallet | ||
echo "fd:" | ||
docker exec $ARCHWAY_CONTAINER archwayd query bank balances $fdwallet | ||
|
||
cd $SUBMODULE_DIR/icon-ibc-setup | ||
|
||
sed -i 's/ARCHWAY_NETWORK=localnet/ARCHWAY_NETWORK=docker/' consts.sh | ||
mkdir -p ~/.relayer/config | ||
echo "==> Setting up icon ..." | ||
make icon | ||
echo "==> Setting up archway ..." | ||
make archway | ||
echo "### Updating config ..." | ||
make config | ||
|
||
cat ~/.relayer/config/config.yaml | ||
|
||
echo -e "\nCopy default key to relayer keyring ======" | ||
mkdir -p /home/runner/.relayer/keys/localnet/keyring-test | ||
cp ~/.archway/keyring-test/default.info ~/.relayer/keys/localnet/keyring-test/default.info | ||
|
||
|
||
echo "### all archwayd keys:" | ||
archwayd keys list | ||
echo "### keyring: os" | ||
archwayd keys list --keyring-backend os | ||
echo "### keyring: test" | ||
archwayd keys list --keyring-backend test | ||
|
||
echo "### Checking keys inside archway docker node:" | ||
docker exec $ARCHWAY_CONTAINER archwayd keys list --keyring-backend os | ||
docker exec $ARCHWAY_CONTAINER archwayd keys list --keyring-backend test | ||
|
||
|
||
echo "+++++++++++++++++++++" | ||
echo "==> Starting link..." | ||
rly tx link icon-archway --client-tp=10000m --src-port mock --dst-port mock -d | ||
# Enable when debug is required | ||
# rly tx link icon-archway --client-tp=10000m --src-port mock --dst-port mock --order=ordered -d | ||
# for txhash in $(cat log.txt | grep 'Submitted transaction" provider_type=archway chain_id=localnet txHash=' | awk -F\= '{print $NF}') | ||
# do | ||
# echo -e "\n+++ Checking $txhash ...\n" | ||
# archwayd query tx $txhash | ||
# done | ||
echo | ||
echo | ||
docker ps | ||
echo "### Checking relay config" | ||
cat ~/.relayer/config/config.yaml | ||
echo "==> Starting relayer..." | ||
rly start icon-archway & sleep 60s; echo "* Stopping relay ..."; kill $! | ||
|
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 |
---|---|---|
|
@@ -4,8 +4,8 @@ on: | |
push: | ||
tags: | ||
- '**' | ||
branches: | ||
- '**' | ||
# branches: | ||
# - '**' | ||
pull_request: | ||
branches: | ||
- main | ||
|
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,89 @@ | ||
name: Deploy Relayer Locally | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
relay-local-deployment: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Pull & update submodules recursively | ||
run: | | ||
git submodule update --init --recursive | ||
git submodule update --recursive --remote | ||
# Install and setup go | ||
- name: Set up Go 1.19 | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.19 | ||
|
||
# setup gopath | ||
- name: Set PATH | ||
run: | | ||
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | ||
shell: bash | ||
|
||
# Install rust toolchain | ||
- name: Install rust stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.69.0 | ||
target: wasm32-unknown-unknown | ||
override: true | ||
profile: minimal | ||
|
||
- name: Cache Rust dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
# Build relay | ||
- name: Build relayer | ||
run: make install | ||
|
||
# Install goloop | ||
- name: Install goloop | ||
run: go install github.com/icon-project/goloop/cmd/goloop@latest | ||
|
||
# Build archwayd | ||
- name: Build archwayd | ||
working-directory: .github/scripts/archway | ||
run: | | ||
echo $PWD | ||
echo $GITHUB_WORKSPACE | ||
make install | ||
# Build comsmwasm | ||
- name: Compile WASM | ||
working-directory: .github/scripts/IBC-Integration | ||
run: | | ||
rustup component add rustfmt --toolchain 1.69.0-x86_64-unknown-linux-gnu | ||
rustup component add clippy --toolchain 1.69.0-x86_64-unknown-linux-gnu | ||
bash ./optimize_build.sh | ||
- name: Build javascore | ||
working-directory: .github/scripts/IBC-Integration/contracts/javascore | ||
run: | | ||
./gradlew clean build | ||
./gradlew optimizedJar | ||
- name: Import GPG key | ||
uses: crazy-max/ghaction-import-gpg@v5 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
fingerprint: "C787AB518A0C08B7AE1E1ADA2809A1A84E32159A" | ||
trust_level: 5 | ||
|
||
|
||
- name: start relay | ||
working-directory: .github/scripts | ||
run: bash ./start_relay.sh | ||
|
||
|
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,20 @@ | ||
[submodule "contracts/javascore/gochain-btp"] | ||
path = contracts/javascore/gochain-btp | ||
url = https://github.com/izyak/gochain-btp.git | ||
|
||
[submodule "contracts/cosmwasm-vm/archway"] | ||
path = contracts/cosmwasm-vm/archway | ||
url = https://github.com/archway-network/archway.git | ||
|
||
[submodule ".github/scripts/IBC-Integration"] | ||
path = .github/scripts/IBC-Integration | ||
url = https://github.com/icon-project/IBC-Integration.git | ||
[submodule ".github/scripts/archway"] | ||
path = .github/scripts/archway | ||
url = https://github.com/archway-network/archway.git | ||
[submodule ".github/scripts/gochain-btp"] | ||
path = .github/scripts/gochain-btp | ||
url = https://github.com/izyak/gochain-btp.git | ||
[submodule ".github/scripts/icon-ibc-setup"] | ||
path = .github/scripts/icon-ibc-setup | ||
url = https://github.com/izyak/icon-ibc-setup.git |
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,15 @@ | ||
version: "3.7" | ||
services: | ||
ibc-relayer: | ||
container_name: relayer01 | ||
image: docker.io/18cr314y/relay-node:latest | ||
environment: | ||
- PATH_NAME="icon-archway" | ||
entrypoint: | ||
- sh | ||
- /opt/start-relay.sh | ||
volumes: | ||
- ~/.relayer:/home/relayer/.relayer:rw | ||
- ./scripts:/opt | ||
ports: | ||
- "5183:5183" |
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
Oops, something went wrong.