From 5123a84f133c3bee6b60d2ecda1db1f4927ae928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Tue, 22 Oct 2019 18:54:52 +0200 Subject: [PATCH] Support disabling the addition of the default bootnode (#3888) --- substrate/core/cli/src/lib.rs | 2 +- substrate/core/cli/src/params.rs | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/substrate/core/cli/src/lib.rs b/substrate/core/cli/src/lib.rs index e588c5e8f1..51363445dc 100644 --- a/substrate/core/cli/src/lib.rs +++ b/substrate/core/cli/src/lib.rs @@ -803,7 +803,7 @@ where G: RuntimeGenesis, E: ChainSpecExtension, { - if spec.boot_nodes().is_empty() { + if spec.boot_nodes().is_empty() && !cli.disable_default_bootnode { let base_path = base_path(&cli.shared_params, version); let storage_path = network_path(&base_path, spec.id()); let node_key = node_key_config(cli.node_key_params, &Some(storage_path))?; diff --git a/substrate/core/cli/src/params.rs b/substrate/core/cli/src/params.rs index e75defec1d..ae1c856622 100644 --- a/substrate/core/cli/src/params.rs +++ b/substrate/core/cli/src/params.rs @@ -614,6 +614,13 @@ pub struct BuildSpecCmd { #[structopt(long = "raw")] pub raw: bool, + /// Disable adding the default bootnode to the specification. + /// + /// By default the `/ip4/127.0.0.1/tcp/30333/p2p/NODE_PEER_ID` bootnode is added to the + /// specification when no bootnode exists. + #[structopt(long = "disable-default-bootnode")] + pub disable_default_bootnode: bool, + #[allow(missing_docs)] #[structopt(flatten)] pub shared_params: SharedParams, @@ -763,7 +770,7 @@ impl StructOpt for CoreParams where ) ).subcommand( BuildSpecCmd::augment_clap(SubCommand::with_name("build-spec")) - .about("Build a spec.json file, outputing to stdout.") + .about("Build a spec.json file, outputting to stdout.") ) .subcommand( ExportBlocksCmd::augment_clap(SubCommand::with_name("export-blocks"))