Don't run dev light client as validator (#4757)

A light client can not be a validator, so we should not set `authority
== true` in dev mode.
This commit is contained in:
Bastian Köcher
2020-01-29 09:52:54 +01:00
committed by GitHub
parent 9a6d9f0db5
commit 34c1c4b954
2 changed files with 9 additions and 4 deletions
+5 -3
View File
@@ -998,9 +998,11 @@ where
fill_config_keystore_password_and_path(&mut config, &cli)?;
let is_dev = cli.shared_params.dev;
let is_authority = cli.validator || cli.sentry || is_dev || cli.keyring.account.is_some();
let is_light = cli.light;
let is_authority = (cli.validator || cli.sentry || is_dev || cli.keyring.account.is_some())
&& !is_light;
let role =
if cli.light {
if is_light {
sc_service::Roles::LIGHT
} else if is_authority {
sc_service::Roles::AUTHORITY
@@ -1056,7 +1058,7 @@ where
config.dev_key_seed = cli.keyring.account
.map(|a| format!("//{}", a)).or_else(|| {
if is_dev {
if is_dev && !is_light {
Some("//Alice".into())
} else {
None
+4 -1
View File
@@ -417,7 +417,10 @@ pub struct RunCmd {
pub no_grandpa: bool,
/// Experimental: Run in light client mode.
#[structopt(long = "light")]
#[structopt(
long = "light",
conflicts_with_all = &[ "validator" ]
)]
pub light: bool,
/// Listen to all RPC interfaces.