fix: Update docker-compose.yaml to use shell directly for sonrd command

This commit is contained in:
Prad Nukala 2024-08-29 14:12:00 -04:00
parent c74c6b1084
commit 8edb78f514

View File

@ -25,21 +25,21 @@ services:
- CLEAN=true
- BLOCK_TIME=5s
command: >
/bin/sh -c "
/bin/sh -c '
if [ ! -d /root/.core/config ]; then
/usr/bin/sonrd init $${MONIKER} --chain-id $${CHAIN_ID} --default-denom $${DENOM} &&
sed -i 's/laddr = \"tcp:\\/\\/127.0.0.1:26657\"/laddr = \"tcp:\\/\\/0.0.0.0:26657\"/g' /root/.core/config/config.toml &&
sed -i 's/cors_allowed_origins = \\[\\]/cors_allowed_origins = [\"*\"]/g' /root/.core/config/config.toml &&
sed -i 's/address = \"tcp:\\/\\/localhost:1317\"/address = \"tcp:\\/\\/0.0.0.0:1317\"/g' /root/.core/config/app.toml &&
sed -i 's/enable = false/enable = true/g' /root/.core/config/app.toml &&
sed -i 's/address = \"localhost:9090\"/address = \"0.0.0.0:9090\"/g' /root/.core/config/app.toml &&
sed -i 's/address = \"localhost:9091\"/address = \"0.0.0.0:9091\"/g' /root/.core/config/app.toml &&
sed -i 's/address = \":8080\"/address = \"0.0.0.0:8080\"/g' /root/.core/config/app.toml &&
sed -i 's/timeout_commit = \"5s\"/timeout_commit = \"$${BLOCK_TIME}\"/g' /root/.core/config/config.toml &&
sed -i "s/laddr = \"tcp:\\/\\/127.0.0.1:26657\"/laddr = \"tcp:\\/\\/0.0.0.0:26657\"/g" /root/.core/config/config.toml &&
sed -i "s/cors_allowed_origins = \\[\\]/cors_allowed_origins = [\"*\"]/g" /root/.core/config/config.toml &&
sed -i "s/address = \"tcp:\\/\\/localhost:1317\"/address = \"tcp:\\/\\/0.0.0.0:1317\"/g" /root/.core/config/app.toml &&
sed -i "s/enable = false/enable = true/g" /root/.core/config/app.toml &&
sed -i "s/address = \"localhost:9090\"/address = \"0.0.0.0:9090\"/g" /root/.core/config/app.toml &&
sed -i "s/address = \"localhost:9091\"/address = \"0.0.0.0:9091\"/g" /root/.core/config/app.toml &&
sed -i "s/address = \":8080\"/address = \"0.0.0.0:8080\"/g" /root/.core/config/app.toml &&
sed -i "s/timeout_commit = \"5s\"/timeout_commit = \"$${BLOCK_TIME}\"/g" /root/.core/config/config.toml &&
/usr/bin/sonrd genesis add-genesis-account $${KEY} 10000000$${DENOM},900test --keyring-backend $${KEYRING} &&
/usr/bin/sonrd genesis add-genesis-account $${KEY2} 10000000$${DENOM},800test --keyring-backend $${KEYRING} &&
/usr/bin/sonrd genesis gentx $${KEY} 1000000$${DENOM} --keyring-backend $${KEYRING} --chain-id $${CHAIN_ID} &&
/usr/bin/sonrd genesis collect-gentxs
fi &&
/usr/bin/sonrd start --pruning=nothing --minimum-gas-prices=0$${DENOM}"
/usr/bin/sonrd start --pruning=nothing --minimum-gas-prices=0$${DENOM}'
restart: always