Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use correct REGEN_HOME env in regen sandbox #1789

Merged
merged 4 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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