mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 20:21:06 +00:00
Make --collator reusable and imply --validator (#380)
* Reusable RunCmd struct * wire new run command through service * Fill in the rest of the methods * attempt normalization * Settle on the borrowing approach * add the normalize call * bump substrate * Update client/cli/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update docs * Update client/cli/src/lib.rs 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:
@@ -262,7 +262,7 @@ pub fn run() -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
None => {
|
||||
let runner = cli.create_runner(&*cli.run)?;
|
||||
let runner = cli.create_runner(&cli.run.normalize())?;
|
||||
let use_shell = use_shell_runtime(&runner.config().chain_spec);
|
||||
|
||||
runner.run_node_until_exit(|config| async move {
|
||||
@@ -295,20 +295,19 @@ pub fn run() -> Result<()> {
|
||||
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 collator { "yes" } else { "no" });
|
||||
info!("Is collating: {}", if config.role.is_authority() { "yes" } else { "no" });
|
||||
|
||||
if use_shell {
|
||||
crate::service::start_shell_node(config, key, polkadot_config, id, collator)
|
||||
crate::service::start_shell_node(config, key, polkadot_config, id)
|
||||
.await
|
||||
.map(|r| r.0)
|
||||
.map_err(Into::into)
|
||||
} else {
|
||||
crate::service::start_node(config, key, polkadot_config, id, collator)
|
||||
crate::service::start_node(config, key, polkadot_config, id)
|
||||
.await
|
||||
.map(|r| r.0)
|
||||
.map_err(Into::into)
|
||||
|
||||
Reference in New Issue
Block a user