From 084391000c4a87547702767a0b89ce8a815a157f Mon Sep 17 00:00:00 2001 From: Bui Quang Minh Date: Wed, 13 Dec 2023 16:10:03 +0700 Subject: [PATCH] entrypoint: add DB_ENGINE environment variable --- docker/chainnode/entrypoint.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docker/chainnode/entrypoint.sh b/docker/chainnode/entrypoint.sh index 2a3faa8e83..fcb3cd3813 100755 --- a/docker/chainnode/entrypoint.sh +++ b/docker/chainnode/entrypoint.sh @@ -53,16 +53,21 @@ if [[ ! -z $GENESIS_PATH ]]; then genesisPath="$GENESIS_PATH" fi +if [[ "$DB_ENGINE" != "" ]]; then + dbEngine="--db.engine $DB_ENGINE" + params="$params $dbEngine" +fi + # data dir if [[ ! -d $datadir/ronin ]]; then echo "No blockchain data, creating genesis block." - ronin init $genesisPath --datadir $datadir 2> /dev/null + ronin init $dbEngine --datadir $datadir $genesisPath 2> /dev/null elif [[ "$FORCE_INIT" = "true" && "$INIT_FORCE_OVERRIDE_CHAIN_CONFIG" = "true" ]]; then echo "Forcing update chain config with force overriding chain config." - ronin init $genesisPath --overrideChainConfig --datadir $datadir 2> /dev/null + ronin init $dbEngine --overrideChainConfig --datadir $datadir $genesisPath 2> /dev/null elif [ "$FORCE_INIT" = "true" ]; then echo "Forcing update chain config." - ronin init $genesisPath --datadir $datadir 2> /dev/null + ronin init $dbEngine --datadir $datadir $genesisPath 2> /dev/null fi # password file