forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from flashbots/pbs-docker
Update docker build for op-geth
- Loading branch information
Showing
6 changed files
with
76 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM jinmel/builder:latest | ||
|
||
RUN apk add --no-cache jq | ||
|
||
COPY entrypoint-builder.sh /entrypoint.sh | ||
|
||
VOLUME ["/db"] | ||
|
||
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] |
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
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,55 @@ | ||
#!/bin/sh | ||
set -exu | ||
|
||
VERBOSITY=${GETH_VERBOSITY:-3} | ||
GETH_DATA_DIR=/db | ||
GETH_CHAINDATA_DIR="$GETH_DATA_DIR/geth/chaindata" | ||
GENESIS_FILE_PATH="${GENESIS_FILE_PATH:-/genesis.json}" | ||
CHAIN_ID=$(cat "$GENESIS_FILE_PATH" | jq -r .config.chainId) | ||
RPC_PORT="${RPC_PORT:-8545}" | ||
WS_PORT="${WS_PORT:-8546}" | ||
AUTH_RPC_PORT="${AUTH_RPC_PORT:-8551}" | ||
METRICS_PORT="${METRICS_PORT:-6060}" | ||
P2P_PORT="${P2P_PORT:-30303}" | ||
|
||
if [ ! -d "$GETH_CHAINDATA_DIR" ]; then | ||
echo "$GETH_CHAINDATA_DIR missing, running init" | ||
echo "Initializing genesis." | ||
geth --verbosity="$VERBOSITY" init \ | ||
--datadir="$GETH_DATA_DIR" \ | ||
--state.scheme=hash \ | ||
"$GENESIS_FILE_PATH" | ||
else | ||
echo "$GETH_CHAINDATA_DIR exists." | ||
fi | ||
|
||
# Warning: Archive mode is required, otherwise old trie nodes will be | ||
# pruned within minutes of starting the devnet. | ||
|
||
exec geth \ | ||
--datadir="$GETH_DATA_DIR" \ | ||
--verbosity="$VERBOSITY" \ | ||
--port="$P2P_PORT" \ | ||
--http \ | ||
--http.corsdomain="*" \ | ||
--http.vhosts="*" \ | ||
--http.addr=0.0.0.0 \ | ||
--http.port="$RPC_PORT" \ | ||
--http.api=web3,debug,eth,txpool,net,engine,admin \ | ||
--ws \ | ||
--ws.addr=0.0.0.0 \ | ||
--ws.port="$WS_PORT" \ | ||
--ws.origins="*" \ | ||
--ws.api=debug,eth,txpool,net,engine \ | ||
--syncmode=full \ | ||
--networkid=$CHAIN_ID \ | ||
--rpc.allow-unprotected-txs \ | ||
--authrpc.addr=0.0.0.0 \ | ||
--authrpc.port="$AUTH_RPC_PORT" \ | ||
--authrpc.vhosts="*" \ | ||
--authrpc.jwtsecret=/config/jwt-secret.txt \ | ||
--gcmode=archive \ | ||
--metrics \ | ||
--metrics.addr=0.0.0.0 \ | ||
--metrics.port="$METRICS_PORT" \ | ||
"$@" |
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