Skip to content

Commit

Permalink
e2e: add new chain
Browse files Browse the repository at this point in the history
  • Loading branch information
scalalang2 committed Nov 27, 2022
1 parent 7336637 commit 8ad3717
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 15 deletions.
14 changes: 12 additions & 2 deletions e2e/configs/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,21 @@ server:
chains:
- name: "cosmos"
key_name: "cosmos"
chain_id: "testchain"
rpc_endpoint: "http://testchain:26657/"
chain_id: "gaia"
rpc_endpoint: "http://testchain-1: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: "juno"
key_name: "juno"
chain_id: "juno"
rpc_endpoint: "http://testchain-2:26657/"
account_prefix: "cosmos"
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"
27 changes: 20 additions & 7 deletions e2e/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
version: '3.4'

services:
testchain:
container_name: testchain
testchain-1:
container_name: testchain-1
image: tendermint/gaia:v4.2.0
restart: always
user: root
volumes:
- ./scripts:/gaia
- ./scripts:/home
command:
- /bin/sh
- -c
- |
echo "start run single node."
/gaia/init_chain.sh
/home/init_chain.sh cosmos1u9vn33qs6jdr3wwq4u2l9p349n9c95uxz2lew0 uatom gaia
ports:
- "26656:26656"
- "26657:26657"
- "1317:1317"
- "9090:9090"
- "9091:9091"
testchain-2:
container_name: testchain-2
image: tendermint/gaia:v4.2.0
restart: always
user: root
volumes:
- ./scripts:/home
command:
- /bin/sh
- -c
- |
echo "start run single node."
/home/init_chain.sh cosmos10hhwf89y3gvum4xyzlyz48zxldjehlqzf4dlwt ujuno juno
ports:
- "26658:26657"
- "1318:1317"
faucet:
build:
context: ..
Expand Down
14 changes: 8 additions & 6 deletions e2e/scripts/init_chain.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/bin/sh

MONIKER=testchainer
CHAIN_ID=testchain
MONIKER=gaiachainer
CHAIN_ID=$3
KEYRING=test
HOME_PATH=/data/chain/.gaiad
HOME_PATH=/data/chain/.data
WALLET_NAME=validator
FAUCET_ADDRESS=cosmos1u9vn33qs6jdr3wwq4u2l9p349n9c95uxz2lew0
#FAUCET_ADDRESS=cosmos1u9vn33qs6jdr3wwq4u2l9p349n9c95uxz2lew0
FAUCET_ADDRESS=$1
DENOM=$2
RUN_CMD=gaiad

rm -rf $HOME_PATH
Expand All @@ -18,8 +20,8 @@ $RUN_CMD init $MONIKER --chain-id=$CHAIN_ID --home=$HOME_PATH
$RUN_CMD keys add $WALLET_NAME --keyring-backend=$KEYRING --home=$HOME_PATH

# create validator node with tokens to transfer to the three other nodes
$RUN_CMD add-genesis-account $($RUN_CMD keys show $WALLET_NAME -a --keyring-backend=$KEYRING --home=$HOME_PATH) 100000000000uatom,100000000000stake --home=$HOME_PATH
$RUN_CMD add-genesis-account $FAUCET_ADDRESS 100000000000uatom --home=$HOME_PATH
$RUN_CMD add-genesis-account $($RUN_CMD keys show $WALLET_NAME -a --keyring-backend=$KEYRING --home=$HOME_PATH) 100000000000$DENOM,100000000000stake --home=$HOME_PATH
$RUN_CMD add-genesis-account $FAUCET_ADDRESS 100000000000$DENOM --home=$HOME_PATH
$RUN_CMD gentx $WALLET_NAME 500000000stake --keyring-backend=$KEYRING --home=$HOME_PATH --chain-id=$CHAIN_ID
$RUN_CMD collect-gentxs --home=$HOME_PATH

Expand Down

0 comments on commit 8ad3717

Please sign in to comment.