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

refactor: Docker Entrypoint script #370

Draft
wants to merge 11 commits into
base: develop
Choose a base branch
from
Prev Previous commit
Next Next commit
refactor: changed entrypoint.sh to accept mnemonic as an ENV variable
  • Loading branch information
arnabghose997 authored Aug 7, 2023
commit 21b58977ae15cd7d468ce2965fe0bfce78da4a92
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ RUN apt-get update
RUN apt-get install ${PACKAGES} -y
RUN make install

# Setup the node
RUN bash ./scripts/docker-node/setup.sh

# Expose Ports
EXPOSE 26657 1317 9090 9091 26656

# Entry for containers
ENTRYPOINT [ "hid-noded" ]
ENTRYPOINT [ "./scripts/docker-node/setup.sh" ]
9 changes: 8 additions & 1 deletion scripts/docker-node/setup.sh → scripts/docker-node/entrypoint.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ hid-noded init --chain-id=hidnode node1 --home=/root/.hid-node
hid-noded configure min-gas-prices 0uhid

# Create key for the node
hid-noded keys add node1 --keyring-backend=test --home=/root/.hid-node
if [ -n "$MNEMONIC" ]; then
echo "$MNEMONIC" | hid-noded keys add node1 --keyring-backend=test --recover --home=/root/.hid-node
else
hid-noded keys add node1 --keyring-backend=test --home=/root/.hid-node
fi

# change staking denom to uhid
cat /root/.hid-node/config/genesis.json | jq '.app_state["staking"]["params"]["bond_denom"]="uhid"' > /root/.hid-node/config/tmp_genesis.json && mv /root/.hid-node/config/tmp_genesis.json /root/.hid-node/config/genesis.json
Expand Down Expand Up @@ -61,3 +65,6 @@ sed -i -E 's|tcp://127.0.0.1:26657|tcp://0.0.0.0:26657|g' /root/.hid-node/config
sed -i -E 's|allow_duplicate_ip = false|allow_duplicate_ip = true|g' /root/.hid-node/config/config.toml
sed -i -E 's|addr_book_strict = true|addr_book_strict = false|g' /root/.hid-node/config/config.toml
sed -i -E 's|cors_allowed_origins = \[\]|cors_allowed_origins = \[\"\*\"\]|g' /root/.hid-node/config/config.toml

# Run hid-node
hid-noded start