From 2f528b59ea68931ca56e094b88deb910e5f9e6da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Mart=C3=ADnez=20Rodr=C3=ADguez?= <43847309+GabrielMartinezRodriguez@users.noreply.github.com> Date: Mon, 25 Sep 2023 12:14:48 +0200 Subject: [PATCH] Chore configurable launch mmode (#122) --- docker/client/entrypoint.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docker/client/entrypoint.sh b/docker/client/entrypoint.sh index b08fd15e..65debac1 100644 --- a/docker/client/entrypoint.sh +++ b/docker/client/entrypoint.sh @@ -11,7 +11,12 @@ fi if [[ "$CHAIN_TARGET" == "dev" ]]; then echo "Starting dev chain" - ./target/release/stability --base-path /tmp/node --dev --unsafe-rpc-external --rpc-cors all --unsafe-ws-external --pruning archive --prometheus-external + START_COMMAND_DEV="./target/release/stability --base-path /tmp/node --dev --unsafe-rpc-external --rpc-cors all --unsafe-ws-external --prometheus-external" + + if [ "$MODE" = "archive" ]; then + START_COMMAND_DEV="$START_COMMAND_DEV --pruning archive" + fi + eval $START_COMMAND_DEV exit 0 fi @@ -31,7 +36,11 @@ if [ -n "$SEED" ]; then --key-type gran fi -START_COMMAND="./target/release/stability --base-path /tmp/node --validator --unsafe-rpc-external --rpc-cors all --unsafe-ws-external --pruning archive --prometheus-external --chain=$CHAIN_TARGET" +START_COMMAND="./target/release/stability --base-path /tmp/node --validator --unsafe-rpc-external --rpc-cors all --unsafe-ws-external --prometheus-external --chain=$CHAIN_TARGET" + +if [ "$MODE" = "archive" ]; then + START_COMMAND="$START_COMMAND --pruning archive" +fi if [ -n "$NODE_KEY" ]; then START_COMMAND="$START_COMMAND --node-key $NODE_KEY"