forked from cosmos/ibc-go
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
172 additions
and
106 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bin | ||
data |
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 |
---|---|---|
@@ -1,19 +1,41 @@ | ||
RLY_VERSION := 2.3.1 | ||
CSMS_VERSION := 4.3.1 | ||
ARCH := $(shell dpkg --print-architecture) | ||
PATH := $(shell pwd)/bin:$(PATH) | ||
|
||
install-relayer: | ||
@curl -L https://github.com/cosmos/relayer/releases/download/v$(RLY_VERSION)/Cosmos.Relayer_$(RLY_VERSION)_linux_$(ARCH).tar.gz --output relayer.tar.gz | ||
@tar -xf relayer.tar.gz --transform 's!^[^/]*!relayer_archive!' | ||
@mv relayer_archive/rly /usr/bin | ||
bin/simd: | ||
@mkdir -p bin && \ | ||
cd ../ && \ | ||
make build && \ | ||
mv build/simd e2e/bin | ||
@fnsasimd version --long | ||
|
||
bin/csmssimd: | ||
@mkdir -p bin/cosmos && \ | ||
cd bin/cosmos && \ | ||
curl -L https://github.com/cosmos/ibc-go/releases/download/v$(CSMS_VERSION)/ibc-go_simd_v$(CSMS_VERSION)_linux_$(ARCH).tar.gz --output cosmos_simd.tar.gz && \ | ||
tar -xf cosmos_simd.tar.gz && \ | ||
mv simd ../csmssimd | ||
@csmssimd version --long --log_level=info | ||
|
||
bin/rly: | ||
@mkdir -p bin/relayer && \ | ||
cd bin/relayer && \ | ||
curl -L https://github.com/cosmos/relayer/releases/download/v$(RLY_VERSION)/Cosmos.Relayer_$(RLY_VERSION)_linux_$(ARCH).tar.gz --output relayer.tar.gz && \ | ||
tar -xf relayer.tar.gz --transform 's!^[^/]*!relayer_archive!' && \ | ||
mv relayer_archive/rly ../ | ||
@rly version | ||
@rm -rf relayer.tar.gz relayer_archive | ||
|
||
install-simapp: | ||
@cd ../ && \ | ||
make install | ||
@simd version --long | ||
test-fnsa-fnsa: bin/rly bin/simd | ||
@./e2e fnsa-fnsa fnsa-0 simd 438 fnsa-1 simd 438 "skip" | ||
|
||
test-fnsa-csms: bin/rly bin/simd bin/csmssimd | ||
@./e2e fnsa-csms fnsa-0 simd 438 csms-1 csmssimd 118 "skip" | ||
|
||
clean-all: | ||
@rm -rf bin data | ||
|
||
test-e2e: | ||
@./e2e | ||
clean-data: | ||
@rm -rf data | ||
|
||
.PHONY: install-relayer install-simapp test-e2e | ||
.PHONY: test-fnsa-fnsa test-fnsa-csms clean-all clean-data |
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,18 @@ | ||
{ | ||
"type": "cosmos", | ||
"value": { | ||
"key": "testkey", | ||
"chain-id": "csms-1", | ||
"rpc-addr": "http://localhost:26557", | ||
"grpc-addr": "", | ||
"account-prefix": "cosmos", | ||
"keyring-backend": "test", | ||
"gas-adjustment": 1.5, | ||
"gas-prices": "0.025rice", | ||
"debug": true, | ||
"timeout": "10s", | ||
"output-format": "json", | ||
"sign-mode": "direct" | ||
} | ||
} | ||
|
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,12 @@ | ||
{ | ||
"src": { | ||
"chain-id": "fnsa-0" | ||
}, | ||
"dst": { | ||
"chain-id": "csms-1" | ||
}, | ||
"src-channel-filter": { | ||
"rule": null, | ||
"channel-list": [] | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/bin/bash | ||
# two-chainz creates two chains and configures the relayer to | ||
|
||
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
HOME_DIR="$(pwd)/data" | ||
RLY_HOME="$HOME_DIR/relayer" | ||
|
||
CHAIN0_ID=$1 | ||
CHAIN0_BIN=$2 | ||
CHAIN0_COINID=$3 | ||
CHAIN1_ID=$4 | ||
CHAIN1_BIN=$5 | ||
CHAIN1_COINID=$6 | ||
|
||
# Ensure binary is installed | ||
if ! [ -x "$(which $CHAIN0_BIN)" ]; then | ||
echo "Error: $CHAIN0_BIN is not installed. Try running 'make bin/$CHAIN0_BIN'" >&2 | ||
exit 1 | ||
fi | ||
if ! [ -x "$(which $CHAIN1_BIN)" ]; then | ||
echo "Error: $CHAIN1_BIN is not installed. Try running 'make bin/$CHAIN1_BIN'" >&2 | ||
exit 1 | ||
fi | ||
|
||
# Display software version for testers | ||
echo "BINARY VERSION INFO:" | ||
$CHAIN0_BIN version --long --log_level=info | ||
$CHAIN1_BIN version --long --log_level=info | ||
|
||
# Ensure jq is installed | ||
if [[ ! -x "$(which jq)" ]]; then | ||
echo "jq (a tool for parsing json in the command line) is required..." | ||
echo "https://stedolan.github.io/jq/download/" | ||
exit 1 | ||
fi | ||
|
||
# Ensure user understands what will be deleted | ||
if [[ -d $HOME_DIR ]] && [[ ! "$7" == "skip" ]]; then | ||
read -p "$(basename $0) will delete \$(pwd)/data and \$HOME/.relayer folders. Do you wish to continue? (y/n): " -n 1 -r | ||
echo | ||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then | ||
exit 1 | ||
fi | ||
fi | ||
|
||
# Delete data from old runs | ||
rm -rf $HOME_DIR &> /dev/null | ||
|
||
# Stop existing binary processes | ||
killall simd &> /dev/null | ||
killall csmssimd &> /dev/null | ||
|
||
set -e | ||
|
||
echo "Generating fnsa configurations..." | ||
mkdir -p $HOME_DIR && cd $HOME_DIR && cd ../ | ||
./scripts/one-chain $CHAIN0_BIN $CHAIN0_ID $HOME_DIR 26657 26656 6060 9090 stake samoleans | ||
./scripts/one-chain $CHAIN1_BIN $CHAIN1_ID $HOME_DIR 26557 26556 6061 9091 rice beans | ||
|
||
[ -f $HOME_DIR/$CHAIN0_ID.log ] && echo "$CHAIN0_ID initialized. Watch file $HOME_DIR/$CHAIN0_ID.log to see its execution." | ||
[ -f $HOME_DIR/$CHAIN1_ID.log ] && echo "$CHAIN1_ID initialized. Watch file $HOME_DIR/$CHAIN1_ID.log to see its execution." | ||
|
||
echo "Generating rly configurations..." | ||
rly --home $RLY_HOME config init | ||
rly --home $RLY_HOME chains add-dir configs/chains | ||
|
||
SEED0=$(jq -r '.mnemonic' $HOME_DIR/$CHAIN0_ID/key_seed.json) | ||
SEED1=$(jq -r '.mnemonic' $HOME_DIR/$CHAIN1_ID/key_seed.json) | ||
|
||
echo "Key $(rly --home $RLY_HOME keys restore $CHAIN0_ID testkey "$SEED0" --coin-type $CHAIN0_COINID) imported from CHAIN0_ID to relayer..." | ||
echo "Key $(rly --home $RLY_HOME keys restore $CHAIN1_ID testkey "$SEED1" --coin-type $CHAIN1_COINID) imported from CHAIN1_ID to relayer..." | ||
|
||
rly --home $RLY_HOME paths add-dir configs/paths |
This file was deleted.
Oops, something went wrong.