Skip to content

Commit

Permalink
feat: allow the specification of --persistent-peers
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Jul 19, 2020
1 parent 0dca9ff commit 2a86410
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/agoric-cli/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ const main = async (progname, rawArgs, powers) => {
'--import-from <dir>',
'import the exported configuration from <dir>',
)
.option(
'--persistent-peers <addrs>',
'set the config.toml p2p.persistent_peers value',
'',
)
.action(async (prog, configDir, cmd) => {
const opts = { ...program.opts(), ...cmd.opts() };
return subMain(setDefaultsMain, ['set-defaults', prog, configDir], opts);
Expand Down
3 changes: 2 additions & 1 deletion packages/agoric-cli/lib/set-defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default async function setDefaultsMain(progname, rawArgs, powers, opts) {

const genesisFile = `${configDir}/genesis.json`;
const configFile = `${configDir}/config.toml`;
const { importFrom } = opts;
const { importFrom, persistentPeers } = opts;
const [genesisJson, configToml, exportedGenesisJson] = await Promise.all([
fs.readFile(genesisFile, 'utf-8'),
fs.readFile(configFile, 'utf-8'),
Expand All @@ -24,6 +24,7 @@ export default async function setDefaultsMain(progname, rawArgs, powers, opts) {
genesisJson,
configToml,
exportedGenesisJson,
persistentPeers,
});

const create = (fileName, contents) => {
Expand Down

0 comments on commit 2a86410

Please sign in to comment.