Skip to content

Commit

Permalink
feat(agoric): honour agoric start local-solo --no-restart
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Jan 12, 2022
1 parent 0e0e193 commit 53fd973
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions packages/agoric-cli/src/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,25 @@ export default async function startMain(progname, rawArgs, powers, opts) {
);
}

// Initialise the solo directory and key.
if (!(await exists(agServer))) {
const initArgs = [`--webport=${portNum}`];
if (opts.dockerTag) {
initArgs.push(`--webhost=0.0.0.0`);
}
const exitStatus = await soloSpawn(
['init', agServer, ...initArgs],
undefined,
[`--workdir=/usr/src/dapp`],
);
if (exitStatus) {
return exitStatus;
}
}
if (!opts.restart) {
return 0;
}

const gciFile = `_agstate/agoric-servers/local-chain-${CHAIN_PORT}/config/genesis.json.sha256`;
process.stdout.write(`Waiting for local-chain-${CHAIN_PORT} to start...`);
let hasGci = false;
Expand All @@ -487,22 +506,6 @@ export default async function startMain(progname, rawArgs, powers, opts) {
}
process.stdout.write('\n');

// Initialise the solo directory and key.
if (!(await exists(agServer))) {
const initArgs = [`--webport=${portNum}`];
if (opts.dockerTag) {
initArgs.push(`--webhost=0.0.0.0`);
}
const exitStatus = await soloSpawn(
['init', agServer, ...initArgs],
undefined,
[`--workdir=/usr/src/dapp`],
);
if (exitStatus) {
return exitStatus;
}
}

const spawnOpts = {};
if (!popts.dockerTag) {
spawnOpts.cwd = agServer;
Expand Down

0 comments on commit 53fd973

Please sign in to comment.