From 3502901dd8ee691fdfc855803672174639a430ea Mon Sep 17 00:00:00 2001 From: Erik Grinaker Date: Wed, 23 Sep 2020 07:38:07 +0200 Subject: [PATCH] docker: fix incorrect time_iota_ms configuration (#5385) --- CHANGELOG_PENDING.md | 2 ++ DOCKER/docker-entrypoint.sh | 28 +++++++++++++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index f8be7a547..1fe66203b 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -53,3 +53,5 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi - [consensus] \#5329 Fix wrong proposer schedule for validators returned by `InitChain` (@erikgrinaker) - [light] [\#5307](https://github.com/tendermint/tendermint/pull/5307) Persist correct proposer priority in light client validator sets (@cmwaters) + +- [docker] Fix incorrect `time_iota_ms` configuration in default image (@erikgrinaker) diff --git a/DOCKER/docker-entrypoint.sh b/DOCKER/docker-entrypoint.sh index a06912352..0cb45c58a 100755 --- a/DOCKER/docker-entrypoint.sh +++ b/DOCKER/docker-entrypoint.sh @@ -3,19 +3,21 @@ set -e if [ ! -d "$TMHOME/config" ]; then echo "Running tendermint init to create (default) configuration for docker run." - tendermint init && - sed -i \ - -e "s/^proxy_app\s*=.*/proxy_app = \"$PROXY_APP\"/" \ - -e "s/^moniker\s*=.*/moniker = \"$MONIKER\"/" \ - -e 's/^addr_book_strict\s*=.*/addr_book_strict = false/' \ - -e 's/^timeout_commit\s*=.*/timeout_commit = "500ms"/' \ - -e 's/^index_all_tags\s*=.*/index_all_tags = true/' \ - -e 's,^laddr = "tcp://127.0.0.1:26657",laddr = "tcp://0.0.0.0:26657",' \ - -e 's/^prometheus\s*=.*/prometheus = true/' \ - "$TMHOME/config/config.toml" && - sed -i \ - -e "s/^\s*\"chain_id\":.*/ \"chain_id\": \"$CHAIN_ID\",/" \ - "$TMHOME/config/genesis.json" + tendermint init + + sed -i \ + -e "s/^proxy_app\s*=.*/proxy_app = \"$PROXY_APP\"/" \ + -e "s/^moniker\s*=.*/moniker = \"$MONIKER\"/" \ + -e 's/^addr_book_strict\s*=.*/addr_book_strict = false/' \ + -e 's/^timeout_commit\s*=.*/timeout_commit = "500ms"/' \ + -e 's/^index_all_tags\s*=.*/index_all_tags = true/' \ + -e 's,^laddr = "tcp://127.0.0.1:26657",laddr = "tcp://0.0.0.0:26657",' \ + -e 's/^prometheus\s*=.*/prometheus = true/' \ + "$TMHOME/config/config.toml" + + jq ".chain_id = \"$CHAIN_ID\" | .consensus_params.block.time_iota_ms = \"500\"" \ + "$TMHOME/config/genesis.json" > "$TMHOME/config/genesis.json.new" + mv "$TMHOME/config/genesis.json.new" "$TMHOME/config/genesis.json" fi exec tendermint "$@"