diff --git a/packages/agoric-cli/src/bin-agops.js b/packages/agoric-cli/src/bin-agops.js index daeaf9c0e6f..5750c56307a 100755 --- a/packages/agoric-cli/src/bin-agops.js +++ b/packages/agoric-cli/src/bin-agops.js @@ -19,6 +19,7 @@ import anylogger from 'anylogger'; import { Command, CommanderError, createCommand } from 'commander'; import { makeOracleCommand } from './commands/oracle.js'; import { makeEconomicCommiteeCommand } from './commands/ec.js'; +import { makeGovCommand } from './commands/gov.js'; import { makePsmCommand } from './commands/psm.js'; import { makeReserveCommand } from './commands/reserve.js'; import { makeVaultsCommand } from './commands/vaults.js'; @@ -31,10 +32,11 @@ const logger = anylogger('agops'); const progname = path.basename(process.argv[1]); const program = new Command(); -program.name(progname).version('unversioned'); +program.name(progname).version('docker'); program.addCommand(makeOracleCommand(logger)); program.addCommand(makeEconomicCommiteeCommand(logger)); +program.addCommand(makeGovCommand(logger)); program.addCommand(makePerfCommand(logger)); program.addCommand(makePsmCommand(logger)); program.addCommand(makeVaultsCommand(logger)); diff --git a/packages/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/README.md b/packages/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/README.md index f4de664a54e..57f11bdc7ed 100644 --- a/packages/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/README.md +++ b/packages/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/README.md @@ -9,7 +9,7 @@ Related: https://github.com/agoric-labs/KREAd/releases/tag/gryo-rc0 It has to be built with these specific addresses, using this one really long command: -``` +```sh KREAD_COMMITTEE_ADDRESSES='{"krgov1": "agoric1890064p6j3xhzzdf8daknd6kpvhw766ds8flgw", "krgov2": "agoric1vqm5x5sj4lxmj2kem7x92tuhaum0k2yzyj6mgu"}' \ KREAD_COMMITTEE_NAME=kread-gov \ KREAD_ROYALTY_ADDRESS=agoric1yjc8llu3fugm7tgqye4rd5n92l9x2dhe30dazp \ @@ -18,36 +18,44 @@ make clean build-proposals ``` Build the images if you haven't lately, -``` +```sh make build ``` Then with MN2 set to the repo you build the above from: -``` +```sh TARGET=agoric-upgrade-11 MN2=/opt/agoric/KREAd/ make run ``` That will run: -``` +```sh docker run --rm -it -p 26656:26656 -p 26657:26657 -p 1317:1317 -v "${PWD}:/workspace" -v "${MN2}:/mn2" -e "DEBUG=SwingSet:ls,SwingSet:vat" -e "DEST=1" -e "TMUX_USE_CC=0" \ --entrypoint /usr/src/agoric-sdk/upgrade-test-scripts/start_to_to.sh \ agoric/upgrade-test:agoric-upgrade-11 ``` -Then in the shell that opens up, replace its `upgrade-test-scripts` with a symlink: +Then in a new shell do the following. +(TODO integrate these into the layers) ```sh +# Replace its `upgrade-test-scripts` with a symlink: rm -rf upgrade-test-scripts ln -s /workspace/upgrade-test-scripts -``` -Then patch `/usr/src/agoric-sdk/bin/agd`: -- find `$BUILD_ONLY || exec 1>&2` (line 94?) -- put this in above it: `${NO_BUILD:-false} && exit 0` -TODO have the layer modify agd to never build itself +# Patch agoric-cli +cp upgrade-test-scripts/agoric-upgrade-11/gov-cmd packages/agoric-cli/src/commands/gov.js +cp upgrade-test-scripts/agoric-upgrade-11/agops-bin packages/agoric-cli/src/bin-agops.js +## this should be docker-u11 +agops --version -Then use the `/mn2` that `make run` mounted: -```sh +# patch agd so it doesn't try to rebuild +#sed --in-place=.backup '93,$ d' /usr/src/agoric-sdk/bin/agd +#- find `$BUILD_ONLY || exec 1>&2` (line 94?) +#- put this in above it: `${NO_BUILD:-false} && exit 0` +vi /usr/src/agoric-sdk/bin/agd + + +# Run the test using the `/mn2` that `make run` mounted: cd /usr/src/agoric-sdk/upgrade-test-scripts NO_BUILD=true \ @@ -55,3 +63,17 @@ MN2_PROPOSAL_INFO=/mn2/agoric/dist/ \ MN2_INSTANCE=kread \ yarn ava /usr/src/agoric-sdk/upgrade-test-scripts/agoric-upgrade-11/mn2-start.test.js ``` + +Test governance +TODO put into JS +```sh +# should have two invitations in balances +agoric wallet show --keyring-backend=test --from krgov1 + +agops gov committee --name kreadCommittee --send-from krgov1 +agops gov charter --name kreadCommitteeCharter --send-from krgov1 + +# now should have two used invitations +agoric wallet show --keyring-backend=test --from krgov1 + +``` diff --git a/packages/deployment/upgrade-test/upgrade-test-scripts/lib/agd-lib.js b/packages/deployment/upgrade-test/upgrade-test-scripts/lib/agd-lib.js index 778f4d1916c..8d2220e4047 100644 --- a/packages/deployment/upgrade-test/upgrade-test-scripts/lib/agd-lib.js +++ b/packages/deployment/upgrade-test/upgrade-test-scripts/lib/agd-lib.js @@ -44,7 +44,12 @@ export const makeAgd = ({ execFileSync }) => { const out = await exec(['query', ...qArgs, ...nodeArgs, ...outJson], { stdio: ['ignore', 'pipe', 'ignore'], }); - return JSON.parse(out); + try { + return JSON.parse(out); + } catch (e) { + console.error(e); + console.info('output:', out); + } }, }); const nameHub = freeze({ @@ -86,7 +91,12 @@ export const makeAgd = ({ execFileSync }) => { ...outJson, ]; const out = exec(args); - return JSON.parse(out); + try { + return JSON.parse(out); + } catch (e) { + console.error(e); + console.info('output:', out); + } }, ...ro, ...nameHub,