Skip to content

Commit

Permalink
fix: kill ag0 if already running
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Mar 8, 2024
1 parent ef32c1d commit a9f68bc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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=$!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a9f68bc

Please sign in to comment.