Skip to content

Commit

Permalink
Merge pull request #33 from VictorTrustyDev/imp/mac-compatible-and-up…
Browse files Browse the repository at this point in the history
…date-deps-evmos-12.1.4

imp: mac compatible and update deps evmos 12.1.4
  • Loading branch information
VictorTrustyDev authored May 31, 2023
2 parents 3adcb3a + f64ed50 commit 9a32cab
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 47 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Not only EVMOS, you can use this script to build for other chains like cosmos,..
You can find commands to install the above tools [here](https://github.com/VictorTrustyDev/EVMOS-sample-scripts/blob/main/Install-Required-Tools-on-Ubuntu.md)

I created all of the following samples on an Ubuntu 22.04 LTS machine with 4 CPU 16 GB RAM. It can run
- 2 [EVMOS](https://github.com/evmos/evmos/tree/v12.1.3) chains
- 2 [EVMOS](https://github.com/evmos/evmos/tree/v12.1.4) chains
- 1 [Hermes](https://github.com/informalsystems/ibc-rs/tree/v1.5.0) as IBC relayer to connect those chains
- 2 [bdjuno & hasura](https://github.com/forbole/bdjuno/tree/chains/evmos/mainnet) as block explorer's backend & graphql service
- 2 [Big Dipper 2.0](https://github.com/forbole/big-dipper-2.0-cosmos) as block explorer's frontend
Expand All @@ -31,7 +31,7 @@ without any performance issue (CPU ~20-80% per core, ram ~50% via htop)

### Software versions:

- [Evmos v12.1.3](https://github.com/evmos/evmos/tree/v12.1.3)
- [Evmos v12.1.4](https://github.com/evmos/evmos/tree/v12.1.4)
- [Hermes v1.5.0](https://github.com/informalsystems/ibc-rs/tree/v1.5.0)
- [bdjuno branch evmos](https://github.com/forbole/bdjuno/tree/chains/evmos/mainnet)
- [Big Dipper 2.0 for Cosmos chains v2.x](https://github.com/forbole/big-dipper-2.0-cosmos)
Expand Down
10 changes: 5 additions & 5 deletions all-in-one.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,20 @@ cd "$AIO_DIR_CHAIN"
echo "> [Chain 1]"
./1_prepare-genesis.sh 1
[ $? -eq 0 ] || { echo >&2 "ERR AIO: Operation failed (genesis)"; exit 1; }
sleep 2s
sleep 2
./2_build-docker-image.sh 1
[ $? -eq 0 ] || { echo >&2 "ERR AIO: Operation failed (build docker image)"; exit 1; }
sleep 2s
sleep 2
docker-compose -f network1.yml up -d
echo "> [Chain 2]"
./1_prepare-genesis.sh 2
[ $? -eq 0 ] || { echo >&2 "ERR AIO: Operation failed (genesis)"; exit 1; }
sleep 2s
sleep 2
./2_build-docker-image.sh 2
[ $? -eq 0 ] || { echo >&2 "ERR AIO: Operation failed (build docker image)"; exit 1; }
sleep 2s
sleep 2
docker-compose -f network2.yml up -d
sleep 20s
sleep 20

cd "$AIO_CUR_DIR"
cd "$AIO_DIR_HERMES"
Expand Down
12 changes: 6 additions & 6 deletions big-dipper-as-block-explorer/1_install-bdjuno.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ PG_VOL_NAME="bdjdb$CHAIN_NO"
}

echo 'Remove existing docker container & volumes'
sleep 3s
sleep 3
docker rm -f $PG_CON_NAME
docker volume rm -f $PG_VOL_NAME

Expand All @@ -60,7 +60,7 @@ docker run \
[ $? -eq 0 ] || { echo >&2 "ERR: Failed to create a PostgreSQL container"; }

echo 'Waiting DB up'
sleep 20s
sleep 20

echo "- Creating database $BD_PG_DB"
PGPASSWORD=$BD_CFG_PG_USR_PASS psql -h 127.0.0.1 -p $PG_PORT -d postgres -U postgres -c "CREATE DATABASE $BD_PG_DB;"
Expand All @@ -80,26 +80,26 @@ if [ -d "./$BD_SOURCE_DIR" ]; then
CHK_RES_1="$(git --git-dir "./$BD_SOURCE_DIR"/.git --work-tree "./$BD_SOURCE_DIR" config --get remote.origin.url)"
if [ $? -ne 0 ] || [ -z "$CHK_RES_1" ]; then
echo "WARN! Unable to check remote origin url of git repo at $BD_SOURCE_DIR"
sleep 2s
sleep 2
elif [ "$CHK_RES_1" != "$BD_GIT_REPO" ]; then
echo "WARN! Git repo Url does not match"
echo "Expected: '$BD_GIT_REPO'"
echo "Actual: '$CHK_RES_1'"
echo "You should check it (script will continue execution after 10s)"
sleep 10s
sleep 10
fi
CHK_RES_2="$(git --git-dir "./$BD_SOURCE_DIR"/.git --work-tree "./$BD_SOURCE_DIR" rev-parse --abbrev-ref HEAD)"
if [ $? -ne 0 ] || [ -z "$CHK_RES_2" ]; then
echo "WARN! Unable to check branch of git repo at $BD_SOURCE_DIR"
sleep 2s
sleep 2
elif [ "$CHK_RES_2" = "HEAD" ]; then
echo "WARN! Can not check branch"
elif [ "$CHK_RES_2" != "$BD_GIT_BRANCH" ]; then
echo "WARN! Git Branch does not match"
echo "Expected: '$BD_GIT_BRANCH'"
echo "Actual: '$CHK_RES_2'"
echo "You should check it (script will continue execution after 10s)"
sleep 10s
sleep 10
fi
else
echo "Downloading bdjuno source code from branch $BD_GIT_BRANCH"
Expand Down
4 changes: 2 additions & 2 deletions big-dipper-as-block-explorer/3_install-hasura.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ BD_HASURA_CON_NAME="bdjhasura$CHAIN_NO"

echo 'Remove existing containers'
docker rm -f $BD_HASURA_CON_NAME
sleep 1s
sleep 1

echo 'Preparing DB'
echo 'Dropping old data if exists'
Expand Down Expand Up @@ -80,7 +80,7 @@ docker run \
hasura/graphql-engine:v2.7.0

echo 'Wait hasura up'
sleep 3s
sleep 3

echo 'Applying Hasura metadata'

Expand Down
8 changes: 4 additions & 4 deletions big-dipper-as-block-explorer/4_install-front-end.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,26 @@ if [ -d "$BD2_SOURCE_DIR" ]; then
CHK_RES_1="$(git --git-dir "./$BD2_SOURCE_DIR"/.git --work-tree "./$BD2_SOURCE_DIR" config --get remote.origin.url)"
if [ $? -ne 0 ] || [ -z "$CHK_RES_1" ]; then
echo "WARN! Unable to check remote origin url of git repo at $BD2_SOURCE_DIR"
sleep 2s
sleep 2
elif [ "$CHK_RES_1" != "$BD2_GIT_REPO" ]; then
echo "WARN! Git repo Url does not match"
echo "Expected: '$BD2_GIT_REPO'"
echo "Actual: '$CHK_RES_1'"
echo "You should check it (script will continue execution after 10s)"
sleep 10s
sleep 10
fi
CHK_RES_2="$(git --git-dir "./$BD2_SOURCE_DIR"/.git --work-tree "./$BD2_SOURCE_DIR" rev-parse --abbrev-ref HEAD)"
if [ $? -ne 0 ] || [ -z "$CHK_RES_2" ]; then
echo "WARN! Unable to check branch of git repo at $BD2_SOURCE_DIR"
sleep 2s
sleep 2
elif [ "$CHK_RES_2" = "HEAD" ]; then
echo "WARN! Can not check branch"
elif [ "$CHK_RES_2" != "$BD2_BRANCH" ]; then
echo "WARN! Git Branch does not match"
echo "Expected: '$BD2_BRANCH'"
echo "Actual: '$CHK_RES_2'"
echo "You should check it (script will continue execution after 10s)"
sleep 10s
sleep 10
fi
else
echo "Downloading Big Dipper 2.0 source code from branch $BD2_BRANCH"
Expand Down
8 changes: 4 additions & 4 deletions blockchain-in-docker/2_build-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,26 @@ if [ -d "$SOURCE_CODE_DIR" ]; then
CHK_RES_1="$(git --git-dir "./$SOURCE_CODE_DIR"/.git --work-tree "./$SOURCE_CODE_DIR" config --get remote.origin.url)"
if [ $? -ne 0 ] || [ -z "$CHK_RES_1" ]; then
echo "WARN! Unable to check remote origin url of git repo at $SOURCE_CODE_DIR"
sleep 2s
sleep 2
elif [ "$CHK_RES_1" != "$GIT_REPO" ]; then
echo "WARN! Git repo Url does not match"
echo "Expected: '$GIT_REPO'"
echo "Actual: '$CHK_RES_1'"
echo "You should check it (script will continue execution after 10s)"
sleep 10s
sleep 10
fi
CHK_RES_2="$(git --git-dir "./$SOURCE_CODE_DIR"/.git --work-tree "./$SOURCE_CODE_DIR" rev-parse --abbrev-ref HEAD)"
if [ $? -ne 0 ] || [ -z "$CHK_RES_2" ]; then
echo "WARN! Unable to check branch of git repo at $SOURCE_CODE_DIR"
sleep 2s
sleep 2
elif [ "$CHK_RES_2" = "HEAD" ]; then
echo "WARN! Can not check branch"
elif [ "$CHK_RES_2" != "$GIT_BRANCH" ]; then
echo "WARN! Git Branch does not match"
echo "Expected: '$GIT_BRANCH'"
echo "Actual: '$CHK_RES_2'"
echo "You should check it (script will continue execution after 10s)"
sleep 10s
sleep 10
fi
else
echo "Downloading $CHAIN_NAME source code $GIT_BRANCH"
Expand Down
6 changes: 3 additions & 3 deletions blockchain-in-docker/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### This helps you create 2 EVMOS chains ([v12.1.3](https://github.com/evmos/evmos/tree/v12.1.3)) with 3 validators on each chain and run with docker compose
### This helps you create 2 EVMOS chains ([v12.1.4](https://github.com/evmos/evmos/tree/v12.1.4)) with 3 validators on each chain and run with docker compose

### I. Create first chain

Expand Down Expand Up @@ -62,12 +62,12 @@ Here are some of them:
| Key | Default value | Explain |
| --- | --- | --- |
| `CHAIN_1_GIT_REPO` | https://github.com/evmos/evmos.git | Git repo to be used to build chain 1 |
| `CHAIN_1_GIT_REPO_BRANCH` | v12.1.3 | Git branch to be used to build chain 1 |
| `CHAIN_1_GIT_REPO_BRANCH` | v12.1.4 | Git branch to be used to build chain 1 |
| `CHAIN_1_ID` | evmos_9000-5 | Chain id of chain 1 |
| `CHAIN_1_TYPE` | evmos | Chain type of chain 1 |
| `CHAIN_1_COINTYPE` | 60 | [HD key derivation path](https://docs.evmos.org/protocol/concepts/accounts#evmos-accounts) for chain 1's accounts |
| `CHAIN_2_GIT_REPO` | https://github.com/evmos/evmos.git | Git repo to be used to build chain 2 |
| `CHAIN_2_GIT_REPO_BRANCH` | v12.1.3 | Git branch to be used to build chain 2 |
| `CHAIN_2_GIT_REPO_BRANCH` | v12.1.4 | Git branch to be used to build chain 2 |
| `CHAIN_2_ID` | evmos_9000-6 | Chain id of chain 2 |
| `CHAIN_2_TYPE` | evmos | Chain type of chain 2 |
| `CHAIN_2_COINTYPE` | 60 | [HD key derivation path](https://docs.evmos.org/protocol/concepts/accounts#evmos-accounts) for chain 2's accounts |
Expand Down
8 changes: 4 additions & 4 deletions blockchain-in-docker/_make_binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ if [ -d "$SOURCE_CODE_DIR" ]; then
CHK_RES_1="$(git --git-dir "./$SOURCE_CODE_DIR"/.git --work-tree "./$SOURCE_CODE_DIR" config --get remote.origin.url)"
if [ $? -ne 0 ] || [ -z "$CHK_RES_1" ]; then
echo "WARN! Unable to check remote origin url of git repo at $SOURCE_CODE_DIR"
sleep 2s
sleep 2
elif [ "$CHK_RES_1" != "$GIT_REPO" ]; then
echo "WARN! Git repo Url does not match"
echo "Expected: '$GIT_REPO'"
echo "Actual: '$CHK_RES_1'"
echo "You should check it (script will continue execution after 10s)"
sleep 10s
sleep 10
fi
CHK_RES_2="$(git --git-dir "./$SOURCE_CODE_DIR"/.git --work-tree "./$SOURCE_CODE_DIR" rev-parse --abbrev-ref HEAD)"
if [ $? -ne 0 ] || [ -z "$CHK_RES_2" ]; then
echo "WARN! Unable to check branch of git repo at $SOURCE_CODE_DIR"
sleep 2s
sleep 2
elif [ "$CHK_RES_2" = "HEAD" ]; then
echo "WARN! Can not check branch"
elif [ "$CHK_RES_2" != "$GIT_BRANCH" ]; then
echo "WARN! Git Branch does not match"
echo "Expected: '$GIT_BRANCH'"
echo "Actual: '$CHK_RES_2'"
echo "You should check it (script will continue execution after 10s)"
sleep 10s
sleep 10
fi
else
echo "Downloading $CHAIN_NAME source code $GIT_BRANCH"
Expand Down
4 changes: 2 additions & 2 deletions env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export CHAIN_1_ID="evmos_9000-5"
export CHAIN_1_COINTYPE=60 # 60 for EVMOS, 118 for Cosmos
export CHAIN_1_ACCOUNT_PREFIX="evmos"
export CHAIN_1_GIT_REPO="https://github.com/evmos/evmos.git"
export CHAIN_1_GIT_REPO_BRANCH="v12.1.3" # must belong to repo $CHAIN_1_GIT_REPO
export CHAIN_1_GIT_REPO_BRANCH="v12.1.4" # must belong to repo $CHAIN_1_GIT_REPO
export CHAIN_1_DAEMON_BINARY_NAME="evmosd"
export CHAIN_1_DENOM_SYMBOL="evmos"
export CHAIN_1_MIN_DENOM_SYMBOL="aevmos"
Expand All @@ -50,7 +50,7 @@ export CHAIN_2_ID="evmos_9000-6"
export CHAIN_2_COINTYPE=60 # 60 for EVMOS, 118 for Cosmos
export CHAIN_2_ACCOUNT_PREFIX="evmos"
export CHAIN_2_GIT_REPO="https://github.com/evmos/evmos.git"
export CHAIN_2_GIT_REPO_BRANCH="v12.1.3" # must belong to repo $CHAIN_2_GIT_REPO
export CHAIN_2_GIT_REPO_BRANCH="v12.1.4" # must belong to repo $CHAIN_2_GIT_REPO
export CHAIN_2_DAEMON_BINARY_NAME="evmosd"
export CHAIN_2_DENOM_SYMBOL="evmos"
export CHAIN_2_MIN_DENOM_SYMBOL="aevmos"
Expand Down
10 changes: 5 additions & 5 deletions hermes-as-ibc-relayer/_make_binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ if [ -d "$HERMES_SOURCE_DIR" ]; then
CHK_RES_1="$(git --git-dir "./$HERMES_SOURCE_DIR"/.git --work-tree "./$HERMES_SOURCE_DIR" config --get remote.origin.url)"
if [ $? -ne 0 ] || [ -z "$CHK_RES_1" ]; then
echo "WARN! Unable to check remote origin url of git repo at $HERMES_SOURCE_DIR"
sleep 2s
sleep 2
elif [ "$CHK_RES_1" != "$HERMES_GIT_REPO" ]; then
echo "WARN! Git repo Url does not match"
echo "Expected: '$HERMES_GIT_REPO'"
echo "Actual: '$CHK_RES_1'"
echo "You should check it (script will continue execution after 10s)"
sleep 10s
sleep 10
fi
CHK_RES_2="$(git --git-dir "./$HERMES_SOURCE_DIR"/.git --work-tree "./$HERMES_SOURCE_DIR" rev-parse --abbrev-ref HEAD)"
if [ $? -ne 0 ] || [ -z "$CHK_RES_2" ]; then
echo "WARN! Unable to check branch of git repo at $HERMES_SOURCE_DIR"
sleep 2s
sleep 2
elif [ "$CHK_RES_2" = "HEAD" ]; then
echo "WARN! Can not check branch"
elif [ "$CHK_RES_2" != "$HERMES_GIT_REPO_BRANCH" ]; then
echo "WARN! Git Branch does not match"
echo "Expected: '$HERMES_GIT_REPO_BRANCH'"
echo "Actual: '$CHK_RES_2'"
echo "You should check it (script will continue execution after 10s)"
sleep 10s
sleep 10
fi
else
echo "Downloading Hermes source code $HERMES_GIT_REPO_BRANCH"
Expand All @@ -42,7 +42,7 @@ fi
CUR_DIR=$(pwd)
cd "$HERMES_SOURCE_DIR"
echo "Compiling $HERMES_BINARY. If this is the first time you compile, it will take time, you can enjoy a cup of coffee and comeback later"
sleep 3s
sleep 3
cargo build --release --bin $HERMES_BINARY
[ $? -eq 0 ] || { echo >&2 "ERR: Failed to compile Hermes"; exit 1; }
cd "$CUR_DIR"
Expand Down
20 changes: 10 additions & 10 deletions hermes-as-ibc-relayer/create-relayer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export BINARY=$(pwd)'/'$HERMES_SOURCE_DIR'/target/release/'$HERMES_BINARY
[ $? -eq 0 ] || { echo >&2 "ERR: Failed to check & build $HERMES_BINARY binary at $BINARY"; }

echo 'You can custom config by editing keys with prefix [HERMES_CFG_CHAIN_*] in [env.sh] file'
sleep 3s
sleep 3

echo "Chain ID: $HERMES_CFG_CHAIN_1_ID and $HERMES_CFG_CHAIN_2_ID"
echo "Chain 1:"
Expand All @@ -71,7 +71,7 @@ echo "- gRPC: $HERMES_CFG_CHAIN_2_GRPC_ADDR"
echo "- Account prefix: $HERMES_CFG_CHAIN_2_ACCOUNT_PREFIX"
echo "- Relayer tx broadcast account key name: $HERMES_CFG_CHAIN_2_KEY_NAME"
echo "- Gas price denom: $HERMES_CFG_CHAIN_2_GAS_PRICE_DENOM_SYMBOL"
sleep 3s
sleep 3

if [ $CHAIN_1_COINTYPE -eq 60 ] || [ "$CHAIN_1_TYPE" = "evmos" ]; then
GAS_PRICE_1="$(bc <<< "20 * 10 ^ ($HERMES_CFG_CHAIN_1_DENOM_EXPONENT/2)")"
Expand Down Expand Up @@ -214,10 +214,10 @@ echo ' > Connection 1 to 2: '$CONN_1_TO_2

CONN_2_TO_1="$CONN_1_TO_2"

sleep 5s
sleep 5
echo ' + Testing connection 1'
$BINARY --config $CONFIG_TOML query connection end --chain $HERMES_CFG_CHAIN_1_ID --connection $CONN_1_TO_2 | grep 'Open'
sleep 2s
sleep 2

echo '- Creating channel'

Expand Down Expand Up @@ -256,30 +256,30 @@ echo "- Init for $HERMES_CFG_CHAIN_1_GAS_PRICE_DENOM_SYMBOL on $HERMES_CFG_CHAIN
echo ' + FT-Transfer from '$HERMES_CFG_CHAIN_1_ID' to '$HERMES_CFG_CHAIN_2_ID
$BINARY --config $CONFIG_TOML tx ft-transfer --dst-chain $HERMES_CFG_CHAIN_2_ID --src-chain $HERMES_CFG_CHAIN_1_ID --src-port transfer --src-channel $CHAN_1_TO_2 --timeout-seconds 1000 --amount 1000 --denom $HERMES_CFG_CHAIN_1_GAS_PRICE_DENOM_SYMBOL
EXIT_CODE=$?
sleep 2s
sleep 2
[ $EXIT_CODE -eq 0 ] || { echo >&2 "ERR: Operation failed (ft-transfer)"; exit 1; }

$BINARY --config $CONFIG_TOML tx packet-recv --dst-chain $HERMES_CFG_CHAIN_2_ID --src-chain $HERMES_CFG_CHAIN_1_ID --src-port transfer --src-channel $CHAN_1_TO_2
sleep 2s
sleep 2
[ $EXIT_CODE -eq 0 ] || { echo >&2 "ERR: Operation failed (packet-recv)"; exit 1; }

echo "- Init for $HERMES_CFG_CHAIN_2_GAS_PRICE_DENOM_SYMBOL on $HERMES_CFG_CHAIN_1_ID"
echo ' + FT-Transfer from '$HERMES_CFG_CHAIN_2_ID' to '$HERMES_CFG_CHAIN_1_ID
$BINARY --config $CONFIG_TOML tx ft-transfer --dst-chain $HERMES_CFG_CHAIN_1_ID --src-chain $HERMES_CFG_CHAIN_2_ID --src-port transfer --src-channel $CHAN_1_TO_2 --timeout-seconds 1000 --amount 1000 --denom $HERMES_CFG_CHAIN_2_GAS_PRICE_DENOM_SYMBOL
EXIT_CODE=$?
sleep 2s
sleep 2
[ $EXIT_CODE -eq 0 ] || { echo >&2 "ERR: Operation failed (ft-transfer)"; exit 1; }

$BINARY --config $CONFIG_TOML tx packet-recv --dst-chain $HERMES_CFG_CHAIN_1_ID --src-chain $HERMES_CFG_CHAIN_2_ID --src-port transfer --src-channel $CHAN_2_TO_1
sleep 2s
sleep 2
[ $EXIT_CODE -eq 0 ] || { echo >&2 "ERR: Operation failed (packet-recv)"; exit 1; }

$BINARY --config $CONFIG_TOML tx packet-ack --dst-chain $HERMES_CFG_CHAIN_2_ID --src-chain $HERMES_CFG_CHAIN_1_ID --src-port transfer --src-channel $CHAN_1_TO_2
sleep 2s
sleep 2
[ $EXIT_CODE -eq 0 ] || { echo >&2 "ERR: Operation failed (packet-ack)"; exit 1; }

$BINARY --config $CONFIG_TOML tx packet-ack --dst-chain $HERMES_CFG_CHAIN_1_ID --src-chain $HERMES_CFG_CHAIN_2_ID --src-port transfer --src-channel $CHAN_2_TO_1
sleep 2s
sleep 2
[ $EXIT_CODE -eq 0 ] || { echo >&2 "ERR: Operation failed (packet-ack)"; exit 1; }

echo 'Information summary'
Expand Down

0 comments on commit 9a32cab

Please sign in to comment.