Skip to content

Commit

Permalink
Merge pull request #243 from gregdhill/fix/cumulus-cli
Browse files Browse the repository at this point in the history
fix: use cumulus cli run cmd
  • Loading branch information
gregdhill authored Aug 26, 2021
2 parents a943c00 + 9985676 commit edf7f48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 29 deletions.
26 changes: 1 addition & 25 deletions parachain/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,6 @@ pub struct ExportGenesisWasmCommand {
pub chain: Option<String>,
}

#[derive(Debug, StructOpt)]
pub struct RunCmd {
#[structopt(flatten)]
pub base: sc_cli::RunCmd,

/// Id of the parachain this collator collates for.
#[structopt(long)]
pub parachain_id: Option<u32>,
}

impl std::ops::Deref for RunCmd {
type Target = sc_cli::RunCmd;

fn deref(&self) -> &Self::Target {
&self.base
}
}

#[derive(Debug, StructOpt)]
#[structopt(settings = &[
structopt::clap::AppSettings::GlobalVersion,
Expand All @@ -105,13 +87,7 @@ pub struct Cli {
pub subcommand: Option<Subcommand>,

#[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,
pub run: cumulus_client_cli::RunCmd,

/// Relaychain arguments
#[structopt(raw = true)]
Expand Down
10 changes: 6 additions & 4 deletions parachain/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@ impl SubstrateCli for RelayChainCli {
}

fn description() -> String {
"Cumulus test parachain collator\n\nThe command-line arguments provided first will be \
format!(
"Polkadot collator\n\nThe command-line arguments provided first will be \
passed to the parachain node, while the arguments provided after -- will be passed \
to the relaychain node.\n\n\
rococo-collator [parachain-args] -- [relaychain-args]"
.into()
{} [parachain-args] -- [relaychain-args]",
Self::executable_name()
)
}

fn author() -> String {
Expand Down Expand Up @@ -251,7 +253,7 @@ pub fn run() -> Result<()> {
Ok(())
}
None => {
let runner = cli.create_runner(&*cli.run)?;
let runner = cli.create_runner(&cli.run.normalize())?;

runner
.run_node_until_exit(|config| async move { start_node(cli, config).await })
Expand Down

0 comments on commit edf7f48

Please sign in to comment.