mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 02:48:03 +00:00
Clean up CLI interface (#3334)
* Clean up CLI interface - Removes `--validator` and `--grandpa-voter` - Make `--alice` etc work without `--dev` * Style fixes
This commit is contained in:
committed by
Gavin Wood
parent
6396901481
commit
60269d65c6
@@ -433,14 +433,11 @@ where
|
||||
),
|
||||
};
|
||||
|
||||
let role =
|
||||
if cli.light {
|
||||
service::Roles::LIGHT
|
||||
} else if cli.validator || cli.shared_params.dev {
|
||||
service::Roles::AUTHORITY
|
||||
} else {
|
||||
service::Roles::FULL
|
||||
};
|
||||
let role = if cli.light {
|
||||
service::Roles::LIGHT
|
||||
} else {
|
||||
service::Roles::AUTHORITY
|
||||
};
|
||||
|
||||
let exec = cli.execution_strategies;
|
||||
let exec_all_or = |strat: params::ExecutionStrategy| exec.execution.unwrap_or(strat).into();
|
||||
@@ -461,7 +458,6 @@ where
|
||||
|
||||
config.roles = role;
|
||||
config.disable_grandpa = cli.no_grandpa;
|
||||
config.grandpa_voter = cli.grandpa_voter;
|
||||
|
||||
let is_dev = cli.shared_params.dev;
|
||||
|
||||
@@ -475,26 +471,16 @@ where
|
||||
is_dev,
|
||||
)?;
|
||||
|
||||
fill_transaction_pool_configuration::<F>(
|
||||
&mut config,
|
||||
cli.pool_config,
|
||||
)?;
|
||||
fill_transaction_pool_configuration::<F>(&mut config, cli.pool_config)?;
|
||||
|
||||
if cli.shared_params.dev {
|
||||
config.dev_key_seed = cli.keyring.account
|
||||
.map(|a| format!("//{}", a))
|
||||
.or_else(|| Some("//Alice".into()));
|
||||
}
|
||||
config.dev_key_seed = cli.keyring.account.map(|a| format!("//{}", a));
|
||||
|
||||
let rpc_interface: &str = if cli.rpc_external { "0.0.0.0" } else { "127.0.0.1" };
|
||||
let ws_interface: &str = if cli.ws_external { "0.0.0.0" } else { "127.0.0.1" };
|
||||
|
||||
config.rpc_http = Some(
|
||||
parse_address(&format!("{}:{}", rpc_interface, 9933), cli.rpc_port)?
|
||||
);
|
||||
config.rpc_ws = Some(
|
||||
parse_address(&format!("{}:{}", ws_interface, 9944), cli.ws_port)?
|
||||
);
|
||||
config.rpc_http = Some(parse_address(&format!("{}:{}", rpc_interface, 9933), cli.rpc_port)?);
|
||||
config.rpc_ws = Some(parse_address(&format!("{}:{}", ws_interface, 9944), cli.ws_port)?);
|
||||
|
||||
config.rpc_ws_max_connections = cli.ws_max_connections;
|
||||
config.rpc_cors = cli.rpc_cors.unwrap_or_else(|| if is_dev {
|
||||
log::warn!("Running in --dev mode, RPC CORS has been disabled.");
|
||||
|
||||
@@ -311,19 +311,10 @@ pub struct ExecutionStrategies {
|
||||
/// The `run` command used to run a node.
|
||||
#[derive(Debug, StructOpt, Clone)]
|
||||
pub struct RunCmd {
|
||||
/// Enable validator mode
|
||||
#[structopt(long = "validator")]
|
||||
pub validator: bool,
|
||||
|
||||
/// Disable GRANDPA when running in validator mode
|
||||
#[structopt(long = "no-grandpa")]
|
||||
pub no_grandpa: bool,
|
||||
|
||||
/// Run GRANDPA voter even when no additional key seed via `--key` is specified. This can for example be of interest
|
||||
/// when running a sentry node in front of a validator, thus needing to forward GRANDPA gossip messages.
|
||||
#[structopt(long = "grandpa-voter")]
|
||||
pub grandpa_voter: bool,
|
||||
|
||||
/// Experimental: Run in light client mode
|
||||
#[structopt(long = "light")]
|
||||
pub light: bool,
|
||||
@@ -505,7 +496,6 @@ impl AugmentClap for Keyring {
|
||||
.long(&a.name)
|
||||
.help(&a.help)
|
||||
.conflicts_with_all(&conflicts_with_strs)
|
||||
.requires("dev")
|
||||
.takes_value(false)
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user