From a0cee2ebd95de8625cd343d013596b641890a0da Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Wed, 20 Apr 2022 18:29:24 -0300 Subject: [PATCH 1/2] add build-spec subcommand --- test/service/src/cli.rs | 4 ++++ test/service/src/main.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/test/service/src/cli.rs b/test/service/src/cli.rs index 9ec619ed7c2..864654db8ba 100644 --- a/test/service/src/cli.rs +++ b/test/service/src/cli.rs @@ -58,6 +58,10 @@ pub enum Commands { #[clap(name = "export-genesis-state")] ExportGenesisState(ExportGenesisStateCommand), + + /// Build a chain specification. + BuildSpec(sc_cli::BuildSpecCmd), + } #[derive(Debug, Parser)] diff --git a/test/service/src/main.rs b/test/service/src/main.rs index b3e493e08e3..1212d75ba50 100644 --- a/test/service/src/main.rs +++ b/test/service/src/main.rs @@ -46,6 +46,10 @@ fn main() -> Result<(), sc_cli::Error> { let cli = TestCollatorCli::parse(); match &cli.subcommand { + Some(Commands::BuildSpec(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.sync_run(|config| cmd.run(config.chain_spec, config.network)) + }, Some(Commands::ExportGenesisState(params)) => { let mut builder = sc_cli::LoggerBuilder::new(""); builder.with_profiling(sc_tracing::TracingReceiver::Log, ""); From c0a774f64fc49e4a7e1cbec76913da7d91d2477e Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Thu, 21 Apr 2022 11:31:04 -0300 Subject: [PATCH 2/2] reorder args --- test/service/src/cli.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/test/service/src/cli.rs b/test/service/src/cli.rs index 864654db8ba..fd0254b8567 100644 --- a/test/service/src/cli.rs +++ b/test/service/src/cli.rs @@ -25,6 +25,9 @@ use std::{net::SocketAddr, path::PathBuf}; #[derive(Debug, Parser)] pub struct ExportGenesisStateCommand { + #[clap(default_value_t = 2000u32)] + pub parachain_id: u32, + /// Output file name or stdout if unspecified. #[clap(parse(from_os_str))] pub output: Option, @@ -33,13 +36,18 @@ pub struct ExportGenesisStateCommand { #[clap(short, long)] pub raw: bool, - #[clap(default_value_t = 2000u32)] - pub parachain_id: u32, + /// The name of the chain for that the genesis state should be exported. + #[clap(long)] + pub chain: Option, + } /// Command for exporting the genesis wasm file. #[derive(Debug, Parser)] pub struct ExportGenesisWasmCommand { + #[clap(default_value_t = 2000u32)] + pub parachain_id: u32, + /// Output file name or stdout if unspecified. #[clap(parse(from_os_str))] pub output: Option, @@ -48,8 +56,9 @@ pub struct ExportGenesisWasmCommand { #[clap(short, long)] pub raw: bool, - #[clap(default_value_t = 2000u32)] - pub parachain_id: u32, + /// The name of the chain for that the genesis wasm file should be exported. + #[clap(long)] + pub chain: Option, } #[derive(Subcommand, Debug)] pub enum Commands {