From b497411dbb6787d4778f0c44144544eb54a04710 Mon Sep 17 00:00:00 2001 From: Michael de Hoog Date: Tue, 7 Nov 2023 07:58:26 -1000 Subject: [PATCH] Support for reducing disk space requirements (#146) * Update disk space requirements in README (fixes #133) * Add support for overriding the --state.scheme and --gcmode arguments * Fix missing quote --- README.md | 2 +- geth-entrypoint | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index efd2fc2a..f9497bd7 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ This repository contains the relevant Docker builds to run your own node on the We recommend you have this configuration to run a node: - at least 16 GB RAM -- an SSD drive with at least 1 TB free +- an SSD drive with at least 2 TB free ### Troubleshooting diff --git a/geth-entrypoint b/geth-entrypoint index da2815ba..4bed268e 100755 --- a/geth-entrypoint +++ b/geth-entrypoint @@ -10,6 +10,7 @@ METRICS_PORT="${METRICS_PORT:-6060}" HOST_IP="0.0.0.0" P2P_PORT="${P2P_PORT:-30303}" ADDITIONAL_ARGS="" +OP_GETH_GCMODE="${OP_GETH_GCMODE:-archive}" if [[ -z "$OP_NODE_NETWORK" ]]; then echo "expected OP_NODE_NETWORK to be set" 1>&2 @@ -28,6 +29,10 @@ if [ "${OP_GETH_ALLOW_UNPROTECTED_TXS+x}" = x ]; then ADDITIONAL_ARGS="$ADDITIONAL_ARGS --rpc.allow-unprotected-txs=$OP_GETH_ALLOW_UNPROTECTED_TXS" fi +if [ "${OP_GETH_STATE_SCHEME+x}" = x ]; then + ADDITIONAL_ARGS="$ADDITIONAL_ARGS --state.scheme=$OP_GETH_STATE_SCHEME" +fi + exec ./geth \ --datadir="$GETH_DATA_DIR" \ --verbosity="$VERBOSITY" \ @@ -50,12 +55,12 @@ exec ./geth \ --metrics.addr=0.0.0.0 \ --metrics.port="$METRICS_PORT" \ --syncmode=full \ - --gcmode=archive \ + --gcmode="$OP_GETH_GCMODE" \ --nodiscover \ --maxpeers=100 \ --nat=extip:$HOST_IP \ --rollup.sequencerhttp="$OP_GETH_SEQUENCER_HTTP" \ --rollup.halt=major \ - --op-network=$OP_NODE_NETWORK" \ + --op-network="$OP_NODE_NETWORK" \ --port="$P2P_PORT" \ $ADDITIONAL_ARGS # intentionally unquoted