mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 12:51:02 +00:00
Add --collator flag as alternative to --validator (#222)
* Initial commit
Forked at: 56753b7717
Parent branch: origin/master
* Add --collator flag as alternative to --validator
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -93,6 +93,12 @@ pub struct Cli {
|
||||
#[structopt(flatten)]
|
||||
pub run: RunCmd,
|
||||
|
||||
/// Run node as collator.
|
||||
///
|
||||
/// Note that this is the same as running with `--validator`.
|
||||
#[structopt(long, conflicts_with = "validator")]
|
||||
pub collator: bool,
|
||||
|
||||
/// Relaychain arguments
|
||||
#[structopt(raw = true)]
|
||||
pub relaychain_args: Vec<String>,
|
||||
|
||||
@@ -276,13 +276,14 @@ pub fn run() -> Result<()> {
|
||||
let polkadot_config =
|
||||
SubstrateCli::create_configuration(&polkadot_cli, &polkadot_cli, task_executor)
|
||||
.map_err(|err| format!("Relay chain argument error: {}", err))?;
|
||||
let collator = cli.run.base.validator || cli.collator;
|
||||
|
||||
info!("Parachain id: {:?}", id);
|
||||
info!("Parachain Account: {}", parachain_account);
|
||||
info!("Parachain genesis state: {}", genesis_state);
|
||||
info!(
|
||||
"Is collating: {}",
|
||||
if cli.run.base.validator { "yes" } else { "no" }
|
||||
if collator { "yes" } else { "no" }
|
||||
);
|
||||
|
||||
if use_contracts_runtime(&config.chain_spec) {
|
||||
@@ -291,7 +292,7 @@ pub fn run() -> Result<()> {
|
||||
key,
|
||||
polkadot_config,
|
||||
id,
|
||||
cli.run.base.validator,
|
||||
collator,
|
||||
false,
|
||||
)
|
||||
} else {
|
||||
@@ -300,7 +301,7 @@ pub fn run() -> Result<()> {
|
||||
key,
|
||||
polkadot_config,
|
||||
id,
|
||||
cli.run.base.validator,
|
||||
collator,
|
||||
false,
|
||||
)
|
||||
.map(|r| r.0)
|
||||
|
||||
Reference in New Issue
Block a user