Skip to content

Commit

Permalink
e2e: set up for 2 chains with relayer
Browse files Browse the repository at this point in the history
  • Loading branch information
scalalang2 committed Nov 28, 2022
1 parent 8ad3717 commit 047f78e
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 13 deletions.
20 changes: 10 additions & 10 deletions config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
server:
allow_cors: false
http:
port: 8081
port: 8080
grpc:
port: 9092
limit:
Expand All @@ -10,21 +10,21 @@ server:
chains:
- name: "cosmos"
key_name: "cosmos"
chain_id: "testchain"
chain_id: "gaia"
rpc_endpoint: "http://localhost:26657/"
account_prefix: "cosmos"
sender: "cosmos1u9vn33qs6jdr3wwq4u2l9p349n9c95uxz2lew0"
key: "reopen throw concert garment wash slab jump company habit father below stage float attitude achieve net charge bulb mouse mind fat net hello vague"
gas_adjustment: 1.2
gas_price: "0.01uatom"
drop_coin: "10000000uatom"
- name: "osmosis"
key_name: "osmosis"
chain_id: "testchain22"
rpc_endpoint: "http://localhost:26657/"
- name: "juno"
key_name: "juno"
chain_id: "juno"
rpc_endpoint: "http://localhost:26658/"
account_prefix: "cosmos"
sender: "cosmos1u9vn33qs6jdr3wwq4u2l9p349n9c95uxz2lew0"
key: "reopen throw concert garment wash slab jump company habit father below stage float attitude achieve net charge bulb mouse mind fat net hello vague"
sender: "cosmos10hhwf89y3gvum4xyzlyz48zxldjehlqzf4dlwt"
key: "predict lonely oxygen category agent wait legend quarter often six liquid search panic panther chuckle glow alone detail bike below dust marriage throw pause"
gas_adjustment: 1.2
gas_price: "0.01uatom"
drop_coin: "10000000uatom"
gas_price: "0.01ujuno"
drop_coin: "10000000ujuno"
4 changes: 2 additions & 2 deletions e2e/configs/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ chains:
sender: "cosmos10hhwf89y3gvum4xyzlyz48zxldjehlqzf4dlwt"
key: "predict lonely oxygen category agent wait legend quarter often six liquid search panic panther chuckle glow alone detail bike below dust marriage throw pause"
gas_adjustment: 1.2
gas_price: "0.01uatom"
drop_coin: "10000000uatom"
gas_price: "0.01ujuno"
drop_coin: "10000000ujuno"
26 changes: 26 additions & 0 deletions e2e/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,33 @@ services:
ports:
- "26658:26657"
- "1318:1317"
relayer:
container_name: relayer
image: relayer
build:
context: ./relayer
dockerfile: Dockerfile.relayer
volumes:
- ./relayer/:/home/relayer/tmp/
command:
- /bin/sh
- -c
- |
while ! nc -z testchain-1 26657; do sleep 1; done
while ! nc -z testchain-2 26657; do sleep 1; done
# sleep enough for at least two blocks to be issued.
sleep 30;
mkdir -p /home/relayer/.relayer/config
cp -r /home/relayer/tmp/* /home/relayer/.relayer/config/
chmod u+x /home/relayer/.relayer/config/start.sh
/home/relayer/.relayer/config/start.sh
faucet:
depends_on:
- testchain-1
- testchain-2
build:
context: ..
restart: always
Expand Down
24 changes: 24 additions & 0 deletions e2e/relayer/Dockerfile.relayer
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1.19-alpine3.15 AS builder

WORKDIR /src/

ENV BRANCH=v2.0.0-rc3

RUN apk add --update git make gcc linux-headers libc-dev eudev-dev
RUN git clone https://github.com/cosmos/relayer.git \
&& cd relayer \
&& git checkout $BRANCH \
&& make install

FROM alpine:3.15
COPY --from=builder /go/bin/rly /usr/local/bin/

RUN apk add bash vim \
&& addgroup -g 1000 relayer \
&& adduser -S -h /home/relayer -D relayer -u 1000 -G relayer

RUN mkdir -p /home/relayer/.relayer \
&& chown -R relayer:relayer /home/relayer

USER 1000
WORKDIR /home/relayer
35 changes: 35 additions & 0 deletions e2e/relayer/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
global:
api-listen-addr: :5183
timeout: 10s
memo: ""
light-cache-size: 20
chains:
cosmos:
type: cosmos
value:
key: gaia-key
chain-id: gaia
rpc-addr: http://testchain-1:26657/
account-prefix: cosmos
keyring-backend: test
gas-adjustment: 1.2
gas-prices: 0.01uatom
debug: false
timeout: 20s
output-format: json
sign-mode: direct
juno:
type: cosmos
value:
key: juno-key
chain-id: juno
rpc-addr: http://testchain-2:26657/
account-prefix: cosmos
keyring-backend: test
gas-adjustment: 1.2
gas-prices: 0.01ujuno
debug: false
timeout: 20s
output-format: json
sign-mode: direct
paths: {}
14 changes: 14 additions & 0 deletions e2e/relayer/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -e

# restore keys
rly keys restore cosmos gaia-key "reopen throw concert garment wash slab jump company habit father below stage float attitude achieve net charge bulb mouse mind fat net hello vague"
rly keys restore juno juno-key "predict lonely oxygen category agent wait legend quarter often six liquid search panic panther chuckle glow alone detail bike below dust marriage throw pause"

# create client, connection and transfer channels
rly paths new gaia juno test_path
rly transact link test_path

# start relayer
rly start test_path -p events
1 change: 0 additions & 1 deletion e2e/scripts/init_chain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ CHAIN_ID=$3
KEYRING=test
HOME_PATH=/data/chain/.data
WALLET_NAME=validator
#FAUCET_ADDRESS=cosmos1u9vn33qs6jdr3wwq4u2l9p349n9c95uxz2lew0
FAUCET_ADDRESS=$1
DENOM=$2
RUN_CMD=gaiad
Expand Down

0 comments on commit 047f78e

Please sign in to comment.