Skip to content

Commit

Permalink
chore: alias agd to ag0
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Dec 5, 2023
1 parent a6c5fdc commit 37382b6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
# The .ts scripts depend upon this
- run: tsx --version || npm install --global tsx

- name: build test images ${{ matrix.platform }} == ${{ env.DEFAULT_PLATFORM }}
- name: build test images if ${{ matrix.platform }} == ${{ env.DEFAULT_PLATFORM }}
run: |
docker info
./buildTestImages.ts ${{ matrix.platform == env.DEFAULT_PLATFORM && ' ' || '--dry' }}
Expand Down
27 changes: 16 additions & 11 deletions upgrade-test-scripts/start_ag0.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#!/bin/bash

# The name of the binary is an implementation detail.
agd () {
ag0 ${1+"$@"}
}

export CHAINID=agoriclocal
ag0 init localnet --chain-id "$CHAINID"
agd init localnet --chain-id "$CHAINID"

allaccounts=("gov1" "gov2" "gov3" "user1" "validator")
for i in "${allaccounts[@]}"; do
ag0 keys add $i --keyring-backend=test 2>&1 | tee "$HOME/.agoric/$i.out"
agd keys add $i --keyring-backend=test 2>&1 | tee "$HOME/.agoric/$i.out"
cat "$HOME/.agoric/$i.out" | tail -n1 | tee "$HOME/.agoric/$i.key"
done

Expand All @@ -24,7 +29,7 @@ contents="$(jq ".app_state.gov.deposit_params.min_deposit[0].denom = \"ubld\"" "
contents="$(jq ".app_state.staking.params.bond_denom = \"ubld\"" "$HOME/.agoric/config/genesis.json")" && echo -E "${contents}" >"$HOME/.agoric/config/genesis.json"
contents="$(jq ".app_state.slashing.params.signed_blocks_window = \"20000\"" "$HOME/.agoric/config/genesis.json")" && echo -E "${contents}" >"$HOME/.agoric/config/genesis.json"
contents=$(jq '. * { app_state: { gov: { voting_params: { voting_period: "10s" } } } }' "$HOME/.agoric/config/genesis.json") && echo -E "${contents}" >"$HOME/.agoric/config/genesis.json"
export GENACCT=$(ag0 keys show validator -a --keyring-backend="test")
export GENACCT=$(agd keys show validator -a --keyring-backend="test")
echo "Genesis Account $GENACCT"

denoms=(
Expand All @@ -46,12 +51,12 @@ for i in "${denoms[@]}"; do
coins="${coins},${camount}${i}"
done

ag0 add-genesis-account "$GENACCT" "$coins"
agd add-genesis-account "$GENACCT" "$coins"

ag0 gentx validator 5000000000ubld --keyring-backend="test" --chain-id "$CHAINID"
ag0 collect-gentxs
ag0 start --log_level warn &
ag0_PID=$!
agd gentx validator 5000000000ubld --keyring-backend="test" --chain-id "$CHAINID"
agd collect-gentxs
agd start --log_level warn &
agd_PID=$!
wait_for_bootstrap
waitForBlock 2

Expand All @@ -67,7 +72,7 @@ else
echo "Upgrade info is not valid JSON: $info"
exit $status
fi
ag0 tx gov submit-proposal software-upgrade "$UPGRADE_TO" \
agd tx gov submit-proposal software-upgrade "$UPGRADE_TO" \
--upgrade-height="$height" --upgrade-info="$info" \
--title="Upgrade to ${UPGRADE_TO}" --description="upgrades" \
--from=validator --chain-id="$CHAINID" \
Expand All @@ -79,7 +84,7 @@ voteLatestProposalAndWait
echo "Chain in to-be-upgraded state for $UPGRADE_TO"

while true; do
latest_height=$(ag0 status | jq -r .SyncInfo.latest_block_height)
latest_height=$(agd status | jq -r .SyncInfo.latest_block_height)
if [ "$latest_height" -ge "$height" ]; then
echo "Upgrade height for $UPGRADE_TO reached. Killing agd"
echo "(CONSENSUS FAILURE above for height $height is expected)"
Expand All @@ -90,5 +95,5 @@ while true; do
fi
done

kill $ag0_PID
kill $agd_PID
echo "state directory $HOME/.agoric ready for upgrade to $UPGRADE_TO"

0 comments on commit 37382b6

Please sign in to comment.