Make geth sync and gc modes configurable

This commit is contained in:
Prathamesh Musale 2024-09-06 11:40:35 +05:30
parent bd8c533fd7
commit fc85a17912
3 changed files with 14 additions and 4 deletions

View File

@ -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: |

View File

@ -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} \

View File

@ -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=