diff --git a/packages/synthetic-chain/public/upgrade-test-scripts/env_setup.sh b/packages/synthetic-chain/public/upgrade-test-scripts/env_setup.sh index 25f74614..98f2cd93 100755 --- a/packages/synthetic-chain/public/upgrade-test-scripts/env_setup.sh +++ b/packages/synthetic-chain/public/upgrade-test-scripts/env_setup.sh @@ -63,9 +63,11 @@ fi startAgd() { echo "startAgd()" - # XXX debugging https://github.com/Agoric/agoric-3-proposals/issues/93 - apt install net-tools - netstat + # precondition check + if agd status >/dev/null 2>&1; then + echo "Cannot start agd because it's already running" + exit 1 + fi agd start --log_level warn "$@" & AGD_PID=$! diff --git a/packages/synthetic-chain/public/upgrade-test-scripts/run_prepare_zero.sh b/packages/synthetic-chain/public/upgrade-test-scripts/run_prepare_zero.sh index 72403797..c21d1015 100755 --- a/packages/synthetic-chain/public/upgrade-test-scripts/run_prepare_zero.sh +++ b/packages/synthetic-chain/public/upgrade-test-scripts/run_prepare_zero.sh @@ -59,6 +59,15 @@ agd add-genesis-account "$GENACCT" "$coins" agd gentx validator 5000000000ubld --keyring-backend="test" --chain-id "$CHAINID" agd collect-gentxs + +# XXX why is it sometimes already running? +if agd status >/dev/null 2>&1; then + echo "agd already running; attempting to kill" + ps -aux + pgrep ag0 >$HOME/.agoric/agd.pid + killAgd +fi + startAgd voting_period_s=10