From 37382b6c8e058655ebe4284fdc17ce769e844f56 Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Thu, 30 Nov 2023 12:36:23 -0600 Subject: [PATCH] chore: alias `agd` to `ag0` --- .github/workflows/ci.yml | 2 +- upgrade-test-scripts/start_ag0.sh | 27 ++++++++++++++++----------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b596a6a3..5b270330 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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' }} diff --git a/upgrade-test-scripts/start_ag0.sh b/upgrade-test-scripts/start_ag0.sh index 812bbbf4..08ec99cc 100755 --- a/upgrade-test-scripts/start_ag0.sh +++ b/upgrade-test-scripts/start_ag0.sh @@ -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 @@ -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=( @@ -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 @@ -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" \ @@ -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)" @@ -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"