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

Commit

Permalink
Alpha 6 docker 1 (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
mask-pp authored Feb 4, 2024
2 parents 5bcfeae + 337bb0a commit 8d83b93
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 44 deletions.
31 changes: 31 additions & 0 deletions internal/docker/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
COMPOSE="docker compose -f $DIR/docker-compose.yml"

# docker compose service list.
DOCKER_INIT_LIST=("create-beacon-chain-genesis" "geth-remove-db" "geth-genesis")
DOCKER_SERVICE_LIST=("beacon-chain" "geth" "validator" "l2_execution_engine")

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

compose_down() {
local services=("$@")
echo
echo "stopping services..."
$COMPOSE down "${services[@]}" #--remove-orphans
echo "done"
}

compose_up() {
local services=("$@")
echo
echo "launching services..."
$COMPOSE up --quiet-pull "${services[@]}" -d --wait
echo "done"
}
8 changes: 2 additions & 6 deletions internal/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,13 @@ services:
container_name: geth
command:
- --http
- --http.api=eth,net,web3
- --http.addr=0.0.0.0
- --http.corsdomain=*
- --http.api
- admin,debug,eth,net,web3,txpool,miner,evm
- --http.api=admin,debug,web3,eth,txpool,personal,miner,net
- --ws
- --ws.api=eth,net,web3
- --ws.addr=0.0.0.0
- --ws.origins=*
- --ws.api
- admin,debug,eth,net,web3,txpool,miner,evm
- --ws.api=admin,debug,web3,eth,txpool,personal,miner,net
- --authrpc.vhosts=*
- --authrpc.addr=0.0.0.0
- --authrpc.jwtsecret=/execution/jwtsecret
Expand Down
6 changes: 3 additions & 3 deletions internal/docker/execution/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
"londonBlock": 0,
"arrowGlacierBlock": 0,
"grayGlacierBlock": 0,
"shanghaiTime": 1706864028,
"cancunTime": 1706864028,
"shanghaiTime": 1707015406,
"cancunTime": 1707015406,
"terminalTotalDifficulty": 0,
"terminalTotalDifficultyPassed": true
},
"nonce": "0x0",
"timestamp": "0x65bcad9c",
"timestamp": "0x65befcee",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000123463a4b065722e99115d6c222f267d9cabb5240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x1c9c380",
"difficulty": "0x1",
Expand Down
6 changes: 3 additions & 3 deletions internal/docker/start.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash
source scripts/common.sh

DOCKER_INIT_LIST=("create-beacon-chain-genesis" "geth-remove-db" "geth-genesis")
DOCKER_SERVICE_LIST=("beacon-chain" "geth" "validator" "l2_execution_engine")
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

source "$DIR"/common.sh

# start docker compose service list
echo "start docker compose service: ${DOCKER_SERVICE_LIST[*]}"
Expand Down
12 changes: 5 additions & 7 deletions internal/docker/stop.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/bin/bash

source scripts/common.sh

DOCKER_INIT_LIST=("create-beacon-chain-genesis" "geth-remove-db" "geth-genesis")
DOCKER_SERVICE_LIST=("beacon-chain" "geth" "validator" "l2_execution_engine")
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$DIR"/common.sh

echo "stop docker compose service: ${DOCKER_INIT_LIST[*]}"
compose_down "${DOCKER_INIT_LIST[@]}"
Expand All @@ -14,6 +12,6 @@ compose_down "${DOCKER_SERVICE_LIST[@]}"
# Delete exited containers.
docker rm $(docker ps -aqf "status=exited") 2>/dev/null

rm -rf ./consensus/beacondata ./consensus/validatordata ./consensus/genesis.ssz
rm -rf ./execution/geth
rm -rf taikogeth/taiko-geth
rm -rf "$DIR"/consensus/beacondata "$DIR"/consensus/validatordata "$DIR"/consensus/genesis.ssz
rm -rf "$DIR"/execution/geth
rm -rf "$DIR"/taikogeth/taiko-geth
1 change: 1 addition & 0 deletions internal/testutils/suite_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package testutils
25 changes: 0 additions & 25 deletions scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
RED='\033[1;31m'
NC='\033[0m' # No Color

COMPOSE="docker compose -f internal/docker/docker-compose.yml"

print_error() {
local msg="$1"
echo -e "${RED}$msg${NC}"
Expand All @@ -19,26 +17,3 @@ check_env() {
exit 1
fi
}

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

compose_down() {
local services=("$@")
echo
echo "stopping services..."
$COMPOSE down "${services[@]}" #--remove-orphans
echo "done"
}

compose_up() {
local services=("$@")
echo
echo "launching services..."
$COMPOSE up --quiet-pull "${services[@]}" -d --wait
echo "done"
}

0 comments on commit 8d83b93

Please sign in to comment.