From fc85a179123aecaa9de729071d46b1c306e2c30a Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 6 Sep 2024 11:40:35 +0530 Subject: [PATCH] Make geth sync and gc modes configurable --- stack-orchestrator/compose/docker-compose-eth.yml | 2 ++ stack-orchestrator/config/eth/run-el.sh | 10 ++++++---- stack-orchestrator/stacks/eth/README.md | 6 ++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/stack-orchestrator/compose/docker-compose-eth.yml b/stack-orchestrator/compose/docker-compose-eth.yml index f4744fa..3237377 100644 --- a/stack-orchestrator/compose/docker-compose-eth.yml +++ b/stack-orchestrator/compose/docker-compose-eth.yml @@ -8,6 +8,8 @@ services: ETH_DATADIR: "/root/.ethereum" CERC_NETWORK: ${CERC_NETWORK:-sepolia} CERC_ALLOW_UNPROTECTED_TXS: ${CERC_ALLOW_UNPROTECTED_TXS:-false} + CERC_SYNCMODE: ${CERC_SYNCMODE:-full} + CERC_GCMODE: ${CERC_GCMODE:-archive} CERC_GETH_VERBOSITY: ${CERC_GETH_VERBOSITY:-3} entrypoint: ["sh", "-c"] command: | diff --git a/stack-orchestrator/config/eth/run-el.sh b/stack-orchestrator/config/eth/run-el.sh index bcd030b..efa2f60 100755 --- a/stack-orchestrator/config/eth/run-el.sh +++ b/stack-orchestrator/config/eth/run-el.sh @@ -8,6 +8,8 @@ fi echo "Using the following env:" echo "CERC_NETWORK: ${CERC_NETWORK}" echo "CERC_ALLOW_UNPROTECTED_TXS: ${CERC_ALLOW_UNPROTECTED_TXS}" +echo "CERC_SYNCMODE: ${CERC_SYNCMODE}" +echo "CERC_GCMODE: ${CERC_GCMODE}" echo "CERC_GETH_VERBOSITY: ${CERC_GETH_VERBOSITY}" echo "ETH_DATADIR: ${ETH_DATADIR}" @@ -57,15 +59,15 @@ geth \ --http \ --http.addr="0.0.0.0" \ --http.vhosts="*" \ - --http.api="${CERC_GETH_HTTP_APIS:-eth,web3,net,admin,personal,debug}" \ + --http.api="eth,web3,net,admin,personal,debug" \ --http.corsdomain="*" \ --ws \ --ws.addr="0.0.0.0" \ --ws.origins="*" \ - --ws.api="${CERC_GETH_WS_APIS:-eth,web3,net,admin,personal,debug}" \ + --ws.api="eth,web3,net,admin,personal,debug" \ --state.scheme hash \ - --gcmode archive \ - --syncmode=full \ + --gcmode $CERC_GCMODE \ + --syncmode=$CERC_SYNCMODE \ --metrics \ --metrics.addr="0.0.0.0" \ --verbosity=${CERC_GETH_VERBOSITY} \ diff --git a/stack-orchestrator/stacks/eth/README.md b/stack-orchestrator/stacks/eth/README.md index 874308f..28f789b 100644 --- a/stack-orchestrator/stacks/eth/README.md +++ b/stack-orchestrator/stacks/eth/README.md @@ -54,6 +54,12 @@ # Allow unprotected txs (default: false) CERC_ALLOW_UNPROTECTED_TXS= + # Blockchain sync mode (default: full) + CERC_SYNCMODE= + + # Garbage collection mode (default: archive) + CERC_GCMODE= + # Verbosity level (default: info) CERC_GETH_VERBOSITY=