diff --git a/stack-orchestrator/compose/docker-compose-bsc-node.yml b/stack-orchestrator/compose/docker-compose-bsc-node.yml index da6133b..3a971d6 100644 --- a/stack-orchestrator/compose/docker-compose-bsc-node.yml +++ b/stack-orchestrator/compose/docker-compose-bsc-node.yml @@ -4,6 +4,8 @@ services: restart: unless-stopped environment: CERC_BSC_NETWORK: ${CERC_BSC_NETWORK:-mainnet} + CERC_GETH_GCMODE: ${CERC_GETH_GCMODE:-full} + CERC_GETH_VERBOSITY: ${CERC_GETH_VERBOSITY:-3} volumes: - ../config/docker-entrypoint.sh:/bsc/docker-entrypoint.sh - data:/data diff --git a/stack-orchestrator/config/docker-entrypoint.sh b/stack-orchestrator/config/docker-entrypoint.sh index 4e1a243..c9a000a 100755 --- a/stack-orchestrator/config/docker-entrypoint.sh +++ b/stack-orchestrator/config/docker-entrypoint.sh @@ -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" \ "$@"