Refuse to start substrate without providing an explicit chain (#7977)

This commit is contained in:
David
2021-01-25 20:29:39 +00:00
committed by GitHub
parent 82d9d5adcf
commit 8938b328ef
+12 -9
View File
@@ -49,15 +49,18 @@ impl SubstrateCli for Cli {
}
fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
Ok(match id {
"dev" => Box::new(chain_spec::development_config()),
"local" => Box::new(chain_spec::local_testnet_config()),
"" | "fir" | "flaming-fir" => Box::new(chain_spec::flaming_fir_config()?),
"staging" => Box::new(chain_spec::staging_testnet_config()),
path => Box::new(chain_spec::ChainSpec::from_json_file(
std::path::PathBuf::from(path),
)?),
})
let spec =
match id {
"" => return Err("Please specify which chain you want to run, e.g. --dev or --chain=local".into()),
"dev" => Box::new(chain_spec::development_config()),
"local" => Box::new(chain_spec::local_testnet_config()),
"fir" | "flaming-fir" => Box::new(chain_spec::flaming_fir_config()?),
"staging" => Box::new(chain_spec::staging_testnet_config()),
path => Box::new(chain_spec::ChainSpec::from_json_file(
std::path::PathBuf::from(path),
)?),
};
Ok(spec)
}
fn native_runtime_version(_: &Box<dyn ChainSpec>) -> &'static RuntimeVersion {