Skip to content

Commit

Permalink
fix: Use correct REGEN_HOME env in regen sandbox (#1789)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
  • Loading branch information
paul121 and ryanchristo authored Feb 21, 2023
1 parent b4fc7fb commit 489200c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
3 changes: 1 addition & 2 deletions images/regen-sandbox/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ COPY --from=build /work/build/regen /usr/bin/
WORKDIR /regen
EXPOSE 26656 26657 9090 1317

ENV BINARY /usr/bin/regen
ENV REGENHOME /regen/.regen
ENV REGEN_HOME /regen/.regen

ENTRYPOINT ["/usr/bin/bootstrap.sh"]
STOPSIGNAL SIGTERM
26 changes: 11 additions & 15 deletions images/regen-sandbox/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ set -eo pipefail

REGEN_CHAIN_ID="regen-sandbox"

regen() {
$BINARY --home $REGENHOME "$@"
}

# parse flags
POSITIONAL_ARGS=()
while [[ $# -gt 0 ]]; do
Expand All @@ -30,10 +26,10 @@ done
set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters


if [ -d "$REGENHOME" ] && [ "$OVERWRITE_HOMEDIR" != true ]; then
echo "Regen home ($REGENHOME) already exists, skipping bootstrap..."
if [ -d "$REGEN_HOME" ] && [ "$OVERWRITE_HOMEDIR" != true ]; then
echo "Regen home ($REGEN_HOME) already exists, skipping bootstrap..."
else
rm -rf $REGENHOME
rm -rf $REGEN_HOME
regen config keyring-backend test
regen config node http://localhost:26657
regen config chain-id $REGEN_CHAIN_ID
Expand All @@ -46,22 +42,22 @@ else
# modify genesis file and config files (platform dependent usage of sed)
if [[ $(uname -s) == 'Darwin' ]]; then
# change stake denom to uregen
sed -i "" "s/stake/uregen/g" $REGENHOME/config/genesis.json
sed -i "" "s/stake/uregen/g" $REGEN_HOME/config/genesis.json
# set min gas price
sed -i "" "s/minimum-gas-prices = \"\"/minimum-gas-prices = \"0.025uregen\"/g" $REGENHOME/config/app.toml
sed -i "" "s/minimum-gas-prices = \"\"/minimum-gas-prices = \"0.025uregen\"/g" $REGEN_HOME/config/app.toml
# decrease block-time so tests run faster
sed -i "" "s/timeout_commit = \"5s\"/timeout_commit = \"500ms\"/g" $REGENHOME/config/config.toml
sed -i "" "s/timeout_commit = \"5s\"/timeout_commit = \"500ms\"/g" $REGEN_HOME/config/config.toml
# bind on all interfaces, enabling ports to be exposed outside docker
sed -i "" "s/127\.0\.0\.1/0.0.0.0/g" $REGENHOME/config/config.toml
sed -i "" "s/127\.0\.0\.1/0.0.0.0/g" $REGEN_HOME/config/config.toml
else
# change stake denom to uregen
sed -i "s/stake/uregen/g" $REGENHOME/config/genesis.json
sed -i "s/stake/uregen/g" $REGEN_HOME/config/genesis.json
# set min gas price
sed -i "s/minimum-gas-prices = \"\"/minimum-gas-prices = \"0.025uregen\"/g" $REGENHOME/config/app.toml
sed -i "s/minimum-gas-prices = \"\"/minimum-gas-prices = \"0.025uregen\"/g" $REGEN_HOME/config/app.toml
# decrease block-time so tests run faster
sed -i "s/timeout_commit = \"5s\"/timeout_commit = \"500ms\"/g" $REGENHOME/config/config.toml
sed -i "s/timeout_commit = \"5s\"/timeout_commit = \"500ms\"/g" $REGEN_HOME/config/config.toml
# bind on all interfaces, enabling ports to be exposed outside docker
sed -i "s/127\.0\.0\.1/0.0.0.0/g" $REGENHOME/config/config.toml
sed -i "s/127\.0\.0\.1/0.0.0.0/g" $REGEN_HOME/config/config.toml
fi

# app specific genesis file modifications
Expand Down
4 changes: 0 additions & 4 deletions images/regen-sandbox/setup/utils.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
regen() {
$BINARY --home $REGENHOME "$@"
}

log_response() {
jq -r "if .code == 0 then \"INFO: TxHash: \(.txhash)\" else \"ERROR: (code \(.code)) \(.raw_log)\" end"
}
Expand Down

0 comments on commit 489200c

Please sign in to comment.