diff --git a/prdoc/pr_10020.prdoc b/prdoc/pr_10020.prdoc new file mode 100644 index 0000000000000..5c82eafd36a90 --- /dev/null +++ b/prdoc/pr_10020.prdoc @@ -0,0 +1,5 @@ +title: 'pallet-revive: Add ExportChainSpec command to revive-dev-node' +doc: +- audience: Runtime Dev + description: "Add the `export-chain-spec` command to the revive-dev-node.\r\n" +crates: [] diff --git a/substrate/frame/revive/dev-node/node/src/cli.rs b/substrate/frame/revive/dev-node/node/src/cli.rs index 1d480067465d0..fe7717dd76511 100644 --- a/substrate/frame/revive/dev-node/node/src/cli.rs +++ b/substrate/frame/revive/dev-node/node/src/cli.rs @@ -67,6 +67,9 @@ pub enum Subcommand { /// Export blocks. ExportBlocks(sc_cli::ExportBlocksCmd), + /// Export the chain specification. + ExportChainSpec(sc_cli::ExportChainSpecCmd), + /// Export the state of a given block into a chain spec. ExportState(sc_cli::ExportStateCmd), diff --git a/substrate/frame/revive/dev-node/node/src/command.rs b/substrate/frame/revive/dev-node/node/src/command.rs index 5715224a4d265..ad4f31f340033 100644 --- a/substrate/frame/revive/dev-node/node/src/command.rs +++ b/substrate/frame/revive/dev-node/node/src/command.rs @@ -89,6 +89,10 @@ pub fn run() -> sc_cli::Result<()> { Ok((cmd.run(client, config.database), task_manager)) }) }, + Some(Subcommand::ExportChainSpec(cmd)) => { + let chain_spec = cli.load_spec(&cmd.chain)?; + cmd.run(chain_spec) + }, Some(Subcommand::ExportState(cmd)) => { let runner = cli.create_runner(cmd)?; runner.async_run(|config| {