Skip to content

Commit

Permalink
fix: remove obsolete --home-client
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Oct 7, 2020
1 parent d0b2526 commit f97171a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
33 changes: 22 additions & 11 deletions packages/agoric-cli/lib/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export default async function startMain(progname, rawArgs, powers, opts) {

// Get or create the essential addresses.
const addrs = {};
for (const keyName of ['delegate0', 'provision']) {
for (const keyName of ['provision']) {
/* eslint-disable no-await-in-loop */
let capret = showKey(keyName);
if (await capret[0]) {
Expand All @@ -255,30 +255,38 @@ export default async function startMain(progname, rawArgs, powers, opts) {
const genesisFile = `${localAgServer}/config/genesis.json`;
if (!(await exists(`${genesisFile}.stamp`))) {
let exitStatus;
await chainSpawn([
exitStatus = await chainSpawn([
'add-genesis-account',
addrs.provision,
PROVISION_COINS,
]);
if (exitStatus) {
return exitStatus;
}
await chainSpawn([
// We need to generate the delegate address on the node.
exitStatus = await chainSpawn([
'keys',
'add',
'delegate0',
'--keyring-backend=test',
]);
if (exitStatus) {
return exitStatus;
}
exitStatus = await chainSpawn([
'add-genesis-account',
addrs.delegate0,
'delegate0',
DELEGATE0_COINS,
'--keyring-backend=test',
]);
if (exitStatus) {
return exitStatus;
}
const keysHome = opts.sdk
? `_agstate/keys`
: `/usr/src/dapp/_agstate/keys`;
exitStatus = await chainSpawn([
'gentx',
`--home-client=${keysHome}`,
'delegate0',
'--keyring-backend=test',
'--name=delegate0',
`--chain-id=${CHAIN_ID}`,
`--amount=${DELEGATE0_COINS}`,
]);
if (exitStatus) {
Expand Down Expand Up @@ -460,8 +468,11 @@ export default async function startMain(progname, rawArgs, powers, opts) {
);
// eslint-disable-next-line no-await-in-loop
exitStatus = await capret[0];
if (!exitStatus && !capret[1].includes('code: 0')) {
exitStatus = 2;
if (!exitStatus) {
const ret = JSON.parse(capret[1]);
if (ret.code !== 0) {
exitStatus = 2;
}
}
}
if (!exitStatus) {
Expand Down
4 changes: 2 additions & 2 deletions packages/cosmic-swingset/bin/ag-nchainz
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ testnet)
$SOLO init $solo --webport=$port
addr=$(cat $solo/ag-chain-cosmos-address)
$DAEMON add-genesis-account --home=$n0d \
--home-client=$solo/$CLI-statedir --keyring-backend=test \
ag-solo 1000uag,1provisionpass
$($CLI --home=$solo/$CLI-statedir --keyring-backend=test keys show -a ag-solo) \
1000uag,1provisionpass
# Generate powerful SwingSet egresses.
egresses="$egresses$sep{\"nickname\":\"$solo\",\"peer\":\"$addr\",\"powerFlags\":$POWER_FLAGS}"
sep=,
Expand Down

0 comments on commit f97171a

Please sign in to comment.