Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
feat(client): upgrade shell scripts and replace docker image links (#495
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mask-pp committed Jan 10, 2024
1 parent d5b798d commit 8f0b4c8
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 26 deletions.
18 changes: 10 additions & 8 deletions integration_test/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ DIR=$(
pwd
)

if ! command -v docker &>/dev/null 2>&1; then
echo "ERROR: docker command not found"
exit 1
fi
# load tool commands.
source "./scripts/common.sh"

if ! docker info >/dev/null 2>&1; then
echo "ERROR: docker daemon isn't running"
exit 1
fi
# make sure all the commands are available.
check_command "solc"
check_command "cast"
check_command "forge"
check_command "docker"

# make sure environment variables are set
check_env "TAIKO_MONO_DIR"

TESTNET_CONFIG=$DIR/nodes/docker-compose.yml

Expand Down
14 changes: 7 additions & 7 deletions integration_test/nodes/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ version: "3.9"

services:
l1_node:
image: ghcr.io/foundry-rs/foundry:latest
image: ghcr.dockerproxy.com/foundry-rs/foundry:latest
restart: unless-stopped
pull_policy: always
ports:
- 18545:8545
- 18546:8545
- "18545:8545"
- "18546:8545"
entrypoint:
- anvil
- --host
- "0.0.0.0"

l2_execution_engine:
image: gcr.io/evmchain/taiko-geth:taiko
image: gcr.dockerproxy.com/evmchain/taiko-geth:taiko
restart: unless-stopped
pull_policy: always
volumes:
- .:/host
ports:
- 28545:8545
- 28546:8546
- 28551:8551
- "28545:8545"
- "28546:8546"
- "28551:8551"
command:
- --nodiscover
- --gcmode
Expand Down
12 changes: 1 addition & 11 deletions integration_test/nodes/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ DIR=$(
pwd
)

# Download solc for PlonkVerifier
$TAIKO_MONO_DIR/packages/protocol/script/download_solc.sh

echo "Starting testnet..."

docker compose -f $TESTNET_CONFIG down -v --remove-orphans &>/dev/null
Expand All @@ -21,14 +18,7 @@ NODE_URL=localhost:18545 $DIR/../util/wait_for_node.sh
NODE_URL=localhost:28545 $DIR/../util/wait_for_node.sh

# Get the hash of L2 genesis.
L2_GENESIS_HASH=$(
curl \
--silent \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":0,"method":"eth_getBlockByNumber","params":["0x0", false]}' \
localhost:28545 | jq .result.hash | sed 's/\"//g'
)
L2_GENESIS_HASH=$(cast block --rpc-url localhost:28545 0x0 -f hash)

GUARDIAN_PROVERS_ADDRESSES_LIST=(
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
Expand Down
27 changes: 27 additions & 0 deletions scripts/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

RED='\033[1;31m'
NC='\033[0m' # No Color

print_error() {
local msg="$1"
echo -e "${RED}$msg${NC}"
}

check_env() {
local name="$1"
local value="${!name}"

if [ -z "$value" ]; then
print_error "$name not set in env"
exit 1
fi
}

check_command() {
if ! command -v "$1" &> /dev/null; then
print_error "$1 could not be found"
exit
fi
}

0 comments on commit 8f0b4c8

Please sign in to comment.