Add support for archive node

This commit is contained in:
2024-06-04 14:37:34 +05:30
parent 372cace05f
commit a2abcff2a7
2 changed files with 13 additions and 1 deletions
+11 -1
View File
@@ -19,8 +19,14 @@ fi
# Init genesis state if geth sub dir does not exist
GETH_DIR=${DATA_DIR}/geth
if [ ! -d "$GETH_DIR" ]; then
STATE_SCHEME_OPTS=""
if [ "$CERC_GETH_GCMODE" = "archive" ]; then
# Archive mode only works with state.scheme set to hash
STATE_SCHEME_OPTS="--state.scheme=hash"
fi
echo Initializing geth...
geth --datadir ${DATA_DIR} init ${BSC_GENESIS}
geth --datadir ${DATA_DIR} ${STATE_SCHEME_OPTS} init ${BSC_GENESIS}
echo Initialization done
fi
@@ -37,4 +43,8 @@ exec "geth" \
--ws.addr="0.0.0.0" \
--ws.port 8546 \
--ws.origins="*" \
--gcmode=${CERC_GETH_GCMODE} \
--verbosity=${CERC_GETH_VERBOSITY} \
--metrics \
--metrics.addr="0.0.0.0" \
"$@"