From 9647ad479856d963a4db48fc9af245fcfe2e311a Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Wed, 21 Feb 2024 08:52:24 +0100 Subject: [PATCH] feat(Docker): env var ABCI changes abci option in config.toml --- DOCKER/Dockerfile | 1 + DOCKER/docker-entrypoint.sh | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/DOCKER/Dockerfile b/DOCKER/Dockerfile index 878a8b8f4e..a4bf8702f7 100644 --- a/DOCKER/Dockerfile +++ b/DOCKER/Dockerfile @@ -94,6 +94,7 @@ COPY --from=compile /src/tenderdash/build/tenderdash /src/tenderdash/build/abcid # config.json and genesis.json. Additionally, you can override # CMD to add parameters to `tenderdash node`. ENV PROXY_APP=kvstore MONIKER=dockernode CHAIN_ID=dockerchain +ENV ABCI COPY ./DOCKER/docker-entrypoint.sh /usr/local/bin/ diff --git a/DOCKER/docker-entrypoint.sh b/DOCKER/docker-entrypoint.sh index bd080c46f5..0863cfd022 100755 --- a/DOCKER/docker-entrypoint.sh +++ b/DOCKER/docker-entrypoint.sh @@ -15,8 +15,14 @@ if [ ! -d "$TMHOME/config" ]; then -e 's/^prometheus\s*=.*/prometheus = true/' \ "$TMHOME/config/config.toml" + if [ -n "$ABCI" ]; then + sed -i \ + -e "s/^abci\s*=.*/abci = \"$ABCI\"/" \ + "$TMHOME/config/config.toml" + fi + jq ".chain_id = \"$CHAIN_ID\" | .consensus_params.block.time_iota_ms = \"500\"" \ - "$TMHOME/config/genesis.json" > "$TMHOME/config/genesis.json.new" + "$TMHOME/config/genesis.json" >"$TMHOME/config/genesis.json.new" mv "$TMHOME/config/genesis.json.new" "$TMHOME/config/genesis.json" fi