diff --git a/.env b/.env index 0b8de5d..7caf6a7 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -CLIENT=${CLIENT:-reth} -DATA_DIR=./${CLIENT}_data +CLIENT=reth +DATA_DIR=./reth_data diff --git a/docker-compose.yaml b/docker-compose.yaml index 73d40bb..000242b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,7 +3,7 @@ services: container_name: giwa-jwt-generator image: alpine/openssl entrypoint: > - /bin/sh -c "[ ! -f /shared/jwtsecret.key ] && openssl rand -hex 32 | tr -d '\n' > /shared/jwtsecret.key || exit 0" + /bin/sh -c "[ ! -s /shared/jwtsecret.key ] && openssl rand -hex 32 | tr -d '\n' > /shared/jwtsecret.key || exit 0" volumes: - shared:/shared restart: "no" @@ -14,7 +14,7 @@ services: condition: service_completed_successfully build: context: . - dockerfile: ${CLIENT}/Dockerfile + dockerfile: ${CLIENT:-reth}/Dockerfile args: RETH_VERSION: v1.11.0 OPGETH_VERSION: v1.101609.1 @@ -28,7 +28,7 @@ services: - "30303:30303/udp" volumes: - shared:/shared - - ${DATA_DIR}:/app/data + - ${DATA_DIR:-./reth_data}:/app/data consensus: container_name: giwa-cl depends_on: @@ -44,7 +44,7 @@ services: env_file: - ${NETWORK_ENV:-.env.sepolia} environment: - OP_NODE_L2_ENGINE_KIND: ${CLIENT} + OP_NODE_L2_ENGINE_KIND: ${CLIENT:-reth} ports: - "9545:9545" - "9222:9222" diff --git a/geth/entrypoint.sh b/geth/entrypoint.sh index cc3d0d6..81c13ad 100644 --- a/geth/entrypoint.sh +++ b/geth/entrypoint.sh @@ -1,8 +1,10 @@ #!/bin/bash set -euxo pipefail -if [ -n "${GENESIS_FILE-}" ]; then - geth init "${GENESIS_FILE}" +DATA_DIR="${GETH_DATADIR:-/app/data}" + +if [ -n "${GENESIS_FILE-}" ] && [ ! -d "${DATA_DIR}/geth/chaindata" ]; then + geth init --datadir="${DATA_DIR}" "${GENESIS_FILE}" fi exec geth "$@" diff --git a/reth/entrypoint.sh b/reth/entrypoint.sh index 3bf9288..91f0701 100644 --- a/reth/entrypoint.sh +++ b/reth/entrypoint.sh @@ -13,6 +13,10 @@ ROLLUP_SEQUENCER_HTTP="${GETH_ROLLUP_SEQUENCERHTTP}" PRUNING_MODE="${GETH_GCMODE}" JWT_SECRET="${GETH_AUTHRPC_JWTSECRET}" BOOTNODES="${GETH_BOOTNODES}" +MAX_PEERS="${GETH_MAXPEERS:-100}" + +# op-reth does not support --rollup.halt (op-geth reads GETH_ROLLUP_HALT from env). +# Protocol-version halt is enforced by op-node via OP_NODE_ROLLUP_HALT. ADDITIONAL_ARGS="" if [[ "$PRUNING_MODE" == "full" ]]; then @@ -42,7 +46,7 @@ exec op-reth node \ --authrpc.port="$AUTHRPC_PORT" \ --authrpc.jwtsecret="$JWT_SECRET" \ --metrics=0.0.0.0:"$METRICS_PORT" \ - --max-outbound-peers=100 \ + --max-outbound-peers="$MAX_PEERS" \ --chain="$GENESIS_FILE" \ --rollup.sequencer-http="$ROLLUP_SEQUENCER_HTTP" \ --rollup.disable-tx-pool-gossip \