diff --git a/cumulus/README.md b/cumulus/README.md index 17bdc3d2e072..d39842a4ee18 100644 --- a/cumulus/README.md +++ b/cumulus/README.md @@ -123,7 +123,7 @@ git clone https://github.com/paritytech/polkadot-sdk cargo build --release -p polkadot # Generate a raw chain spec -./target/release/polkadot build-spec --chain rococo-local --disable-default-bootnode --raw > rococo-local-cfde.json +./target/release/polkadot export-chain-spec --chain rococo-local --raw > rococo-local-cfde.json # Alice ./target/release/polkadot --chain rococo-local-cfde.json --alice --tmp diff --git a/cumulus/polkadot-omni-node/lib/src/cli.rs b/cumulus/polkadot-omni-node/lib/src/cli.rs index 3a35a496620d..315b0a8c274f 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -79,22 +79,6 @@ pub enum Subcommand { #[command(subcommand)] Key(sc_cli::KeySubcommand), - /// Build a chain specification. - /// - /// The `build-spec` command relies on the chain specification built (hard-coded) into the node - /// binary, and may utilize the genesis presets of the runtimes also embedded in the nodes - /// that support this command. Since `polkadot-omni-node` does not contain any embedded - /// runtime, and requires a `chain-spec` path to be passed to its `--chain` flag, the command - /// isn't bringing significant value as it does for other node binaries (e.g. the - /// `polkadot` binary). - /// - /// For a more versatile `chain-spec` manipulation experience please check out the - /// `polkadot-omni-node chain-spec-builder` subcommand. - #[deprecated( - note = "build-spec will be removed after 1/06/2025. Use chain-spec-builder instead" - )] - BuildSpec(sc_cli::BuildSpecCmd), - /// Validate blocks. CheckBlock(sc_cli::CheckBlockCmd), diff --git a/cumulus/polkadot-omni-node/lib/src/command.rs b/cumulus/polkadot-omni-node/lib/src/command.rs index 0b2ccfb75958..cadc4e89d632 100644 --- a/cumulus/polkadot-omni-node/lib/src/command.rs +++ b/cumulus/polkadot-omni-node/lib/src/command.rs @@ -144,12 +144,7 @@ where Cli::::from_arg_matches(&matches).map_err(|e| sc_cli::Error::Cli(e.into()))?; cli.chain_spec_loader = Some(cmd_config.chain_spec_loader); - #[allow(deprecated)] match &cli.subcommand { - Some(Subcommand::BuildSpec(cmd)) => { - let runner = cli.create_runner(cmd)?; - runner.sync_run(|config| cmd.run(config.chain_spec, config.network)) - }, Some(Subcommand::CheckBlock(cmd)) => { let runner = cli.create_runner(cmd)?; runner.async_run(|config| { diff --git a/cumulus/scripts/create_bridge_hub_westend_spec.sh b/cumulus/scripts/create_bridge_hub_westend_spec.sh index 31dafda25e7a..ef573f088c96 100755 --- a/cumulus/scripts/create_bridge_hub_westend_spec.sh +++ b/cumulus/scripts/create_bridge_hub_westend_spec.sh @@ -26,7 +26,7 @@ echo "Generating chain spec for runtime: $rt_path and para_id: $para_id" binary="./target/release/polkadot-parachain" # build the chain spec we'll manipulate -$binary build-spec --chain bridge-hub-kusama-dev > chain-spec-plain.json +$binary export-chain-spec --chain bridge-hub-kusama-dev > chain-spec-plain.json # convert runtime to hex cat $rt_path | od -A n -v -t x1 | tr -d ' \n' > rt-hex.txt @@ -89,7 +89,7 @@ cat chain-spec-plain.json | jq --rawfile code rt-hex.txt '.genesis.runtime.syste > edited-chain-spec-plain.json # build a raw spec -$binary build-spec --chain edited-chain-spec-plain.json --raw > chain-spec-raw.json +$binary export-chain-spec --chain edited-chain-spec-plain.json --raw > chain-spec-raw.json cp edited-chain-spec-plain.json bridge-hub-westend-spec.json cp chain-spec-raw.json ./parachains/chain-specs/bridge-hub-westend.json cp chain-spec-raw.json bridge-hub-westend-spec-raw.json diff --git a/cumulus/scripts/create_coretime_westend_spec.sh b/cumulus/scripts/create_coretime_westend_spec.sh index 516dc06ac666..9f5eda86bab2 100755 --- a/cumulus/scripts/create_coretime_westend_spec.sh +++ b/cumulus/scripts/create_coretime_westend_spec.sh @@ -26,7 +26,7 @@ echo "Generating chain spec for runtime: $rt_path and para_id: $para_id" binary="./target/release/polkadot-parachain" # build the chain spec we'll manipulate -$binary build-spec --chain coretime-westend-dev > chain-spec-plain.json +$binary export-chain-spec --chain coretime-westend-dev > chain-spec-plain.json # convert runtime to hex cat $rt_path | od -A n -v -t x1 | tr -d ' \n' > rt-hex.txt @@ -68,7 +68,7 @@ cat chain-spec-plain.json | jq --rawfile code rt-hex.txt '.genesis.runtimeGenesi > edited-chain-spec-plain.json # build a raw spec -$binary build-spec --chain edited-chain-spec-plain.json --raw > chain-spec-raw.json +$binary export-chain-spec --chain edited-chain-spec-plain.json --raw > chain-spec-raw.json cp edited-chain-spec-plain.json coretime-westend-spec.json cp chain-spec-raw.json ./cumulus/parachains/chain-specs/coretime-westend.json cp chain-spec-raw.json coretime-westend-spec-raw.json diff --git a/cumulus/scripts/create_glutton_spec.sh b/cumulus/scripts/create_glutton_spec.sh index 78aafda3bd08..855feb6f0524 100755 --- a/cumulus/scripts/create_glutton_spec.sh +++ b/cumulus/scripts/create_glutton_spec.sh @@ -55,7 +55,7 @@ for (( para_id=$from_para_id; para_id<=$to_para_id; para_id++ )); do fi # build the chain spec we'll manipulate - $binary_path build-spec --disable-default-bootnode --chain "glutton-westend-genesis-$para_id" > "$output_para_dir/plain-glutton-$relay_chain-$para_id-spec.json" + $binary_path export-chain-spec --chain "glutton-westend-genesis-$para_id" > "$output_para_dir/plain-glutton-$relay_chain-$para_id-spec.json" id="glutton-$relay_chain-$para_id" protocol_id="glutton-$relay_chain-$para_id" @@ -74,7 +74,7 @@ for (( para_id=$from_para_id; para_id<=$to_para_id; para_id++ )); do > $output_para_dir/glutton-$relay_chain-$para_id-spec.json # build a raw spec - $binary_path build-spec --disable-default-bootnode --chain "$output_para_dir/glutton-$relay_chain-$para_id-spec.json" --raw > "$output_para_dir/glutton-$relay_chain-$para_id-raw-spec.json" + $binary_path export-chain-spec --chain "$output_para_dir/glutton-$relay_chain-$para_id-spec.json" --raw > "$output_para_dir/glutton-$relay_chain-$para_id-raw-spec.json" # build genesis data $binary_path export-genesis-state --chain "$output_para_dir/glutton-$relay_chain-$para_id-raw-spec.json" > "$output_para_dir/glutton-$relay_chain-$para_id-head-data" diff --git a/cumulus/scripts/create_people_westend_spec.sh b/cumulus/scripts/create_people_westend_spec.sh index f9c3694d61e3..e7f014f514e3 100755 --- a/cumulus/scripts/create_people_westend_spec.sh +++ b/cumulus/scripts/create_people_westend_spec.sh @@ -26,7 +26,7 @@ echo "Generating chain spec for runtime: $rt_path and para_id: $para_id" binary="./target/release/polkadot-parachain" # build the chain spec we'll manipulate -$binary build-spec --chain people-westend-local > chain-spec-plain.json +$binary export-chain-spec --chain people-westend-local > chain-spec-plain.json # convert runtime to hex cat $rt_path | od -A n -v -t x1 | tr -d ' \n' > rt-hex.txt @@ -93,7 +93,7 @@ cat chain-spec-plain.json | jq --rawfile code rt-hex.txt '.genesis.runtimeGenesi > edited-chain-spec-plain.json # build a raw spec -$binary build-spec --chain edited-chain-spec-plain.json --raw > chain-spec-raw.json +$binary export-chain-spec --chain edited-chain-spec-plain.json --raw > chain-spec-raw.json cp edited-chain-spec-plain.json people-westend-spec.json cp chain-spec-raw.json ./cumulus/parachains/chain-specs/people-westend.json cp chain-spec-raw.json people-westend-spec-raw.json diff --git a/cumulus/scripts/create_seedling_spec.sh b/cumulus/scripts/create_seedling_spec.sh index a4ac0b2ab528..f0362c85ca68 100755 --- a/cumulus/scripts/create_seedling_spec.sh +++ b/cumulus/scripts/create_seedling_spec.sh @@ -29,7 +29,7 @@ sudo=$8 binary="./target/release/polkadot-parachain" # build the chain spec we'll manipulate -$binary build-spec --disable-default-bootnode --chain seedling > seedling-spec-plain.json +$binary export-chain-spec --chain seedling > seedling-spec-plain.json # convert runtime to hex cat $runtime_path | od -A n -v -t x1 | tr -d ' \n' > seedling-hex.txt @@ -47,7 +47,7 @@ cat seedling-spec-plain.json | jq --rawfile code seedling-hex.txt '.genesis.runt > edited-seedling-plain.json # build a raw spec -$binary build-spec --disable-default-bootnode --chain edited-seedling-plain.json --raw > seedling-spec-raw.json +$binary export-chain-spec --chain edited-seedling-plain.json --raw > seedling-spec-raw.json # build genesis data $binary export-genesis-state --parachain-id=$para_id --chain seedling-spec-raw.json > seedling-head-data diff --git a/cumulus/scripts/create_shell_spec.sh b/cumulus/scripts/create_shell_spec.sh index 6d6675044dba..5173fa95ec03 100755 --- a/cumulus/scripts/create_shell_spec.sh +++ b/cumulus/scripts/create_shell_spec.sh @@ -13,7 +13,7 @@ rt_path=$1 binary="./target/release/polkadot-parachain" # build the chain spec we'll manipulate -$binary build-spec --chain shell > shell-spec-plain.json +$binary export-chain-spec --chain shell > shell-spec-plain.json # convert runtime to hex cat $rt_path | od -A n -v -t x1 | tr -d ' \n' > shell-hex.txt @@ -28,7 +28,7 @@ cat shell-spec-plain.json | jq --rawfile code shell-hex.txt '.genesis.runtime.sy > edited-shell-plain.json # build a raw spec -$binary build-spec --chain edited-shell-plain.json --raw > shell-spec-raw.json +$binary export-chain-spec --chain edited-shell-plain.json --raw > shell-spec-raw.json # build genesis data $binary export-genesis-state --parachain-id=1000 --chain shell-spec-raw.json > shell-head-data diff --git a/cumulus/test/service/src/cli.rs b/cumulus/test/service/src/cli.rs index 3f930c7a61fb..1007163a4174 100644 --- a/cumulus/test/service/src/cli.rs +++ b/cumulus/test/service/src/cli.rs @@ -82,14 +82,6 @@ impl Display for AuthoringPolicy { #[derive(Debug, clap::Subcommand)] pub enum Subcommand { - /// Build a chain specification. - /// DEPRECATED: `build-spec` command will be removed after 1/04/2026. Use `export-chain-spec` - /// command instead. - #[deprecated( - note = "build-spec command will be removed after 1/04/2026. Use export-chain-spec command instead" - )] - BuildSpec(sc_cli::BuildSpecCmd), - /// Export the chain specification. ExportChainSpec(sc_cli::ExportChainSpecCmd), diff --git a/cumulus/test/service/src/main.rs b/cumulus/test/service/src/main.rs index 58b48502a793..a2e38ef6a017 100644 --- a/cumulus/test/service/src/main.rs +++ b/cumulus/test/service/src/main.rs @@ -36,12 +36,6 @@ fn main() -> Result<(), sc_cli::Error> { let cli = TestCollatorCli::from_args(); match &cli.subcommand { - #[allow(deprecated)] - Some(Subcommand::BuildSpec(cmd)) => { - let runner = cli.create_runner(cmd)?; - runner.sync_run(|config| cmd.run(config.chain_spec, config.network)) - }, - Some(Subcommand::ExportChainSpec(cmd)) => { let chain_spec = cli.load_spec(&cmd.chain)?; cmd.run(chain_spec) diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/basic.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/basic.rs index c8be4c5642a8..1d45c0c030ce 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/basic.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/basic.rs @@ -163,6 +163,8 @@ async fn build_network_config() -> Result { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=trace").into()]) .with_default_resources(|resources| { @@ -194,6 +196,8 @@ async fn build_network_config() -> Result { .with_parachain(|p| { p.with_id(PARA_ID) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("block-bundling") .with_default_args(vec![ @@ -215,6 +219,8 @@ async fn build_network_config() -> Result { .with_parachain(|p| { p.with_id(HRMP_RECIPIENT_LOW) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("sync-backing") .with_collator(|n| n.with_name("hrmp-recipient-low")) @@ -222,6 +228,8 @@ async fn build_network_config() -> Result { .with_parachain(|p| { p.with_id(HRMP_RECIPIENT_HIGH) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("async-backing") .with_collator(|n| n.with_name("hrmp-recipient-high")) diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/full_core_usage_scenarios.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/full_core_usage_scenarios.rs index 6eccfbda631d..36ba54f49428 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/full_core_usage_scenarios.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/full_core_usage_scenarios.rs @@ -208,6 +208,8 @@ async fn build_network_config() -> Result { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=trace").into()]) .with_default_resources(|resources| { @@ -231,6 +233,8 @@ async fn build_network_config() -> Result { .with_parachain(|p| { p.with_id(PARA_ID) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("block-bundling") .with_default_args(vec![ diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/pov_recovery.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/pov_recovery.rs index 690304f97f01..b3db9682663d 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/pov_recovery.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/pov_recovery.rs @@ -112,6 +112,8 @@ async fn build_network_config() -> Result { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_resources(|resources| { // These settings are applicable only for `k8s` provider. @@ -153,6 +155,8 @@ async fn build_network_config() -> Result { p.with_id(PARA_ID) .with_chain("block-bundling") .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_default_resources(|resources| { // These settings are applicable only for `k8s` provider. diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/relay_parent_offset.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/relay_parent_offset.rs index 073fda9389e4..ffbd4ffce4e1 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/relay_parent_offset.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/relay_parent_offset.rs @@ -28,6 +28,8 @@ async fn block_bundling_relay_parent_offset() -> Result<(), anyhow::Error> { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_genesis_overrides(json!({ @@ -52,6 +54,8 @@ async fn block_bundling_relay_parent_offset() -> Result<(), anyhow::Error> { .with_parachain(|p| { p.with_id(2400) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("relay-parent-offset") .with_default_args(vec![ diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/runtime_upgrade.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/runtime_upgrade.rs index 27734b14254d..494c8f8258b0 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/runtime_upgrade.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/runtime_upgrade.rs @@ -190,6 +190,8 @@ async fn build_network_config() -> Result { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=trace").into()]) .with_default_resources(|resources| { @@ -213,6 +215,8 @@ async fn build_network_config() -> Result { .with_parachain(|p| { p.with_id(PARA_ID) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("block-bundling") .with_default_args(vec![ diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/three_cores_glutton.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/three_cores_glutton.rs index 9c5dd74a9ca5..196e3bb1b32b 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/three_cores_glutton.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/three_cores_glutton.rs @@ -75,6 +75,8 @@ async fn build_network_config() -> Result { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=trace").into()]) .with_default_resources(|resources| { @@ -98,6 +100,8 @@ async fn build_network_config() -> Result { .with_parachain(|p| { p.with_id(PARA_ID) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("block-bundling") .with_default_args(vec![ diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/tracing_block.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/tracing_block.rs index baf1e719d1a5..97e4348e853a 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/tracing_block.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/tracing_block.rs @@ -105,6 +105,8 @@ async fn build_network_config() -> Result { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=trace").into()]) .with_default_resources(|resources| { @@ -132,6 +134,8 @@ async fn build_network_config() -> Result { .with_parachain(|p| { p.with_id(PARA_ID) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("block-bundling") .with_default_args(vec![ diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/warp_sync.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/warp_sync.rs index 908bc959659a..812fb1d65bdd 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/warp_sync.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/block_bundling/warp_sync.rs @@ -129,6 +129,8 @@ async fn build_network_config() -> Result { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=trace").into()]) .with_default_resources(|resources| { @@ -152,6 +154,8 @@ async fn build_network_config() -> Result { .with_parachain(|p| { p.with_id(PARA_ID) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("block-bundling") .with_default_args(vec![ diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/bootnodes.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/bootnodes.rs index 69b5b0717d1a..e140a4f04259 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/bootnodes.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/bootnodes.rs @@ -23,6 +23,8 @@ async fn build_network_config() -> Result { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) // Not strictly necessary for the test, but to keep it consistent // with the parachain part we also pass `--no-mdns` to the relaychain. @@ -37,6 +39,10 @@ async fn build_network_config() -> Result { .with_parachain(|p| { p.with_id(1000) .with_default_command("polkadot-parachain") + .with_chain_spec_command( + "polkadot-parachain export-chain-spec --chain {{chainName}}", + ) + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("asset-hub-rococo-local") // Do not put bootnodes into the chain-spec nor command line arguments. diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/collator_discovery.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/collator_discovery.rs index d5198a919342..f1946e7d6bd7 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/collator_discovery.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/collator_discovery.rs @@ -91,6 +91,8 @@ async fn build_network_config() -> Result { .with_relaychain(|r| { r.with_chain("westend-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_default_resources(|resources| { @@ -115,6 +117,8 @@ async fn build_network_config() -> Result { let mut p = p .with_id(PARA_ID) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("relay-parent-offset") .with_collator(|n| { diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/asset_hub_westend.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/asset_hub_westend.rs index c0dca0692e05..55958ec43908 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/asset_hub_westend.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/asset_hub_westend.rs @@ -26,6 +26,8 @@ async fn build_network_config() -> Result { let r = r .with_chain("westend-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=trace").into()]) .with_default_resources(|resources| { @@ -53,6 +55,8 @@ async fn build_network_config() -> Result { .with_parachain(|p| { p.with_id(PARA_ID) .with_default_command("polkadot-parachain") + .with_chain_spec_command("polkadot-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("asset-hub-westend-local") .with_default_args(vec![ diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/pov_recovery.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/pov_recovery.rs index 10b25f5be0c4..2cb3b12e0afa 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/pov_recovery.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/pov_recovery.rs @@ -116,6 +116,8 @@ async fn build_network_config() -> Result { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_resources(|resources| { // These settings are applicable only for `k8s` provider. @@ -157,6 +159,8 @@ async fn build_network_config() -> Result { p.with_id(PARA_ID) .with_chain("elastic-scaling") .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_default_resources(|resources| { // These settings are applicable only for `k8s` provider. diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/slot_based_authoring.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/slot_based_authoring.rs index bcb88722f7c9..6e79500d753c 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/slot_based_authoring.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/slot_based_authoring.rs @@ -93,6 +93,8 @@ async fn build_network_config() -> Result { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_genesis_overrides(json!({ "configuration": { @@ -123,6 +125,8 @@ async fn build_network_config() -> Result { p.with_id(PARA_ID_1) .with_chain("elastic-scaling") .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_collator(|n| n.with_name("collator-elastic") @@ -135,6 +139,8 @@ async fn build_network_config() -> Result { .with_parachain(|p| { p.with_id(PARA_ID_2) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_collator(|n| n.with_name("collator-single-core") diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/slot_based_rp_offset.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/slot_based_rp_offset.rs index 79275ad99bf5..bd479c29b2bb 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/slot_based_rp_offset.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/slot_based_rp_offset.rs @@ -26,6 +26,8 @@ async fn elastic_scaling_slot_based_relay_parent_offset_test() -> Result<(), any let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_genesis_overrides(json!({ @@ -51,6 +53,8 @@ async fn elastic_scaling_slot_based_relay_parent_offset_test() -> Result<(), any .with_parachain(|p| { p.with_id(2400) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("relay-parent-offset") .with_default_args(vec![ diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/upgrade_to_3_cores.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/upgrade_to_3_cores.rs index 736d88d1d829..456b97928d7e 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/upgrade_to_3_cores.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/elastic_scaling/upgrade_to_3_cores.rs @@ -126,6 +126,8 @@ async fn build_network_config(async_backing: bool) -> Result Result Result { .with_relaychain(|r| { r.with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_validator(|node| node.with_name("alice")) @@ -85,6 +87,8 @@ async fn build_network_config() -> Result { .with_parachain(|p| { p.with_id(PARA_ID) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_collator(|n| { n.with_name("charlie") diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/full_node_warp_sync/generate-snapshots.sh b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/full_node_warp_sync/generate-snapshots.sh index 2061587bca60..b89440ffd611 100755 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/full_node_warp_sync/generate-snapshots.sh +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/full_node_warp_sync/generate-snapshots.sh @@ -55,7 +55,7 @@ chainspec_parachain() { chainspec_relaychain() { echo "==> Generating relaychain chain spec" - "$TARGET_DIR/polkadot" build-spec --chain rococo-local --disable-default-bootnode --raw > chain_spec.json + "$TARGET_DIR/polkadot" export-chain-spec --chain rococo-local --raw > chain_spec.json [[ -f "$RELAYCHAIN_SPEC" ]] && cp "$RELAYCHAIN_SPEC" "$RELAYCHAIN_SPEC.backup" mv chain_spec.json "$RELAYCHAIN_SPEC" echo "Created: $RELAYCHAIN_SPEC" diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/migrate_solo.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/migrate_solo.rs index f5c067c1137a..87f8a1b88ce4 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/migrate_solo.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/migrate_solo.rs @@ -119,6 +119,8 @@ async fn build_network_config() -> Result { .with_relaychain(|r| { r.with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_validator(|node| node.with_name("alice")) @@ -128,6 +130,8 @@ async fn build_network_config() -> Result { // parachain A p.with_id(PARA_ID) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_collator(|n| { n.with_name("dave").with_args(vec![("-lparachain=debug").into()]) @@ -138,6 +142,8 @@ async fn build_network_config() -> Result { p.with_id(PARA_ID) .with_registration_strategy(RegistrationStrategy::Manual) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) // modify genesis to produce different parachain header than for parachain A .with_genesis_overrides(json!({ diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/parachain_runtime_upgrade_slot_duration_18s.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/parachain_runtime_upgrade_slot_duration_18s.rs index 0859c1543956..090be7584717 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/parachain_runtime_upgrade_slot_duration_18s.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/parachain_runtime_upgrade_slot_duration_18s.rs @@ -114,6 +114,8 @@ async fn build_network_config() -> Result { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_validator(|node| node.with_name("validator-0")); @@ -126,6 +128,8 @@ async fn build_network_config() -> Result { .with_parachain(|p| { p.with_id(PARA_ID) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_default_args(vec![("-lparachain=debug,aura=debug").into()]) .with_collator(|n| n.with_name("collator").validator(true)) diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/pov_recovery.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/pov_recovery.rs index 9d8757a49348..806529130e6c 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/pov_recovery.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/pov_recovery.rs @@ -140,6 +140,8 @@ async fn build_network_config() -> Result { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_genesis_overrides(json!({ "configuration": { @@ -171,6 +173,8 @@ async fn build_network_config() -> Result { p.with_id(PARA_ID) .with_registration_strategy(RegistrationStrategy::Manual) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_collator(|c| { c.with_name("bob") diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/rpc_collator_build_blocks.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/rpc_collator_build_blocks.rs index a27ac9f4a338..620bfc58b7e3 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/rpc_collator_build_blocks.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/rpc_collator_build_blocks.rs @@ -106,6 +106,8 @@ async fn build_network_config() -> Result { .with_relaychain(|r| { r.with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_validator(|node| node.with_name("alice")) @@ -118,6 +120,8 @@ async fn build_network_config() -> Result { .with_parachain(|p| { p.with_id(PARA_ID) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_default_args(vec![ ("-lparachain=trace,blockchain-rpc-client=debug").into(), diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/runtime_upgrade.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/runtime_upgrade.rs index ce82125caed7..76e2a7efc0a0 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/runtime_upgrade.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/runtime_upgrade.rs @@ -127,6 +127,8 @@ async fn build_network_config() -> Result { .with_relaychain(|r| { r.with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_genesis_overrides(json!({ @@ -142,6 +144,8 @@ async fn build_network_config() -> Result { .with_parachain(|p| { p.with_id(PARA_ID) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_collator(|n| { n.with_name("charlie").validator(true).with_args(vec![ diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/statement_store/common.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/statement_store/common.rs index 2e3c64791643..3605d183a30b 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/statement_store/common.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/statement_store/common.rs @@ -244,6 +244,8 @@ async fn launch_network( .with_relaychain(|r| { r.with_chain("westend-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec!["-lparachain=debug".into()]) .with_validator(|node| node.with_name("validator-0")) diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/statement_store/integration.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/statement_store/integration.rs index 380ee1c8a9b8..e42e63d137e8 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/statement_store/integration.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/statement_store/integration.rs @@ -233,6 +233,8 @@ async fn spawn_flooding_network( .with_relaychain(|r| { r.with_chain("westend-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec!["-lparachain=debug".into()]) .with_validator(|node| node.with_name("validator-0")) diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/sync_blocks.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/sync_blocks.rs index b9ab9c123c49..03f5f1d0a5f7 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/sync_blocks.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/sync_blocks.rs @@ -71,6 +71,8 @@ async fn build_network_config() -> Result { .with_relaychain(|r| { r.with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_default_resources(|resources| { @@ -84,6 +86,8 @@ async fn build_network_config() -> Result { .with_parachain(|p| { p.with_id(PARA_ID) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_collator(|n| n.with_name("dave").validator(false)) diff --git a/docs/sdk/src/polkadot_sdk/mod.rs b/docs/sdk/src/polkadot_sdk/mod.rs index 6fcff250d80f..f60d36bd8599 100644 --- a/docs/sdk/src/polkadot_sdk/mod.rs +++ b/docs/sdk/src/polkadot_sdk/mod.rs @@ -87,8 +87,8 @@ //! * [`frame-omni-bencher`]: a benchmarking tool for FRAME-based runtimes. Nodes typically contain //! a //! `benchmark` subcommand that does the same. -//! * [`chain_spec_builder`]: Utility to build chain-specs Nodes typically contain a `build-spec` -//! subcommand that does the same. +//! * [`chain_spec_builder`]: Utility to build chain-specs. Nodes typically contain an +//! `export-chain-spec` subcommand that does the same. //! * [`subkey`]: Substrate's key management utility. //! * [`substrate-node`](node_cli) is an extensive substrate node that contains the superset of all //! runtime and node side features. The corresponding runtime, called [`kitchensink_runtime`] diff --git a/docs/sdk/src/reference_docs/cli.rs b/docs/sdk/src/reference_docs/cli.rs index 6f393f267b0d..bb1b88003855 100644 --- a/docs/sdk/src/reference_docs/cli.rs +++ b/docs/sdk/src/reference_docs/cli.rs @@ -22,28 +22,24 @@ //! #### Generating Custom Chain Specification //! ```bash //! ./target/debug/node-template \ -//! build-spec \ -//! --disable-default-bootnode \ +//! export-chain-spec \ //! --chain local \ //! > customSpec.json //! ``` //! -//! - `build-spec`: A subcommand to generate a chain specification file. -//! - `--disable-default-bootnode`: Disables the default bootnodes in the node template. +//! - `export-chain-spec`: A subcommand to generate a chain specification file. //! - `--chain local`: Indicates the chain specification is for a local development chain. //! - `> customSpec.json`: Redirects the output into a customSpec.json file. //! //! #### Converting Chain Specification to Raw Format //! ```bash -//! ./target/debug/node-template build-spec \ +//! ./target/debug/node-template export-chain-spec \ //! --chain=customSpec.json \ //! --raw \ -//! --disable-default-bootnode \ //! > customSpecRaw.json //! ``` //! //! - `--chain=customSpec.json`: Uses the custom chain specification as input. -//! - `--disable-default-bootnode`: Disables the default bootnodes in the node template. //! - `--raw`: Converts the chain specification into a raw format with encoded storage keys. //! - `> customSpecRaw.json`: Outputs to `customSpecRaw.json`. //! diff --git a/polkadot/cli/src/cli.rs b/polkadot/cli/src/cli.rs index 16e5f1671f5a..f64f00fda9ba 100644 --- a/polkadot/cli/src/cli.rs +++ b/polkadot/cli/src/cli.rs @@ -24,14 +24,6 @@ use std::path::PathBuf; #[allow(missing_docs)] #[derive(Debug, Parser)] pub enum Subcommand { - /// Build a chain specification. - /// DEPRECATED: `build-spec` command will be removed after 1/04/2026. Use `export-chain-spec` - /// command instead. - #[deprecated( - note = "build-spec command will be removed after 1/04/2026. Use export-chain-spec command instead" - )] - BuildSpec(sc_cli::BuildSpecCmd), - /// Export the chain specification. ExportChainSpec(sc_cli::ExportChainSpecCmd), diff --git a/polkadot/cli/src/command.rs b/polkadot/cli/src/command.rs index c25d64f78a15..ffd8ef43426f 100644 --- a/polkadot/cli/src/command.rs +++ b/polkadot/cli/src/command.rs @@ -350,11 +350,6 @@ pub fn run() -> Result<()> { None, polkadot_node_metrics::logger_hook(), ), - #[allow(deprecated)] - Some(Subcommand::BuildSpec(cmd)) => { - let runner = cli.create_runner(cmd)?; - Ok(runner.sync_run(|config| cmd.run(config.chain_spec, config.network))?) - }, Some(Subcommand::ExportChainSpec(cmd)) => { // Directly load the embedded chain spec using the CLI’s load_spec method. let spec = cli.load_spec(&cmd.chain)?; diff --git a/polkadot/zombienet-sdk-tests/tests/disabling/slashing.rs b/polkadot/zombienet-sdk-tests/tests/disabling/slashing.rs index 327f2be94894..c8db80866ff6 100644 --- a/polkadot/zombienet-sdk-tests/tests/disabling/slashing.rs +++ b/polkadot/zombienet-sdk-tests/tests/disabling/slashing.rs @@ -32,6 +32,8 @@ async fn dispute_past_session_slashing() -> Result<(), anyhow::Error> { .with_relaychain(|r| { r.with_chain("westend-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![ "--no-hardware-benchmarks".into(), @@ -72,6 +74,10 @@ async fn dispute_past_session_slashing() -> Result<(), anyhow::Error> { .with_parachain(|p| { p.with_id(1337) .with_default_command("polkadot-parachain") + .with_chain_spec_command( + "polkadot-parachain export-chain-spec --chain {{chainName}}", + ) + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_default_args(vec!["-lparachain=debug".into()]) .with_collator(|n| n.with_name("collator-1337")) diff --git a/polkadot/zombienet-sdk-tests/tests/elastic_scaling/basic_3cores.rs b/polkadot/zombienet-sdk-tests/tests/elastic_scaling/basic_3cores.rs index fc295e5f9d12..97ac296c0602 100644 --- a/polkadot/zombienet-sdk-tests/tests/elastic_scaling/basic_3cores.rs +++ b/polkadot/zombienet-sdk-tests/tests/elastic_scaling/basic_3cores.rs @@ -26,6 +26,8 @@ async fn basic_3cores_test() -> Result<(), anyhow::Error> { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_genesis_overrides(json!({ @@ -49,6 +51,8 @@ async fn basic_3cores_test() -> Result<(), anyhow::Error> { .with_parachain(|p| { p.with_id(2000) .with_default_command("adder-collator") + .with_chain_spec_command("adder-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .cumulus_based(false) .with_default_image(images.cumulus.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) @@ -57,6 +61,8 @@ async fn basic_3cores_test() -> Result<(), anyhow::Error> { .with_parachain(|p| { p.with_id(2001) .with_default_command("adder-collator") + .with_chain_spec_command("adder-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .cumulus_based(false) .with_default_image(images.cumulus.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) diff --git a/polkadot/zombienet-sdk-tests/tests/elastic_scaling/doesnt_break_parachains.rs b/polkadot/zombienet-sdk-tests/tests/elastic_scaling/doesnt_break_parachains.rs index a04d1b015902..eac7397a7108 100644 --- a/polkadot/zombienet-sdk-tests/tests/elastic_scaling/doesnt_break_parachains.rs +++ b/polkadot/zombienet-sdk-tests/tests/elastic_scaling/doesnt_break_parachains.rs @@ -30,6 +30,8 @@ async fn doesnt_break_parachains_test() -> Result<(), anyhow::Error> { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_genesis_overrides(json!({ @@ -54,6 +56,10 @@ async fn doesnt_break_parachains_test() -> Result<(), anyhow::Error> { // Use default, which has 6 second slot time. Also, don't use slot-based collator. p.with_id(2000) .with_default_command("polkadot-parachain") + .with_chain_spec_command( + "polkadot-parachain export-chain-spec --chain {{chainName}}", + ) + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_default_args(vec![("-lparachain=debug,aura=debug").into()]) .with_collator(|n| n.with_name("collator-2000")) diff --git a/polkadot/zombienet-sdk-tests/tests/elastic_scaling/slot_based_12cores.rs b/polkadot/zombienet-sdk-tests/tests/elastic_scaling/slot_based_12cores.rs index c830ba84e343..1b6dd2fc7095 100644 --- a/polkadot/zombienet-sdk-tests/tests/elastic_scaling/slot_based_12cores.rs +++ b/polkadot/zombienet-sdk-tests/tests/elastic_scaling/slot_based_12cores.rs @@ -32,6 +32,8 @@ async fn slot_based_12cores_test() -> Result<(), anyhow::Error> { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_genesis_overrides(json!({ @@ -59,6 +61,8 @@ async fn slot_based_12cores_test() -> Result<(), anyhow::Error> { .with_parachain(|p| { p.with_id(2300) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("elastic-scaling-500ms") .with_default_args(vec![ diff --git a/polkadot/zombienet-sdk-tests/tests/elastic_scaling/slot_based_3cores.rs b/polkadot/zombienet-sdk-tests/tests/elastic_scaling/slot_based_3cores.rs index aaa513dd7213..c570cd9f15b5 100644 --- a/polkadot/zombienet-sdk-tests/tests/elastic_scaling/slot_based_3cores.rs +++ b/polkadot/zombienet-sdk-tests/tests/elastic_scaling/slot_based_3cores.rs @@ -29,6 +29,8 @@ async fn slot_based_3cores_test() -> Result<(), anyhow::Error> { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_genesis_overrides(json!({ @@ -56,6 +58,8 @@ async fn slot_based_3cores_test() -> Result<(), anyhow::Error> { .with_parachain(|p| { p.with_id(2100) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("elastic-scaling-mvp") .with_default_args(vec![ @@ -67,6 +71,8 @@ async fn slot_based_3cores_test() -> Result<(), anyhow::Error> { .with_parachain(|p| { p.with_id(2200) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("elastic-scaling") .with_default_args(vec![ diff --git a/polkadot/zombienet-sdk-tests/tests/functional/approval_voting_coalescing.rs b/polkadot/zombienet-sdk-tests/tests/functional/approval_voting_coalescing.rs index bd51069b5d4f..e9b1875d28b2 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/approval_voting_coalescing.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/approval_voting_coalescing.rs @@ -24,6 +24,8 @@ async fn approval_voting_coalescing_test() -> Result<(), anyhow::Error> { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug,runtime=debug").into()]) .with_genesis_overrides(json!({ @@ -49,6 +51,8 @@ async fn approval_voting_coalescing_test() -> Result<(), anyhow::Error> { config_builder = config_builder.with_parachain(|p| { p.with_id(para_id) .with_default_command("undying-collator") + .with_chain_spec_command("undying-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image( std::env::var("COL_IMAGE") .unwrap_or("docker.io/paritypr/colander:latest".to_string()) diff --git a/polkadot/zombienet-sdk-tests/tests/functional/approved_peer_mixed_validators.rs b/polkadot/zombienet-sdk-tests/tests/functional/approved_peer_mixed_validators.rs index 383cf217dfa2..8418ebb6a72c 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/approved_peer_mixed_validators.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/approved_peer_mixed_validators.rs @@ -31,6 +31,8 @@ async fn approved_peer_mixed_validators_test() -> Result<(), anyhow::Error> { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_genesis_overrides(json!({ @@ -70,6 +72,8 @@ async fn approved_peer_mixed_validators_test() -> Result<(), anyhow::Error> { .with_parachain(|p| { p.with_id(2000) .with_default_command("undying-collator") + .with_chain_spec_command("undying-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image( std::env::var("COL_IMAGE") .unwrap_or("docker.io/paritypr/colander:latest".to_string()) @@ -86,6 +90,8 @@ async fn approved_peer_mixed_validators_test() -> Result<(), anyhow::Error> { .with_parachain(|p| { p.with_id(2001) .with_default_command("undying-collator") + .with_chain_spec_command("undying-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image( std::env::var("COL_IMAGE") .unwrap_or("docker.io/paritypr/colander:latest".to_string()) diff --git a/polkadot/zombienet-sdk-tests/tests/functional/async_backing_6_seconds_rate.rs b/polkadot/zombienet-sdk-tests/tests/functional/async_backing_6_seconds_rate.rs index 52dda31c4230..d4c023b72eff 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/async_backing_6_seconds_rate.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/async_backing_6_seconds_rate.rs @@ -26,6 +26,8 @@ async fn async_backing_6_seconds_rate_test() -> Result<(), anyhow::Error> { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_genesis_overrides(json!({ @@ -46,6 +48,8 @@ async fn async_backing_6_seconds_rate_test() -> Result<(), anyhow::Error> { .with_parachain(|p| { p.with_id(2000) .with_default_command("adder-collator") + .with_chain_spec_command("adder-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image( std::env::var("COL_IMAGE") .unwrap_or("docker.io/paritypr/colander:latest".to_string()) @@ -58,6 +62,10 @@ async fn async_backing_6_seconds_rate_test() -> Result<(), anyhow::Error> { .with_parachain(|p| { p.with_id(2001) .with_default_command("polkadot-parachain") + .with_chain_spec_command( + "polkadot-parachain export-chain-spec --chain {{chainName}}", + ) + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_default_args(vec![("-lparachain=debug,aura=debug").into()]) .with_collator(|n| n.with_name("collator-2001")) diff --git a/polkadot/zombienet-sdk-tests/tests/functional/beefy_and_mmr.rs b/polkadot/zombienet-sdk-tests/tests/functional/beefy_and_mmr.rs index 859c45fe161b..8dd45e2be29f 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/beefy_and_mmr.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/beefy_and_mmr.rs @@ -230,6 +230,8 @@ fn build_network_config() -> Result { let mut builder = NetworkConfigBuilder::new().with_relaychain(|r| { r.with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(polkadot_image.as_str()) .with_default_args(vec![ "--log=beefy=debug".into(), diff --git a/polkadot/zombienet-sdk-tests/tests/functional/chunk_fetching_network_compatibility.rs b/polkadot/zombienet-sdk-tests/tests/functional/chunk_fetching_network_compatibility.rs index eac17eb2e756..edd2a2093da5 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/chunk_fetching_network_compatibility.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/chunk_fetching_network_compatibility.rs @@ -122,6 +122,8 @@ fn build_network_config() -> Result { r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(polkadot_image.as_str()) .with_default_args(vec!["-lparachain=debug,runtime=debug".into()]) .with_genesis_overrides(json!({ @@ -178,6 +180,11 @@ fn build_network_config() -> Result { // Use an old image that does not send out v2 receipts, as the old validators will // still check the collator signatures. .with_default_command(format!("polkadot-parachain{old_suffix}").as_str()) + .with_chain_spec_command( + format!("polkadot-parachain{old_suffix} export-chain-spec --chain {{{{chainName}}}}") + .as_str(), + ) + .chain_spec_command_is_local(true) .with_default_args(vec!["-lparachain=debug".into()]) .with_collator(|n| n.with_name(&format!("collator-{para_id}"))) }) diff --git a/polkadot/zombienet-sdk-tests/tests/functional/collators_reputation_persistence.rs b/polkadot/zombienet-sdk-tests/tests/functional/collators_reputation_persistence.rs index 3f892e0225bb..fc67fdbce6f7 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/collators_reputation_persistence.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/collators_reputation_persistence.rs @@ -65,6 +65,8 @@ async fn comprehensive_reputation_persistence_test() -> Result<(), anyhow::Error let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![ ("-lparachain=debug,parachain::collator-protocol=trace").into(), @@ -91,6 +93,8 @@ async fn comprehensive_reputation_persistence_test() -> Result<(), anyhow::Error .with_parachain(|p| { p.with_id(PARA_ID_1) .with_default_command("undying-collator") + .with_chain_spec_command("undying-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .cumulus_based(false) .with_default_image( std::env::var("COL_IMAGE") @@ -106,6 +110,8 @@ async fn comprehensive_reputation_persistence_test() -> Result<(), anyhow::Error .with_parachain(|p| { p.with_id(PARA_ID_2) .with_default_command("undying-collator") + .with_chain_spec_command("undying-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .cumulus_based(false) .with_default_image( std::env::var("COL_IMAGE") diff --git a/polkadot/zombienet-sdk-tests/tests/functional/coretime_collation_fetching_fairness.rs b/polkadot/zombienet-sdk-tests/tests/functional/coretime_collation_fetching_fairness.rs index fe768010e003..cbb0b3fdc5a4 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/coretime_collation_fetching_fairness.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/coretime_collation_fetching_fairness.rs @@ -136,6 +136,8 @@ fn build_network_config() -> Result { let mut builder = NetworkConfigBuilder::new().with_relaychain(|r| { r.with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(polkadot_image.as_str()) .with_default_args(vec!["-lparachain=debug,runtime=debug".into()]) .with_genesis_overrides(json!({ @@ -184,6 +186,10 @@ fn build_network_config() -> Result { })) .with_default_image(col_image.as_str()) .with_default_command("polkadot-parachain") + .with_chain_spec_command( + "polkadot-parachain export-chain-spec --chain {{chainName}}", + ) + .chain_spec_command_is_local(true) .with_default_args(args) .with_collator(|n| n.with_name(&format!("collator-{para_id}"))) }) diff --git a/polkadot/zombienet-sdk-tests/tests/functional/coretime_partitioning.rs b/polkadot/zombienet-sdk-tests/tests/functional/coretime_partitioning.rs index b4230e33d75f..c7efd8172e08 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/coretime_partitioning.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/coretime_partitioning.rs @@ -241,6 +241,8 @@ async fn build_network_config() -> Result { .with_relaychain(|r| { r.with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![ ("-lruntime=debug").into(), @@ -267,6 +269,10 @@ async fn build_network_config() -> Result { p.with_id(PARA_A) .with_chain(chain_a) .with_default_command("polkadot-parachain") + .with_chain_spec_command( + "polkadot-parachain export-chain-spec --chain {{chainName}}", + ) + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_registration_strategy(zombienet_sdk::RegistrationStrategy::Manual) .onboard_as_parachain(false) @@ -277,6 +283,10 @@ async fn build_network_config() -> Result { p.with_id(PARA_B) .with_chain(chain_b) .with_default_command("polkadot-parachain") + .with_chain_spec_command( + "polkadot-parachain export-chain-spec --chain {{chainName}}", + ) + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_registration_strategy(zombienet_sdk::RegistrationStrategy::Manual) .onboard_as_parachain(false) diff --git a/polkadot/zombienet-sdk-tests/tests/functional/coretime_shared_core.rs b/polkadot/zombienet-sdk-tests/tests/functional/coretime_shared_core.rs index 1c413602dfa6..efbb991a28c2 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/coretime_shared_core.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/coretime_shared_core.rs @@ -138,6 +138,8 @@ fn build_network_config(number_of_paras: u32) -> Result Result Result { let mut builder = NetworkConfigBuilder::new().with_relaychain(|r| { r.with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(polkadot_image.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_genesis_overrides(json!({ @@ -166,6 +168,8 @@ fn build_network_config() -> Result { .cumulus_based(false) .with_default_image(col_image.as_str()) .with_default_command("undying-collator") + .with_chain_spec_command("undying-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_args(vec!["-lparachain=debug".into()]) .with_collator(|n| n.with_name("collator")) }); diff --git a/polkadot/zombienet-sdk-tests/tests/functional/dispute_old_finalized.rs b/polkadot/zombienet-sdk-tests/tests/functional/dispute_old_finalized.rs index f04c7afd7907..784188497a89 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/dispute_old_finalized.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/dispute_old_finalized.rs @@ -34,6 +34,8 @@ async fn dispute_old_finalized() -> Result<(), anyhow::Error> { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_genesis_overrides(json!({ @@ -90,6 +92,8 @@ async fn dispute_old_finalized() -> Result<(), anyhow::Error> { .as_str(), ) .with_default_command("undying-collator") + .with_chain_spec_command("undying-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_args(vec!["-lparachain=debug".into()]) .with_collator(|n| n.with_name("collator")) }) diff --git a/polkadot/zombienet-sdk-tests/tests/functional/duplicate_collations.rs b/polkadot/zombienet-sdk-tests/tests/functional/duplicate_collations.rs index ddb691ab6214..cbcbf332a7c9 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/duplicate_collations.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/duplicate_collations.rs @@ -31,6 +31,8 @@ async fn duplicate_collations_test() -> Result<(), anyhow::Error> { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_genesis_overrides(json!({ @@ -56,6 +58,8 @@ async fn duplicate_collations_test() -> Result<(), anyhow::Error> { .with_parachain(|p| { p.with_id(2000) .with_default_command("undying-collator") + .with_chain_spec_command("undying-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .cumulus_based(false) .with_default_image( std::env::var("COL_IMAGE") diff --git a/polkadot/zombienet-sdk-tests/tests/functional/parachains_disputes.rs b/polkadot/zombienet-sdk-tests/tests/functional/parachains_disputes.rs index 207b681fdcaa..26bc9f800877 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/parachains_disputes.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/parachains_disputes.rs @@ -146,6 +146,8 @@ fn build_network_config() -> Result { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(polkadot_image.as_str()) .with_default_args(vec!["-lparachain=debug".into()]) .with_genesis_overrides(json!({ @@ -209,6 +211,8 @@ fn build_network_config() -> Result { .cumulus_based(false) .with_default_image(col_image.as_str()) .with_default_command("undying-collator") + .with_chain_spec_command("undying-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_args(vec![ "-lruntime=debug,parachain=trace".into(), format!("--pov-size={pov_size}").as_str().into(), diff --git a/polkadot/zombienet-sdk-tests/tests/functional/parachains_disputes_garbage_candidate.rs b/polkadot/zombienet-sdk-tests/tests/functional/parachains_disputes_garbage_candidate.rs index e9a855f36217..0a4ef2650bc3 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/parachains_disputes_garbage_candidate.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/parachains_disputes_garbage_candidate.rs @@ -164,6 +164,8 @@ fn build_network_config() -> Result { let mut builder = NetworkConfigBuilder::new().with_relaychain(|r| { r.with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(polkadot_image.as_str()) .with_default_args(vec!["-lparachain=debug,runtime=debug".into()]) .with_genesis_overrides(json!({ @@ -206,6 +208,8 @@ fn build_network_config() -> Result { .cumulus_based(false) .with_default_image(col_image.as_str()) .with_default_command("undying-collator") + .with_chain_spec_command("undying-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_args(vec![ "-lruntime=debug,parachain=trace".into(), format!("--pov-size={pov_size}").as_str().into(), diff --git a/polkadot/zombienet-sdk-tests/tests/functional/parachains_max_tranche0.rs b/polkadot/zombienet-sdk-tests/tests/functional/parachains_max_tranche0.rs index 3dcad7bf6ab9..9a6d69a629ec 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/parachains_max_tranche0.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/parachains_max_tranche0.rs @@ -94,6 +94,8 @@ fn build_network_config() -> Result { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(polkadot_image.as_str()) .with_default_args(vec!["-lparachain=debug,runtime=debug".into()]) .with_genesis_overrides(json!({ @@ -138,6 +140,8 @@ fn build_network_config() -> Result { .cumulus_based(false) .with_default_image(col_image.as_str()) .with_default_command("undying-collator") + .with_chain_spec_command("undying-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_args(vec![ "-lruntime=debug,parachain=trace".into(), format!("--pov-size={pov_size}").as_str().into(), diff --git a/polkadot/zombienet-sdk-tests/tests/functional/parachains_pvf.rs b/polkadot/zombienet-sdk-tests/tests/functional/parachains_pvf.rs index 42f716f11944..9caaa8fcb01f 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/parachains_pvf.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/parachains_pvf.rs @@ -132,6 +132,8 @@ fn build_network_config() -> Result { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(polkadot_image.as_str()) .with_default_args(vec!["-lparachain=debug,runtime=debug".into()]) .with_default_resources(|r| { @@ -157,6 +159,8 @@ fn build_network_config() -> Result { .cumulus_based(false) .with_default_image(col_image.as_str()) .with_default_command("undying-collator") + .with_chain_spec_command("undying-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_args(vec![ "-lruntime=debug,parachain=trace".into(), format!("--pov-size={pov_size}").as_str().into(), diff --git a/polkadot/zombienet-sdk-tests/tests/functional/scheduling_v3.rs b/polkadot/zombienet-sdk-tests/tests/functional/scheduling_v3.rs index 89b1a4854fde..889eb0633b5a 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/scheduling_v3.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/scheduling_v3.rs @@ -62,6 +62,8 @@ async fn scheduling_v2_and_v3_collator_with_v3_validators( let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug,runtime=debug,parachain::candidate-backing=debug,parachain::provisioner=debug,parachain::prospective-parachains=debug,runtime::parachains::scheduler=debug,parachain::collator-protocol=debug,basic-authorship=debug,parachain::statement-distribution=debug").into()]) .with_genesis_overrides(json!({ @@ -94,6 +96,8 @@ async fn scheduling_v2_and_v3_collator_with_v3_validators( .with_parachain(|p| { p.with_id(2700) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain(parachain) .with_default_args(vec![ @@ -106,6 +110,8 @@ async fn scheduling_v2_and_v3_collator_with_v3_validators( .with_parachain(|p| { p.with_id(2500) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("async-backing") .with_default_args(vec![ @@ -207,6 +213,8 @@ async fn scheduling_v3_es_collator_with_v3_validators() -> Result<(), anyhow::Er let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug,runtime=debug,parachain::candidate-backing=debug,parachain::provisioner=debug,parachain::prospective-parachains=debug,runtime::parachains::scheduler=debug,parachain::collator-protocol=debug,basic-authorship=debug,parachain::statement-distribution=debug").into()]) .with_genesis_overrides(json!({ @@ -239,6 +247,8 @@ async fn scheduling_v3_es_collator_with_v3_validators() -> Result<(), anyhow::Er .with_parachain(|p| { p.with_id(2800) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("elastic-scaling-v3") .with_default_args(vec![ diff --git a/polkadot/zombienet-sdk-tests/tests/functional/shared_core_idle_parachain.rs b/polkadot/zombienet-sdk-tests/tests/functional/shared_core_idle_parachain.rs index 9af68bdda9c6..6eba586a444d 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/shared_core_idle_parachain.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/shared_core_idle_parachain.rs @@ -28,6 +28,8 @@ async fn shared_core_idle_parachain_test() -> Result<(), anyhow::Error> { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_genesis_overrides(json!({ @@ -52,6 +54,10 @@ async fn shared_core_idle_parachain_test() -> Result<(), anyhow::Error> { // assign it to the para. .onboard_as_parachain(false) .with_default_command("polkadot-parachain") + .with_chain_spec_command( + "polkadot-parachain export-chain-spec --chain {{chainName}}", + ) + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_default_args(vec![ ("-lparachain=debug,aura=debug").into(), diff --git a/polkadot/zombienet-sdk-tests/tests/functional/spam_statement_distribution_requests.rs b/polkadot/zombienet-sdk-tests/tests/functional/spam_statement_distribution_requests.rs index ad0c189b1e59..8b1d73109122 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/spam_statement_distribution_requests.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/spam_statement_distribution_requests.rs @@ -27,6 +27,8 @@ async fn spam_statement_distribution_requests_test() -> Result<(), anyhow::Error .with_relaychain(|r| { r.with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![ // parachain::statement-distribution=trace to find @@ -73,6 +75,8 @@ async fn spam_statement_distribution_requests_test() -> Result<(), anyhow::Error .with_parachain(|p| { p.with_id(2000) .with_default_command("undying-collator") + .with_chain_spec_command("undying-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .cumulus_based(false) .with_default_image( std::env::var("COL_IMAGE") @@ -85,6 +89,8 @@ async fn spam_statement_distribution_requests_test() -> Result<(), anyhow::Error .with_parachain(|p| { p.with_id(2001) .with_default_command("undying-collator") + .with_chain_spec_command("undying-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .cumulus_based(false) .with_default_image( std::env::var("COL_IMAGE") diff --git a/polkadot/zombienet-sdk-tests/tests/functional/sync_backing.rs b/polkadot/zombienet-sdk-tests/tests/functional/sync_backing.rs index 6fc04f58204a..fd9cd0c9c2c7 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/sync_backing.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/sync_backing.rs @@ -26,6 +26,8 @@ async fn sync_backing_test() -> Result<(), anyhow::Error> { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_genesis_overrides(json!({ @@ -46,6 +48,8 @@ async fn sync_backing_test() -> Result<(), anyhow::Error> { .with_parachain(|p| { p.with_id(2500) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("sync-backing") .with_default_args(vec![("-lparachain=debug,aura=debug").into()]) diff --git a/polkadot/zombienet-sdk-tests/tests/functional/systematic_chunk_recovery.rs b/polkadot/zombienet-sdk-tests/tests/functional/systematic_chunk_recovery.rs index f9519ae4d958..a65a22676558 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/systematic_chunk_recovery.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/systematic_chunk_recovery.rs @@ -148,6 +148,8 @@ fn build_network_config() -> Result { r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(polkadot_image.as_str()) .with_default_args(vec!["-lparachain=debug,runtime=debug".into()]) .with_genesis_overrides(json!({ @@ -193,6 +195,10 @@ fn build_network_config() -> Result { })) .with_default_image(col_image.as_str()) .with_default_command("polkadot-parachain") + .with_chain_spec_command( + "polkadot-parachain export-chain-spec --chain {{chainName}}", + ) + .chain_spec_command_is_local(true) .with_default_args(vec![ "-lparachain=debug".into(), "--authoring=slot-based".into(), diff --git a/polkadot/zombienet-sdk-tests/tests/functional/v3_dynamic_enablement.rs b/polkadot/zombienet-sdk-tests/tests/functional/v3_dynamic_enablement.rs index 485c15f6657f..54dd2098523f 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/v3_dynamic_enablement.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/v3_dynamic_enablement.rs @@ -38,6 +38,8 @@ async fn v3_dynamic_enablement_test() -> Result<(), anyhow::Error> { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug,runtime=debug").into()]) .with_genesis_overrides(json!({ @@ -75,6 +77,8 @@ async fn v3_dynamic_enablement_test() -> Result<(), anyhow::Error> { .with_parachain(|p| { p.with_id(2900) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_default_args(vec![("-lparachain=debug,aura=debug").into()]) .with_collator(|n| n.with_name("collator-2900")) @@ -82,6 +86,8 @@ async fn v3_dynamic_enablement_test() -> Result<(), anyhow::Error> { .with_parachain(|p| { p.with_id(2901) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("elastic-scaling") .with_default_args(vec![ diff --git a/polkadot/zombienet-sdk-tests/tests/functional/v3_rolling_upgrade.rs b/polkadot/zombienet-sdk-tests/tests/functional/v3_rolling_upgrade.rs index bc2390b4dbca..6729dba7f91c 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/v3_rolling_upgrade.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/v3_rolling_upgrade.rs @@ -43,6 +43,8 @@ async fn v3_rolling_upgrade() -> Result<(), anyhow::Error> { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug,runtime=debug").into()]) .with_genesis_overrides(json!({ @@ -72,6 +74,8 @@ async fn v3_rolling_upgrade() -> Result<(), anyhow::Error> { .with_parachain(|p| { p.with_id(3000) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("async-backing") .with_default_args(vec![ diff --git a/polkadot/zombienet-sdk-tests/tests/functional/validator_disabling.rs b/polkadot/zombienet-sdk-tests/tests/functional/validator_disabling.rs index 6aa7ed310b67..4540d8543bfc 100644 --- a/polkadot/zombienet-sdk-tests/tests/functional/validator_disabling.rs +++ b/polkadot/zombienet-sdk-tests/tests/functional/validator_disabling.rs @@ -25,6 +25,8 @@ async fn validator_disabling_test() -> Result<(), anyhow::Error> { let r = r .with_chain("westend-local") // Use westend-local so the disabling can take effect. .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_genesis_overrides(json!({ @@ -69,6 +71,8 @@ async fn validator_disabling_test() -> Result<(), anyhow::Error> { .with_parachain(|p| { p.with_id(1000) .with_default_command("adder-collator") + .with_chain_spec_command("adder-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .cumulus_based(false) .with_default_image(images.cumulus.as_str()) .with_default_args(vec!["-lparachain=debug".into()]) diff --git a/polkadot/zombienet-sdk-tests/tests/misc/malus_dispute_valid_block.rs b/polkadot/zombienet-sdk-tests/tests/misc/malus_dispute_valid_block.rs index 316116c8a4ed..f3693715511d 100644 --- a/polkadot/zombienet-sdk-tests/tests/misc/malus_dispute_valid_block.rs +++ b/polkadot/zombienet-sdk-tests/tests/misc/malus_dispute_valid_block.rs @@ -68,6 +68,8 @@ fn build_network_config() -> Result { .with_relaychain(|r| { r.with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(polkadot_image.as_str()) .with_default_args(vec!["-lparachain=debug".into()]) .with_default_resources(|r| { @@ -94,6 +96,8 @@ fn build_network_config() -> Result { .cumulus_based(false) .with_default_image(col_image.as_str()) .with_default_command("adder-collator") + .with_chain_spec_command("adder-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_collator(|n| n.with_name("collator")) }) .with_global_settings(|global_settings| match std::env::var("ZOMBIENET_SDK_BASE_DIR") { diff --git a/polkadot/zombienet-sdk-tests/tests/misc/paritydb.rs b/polkadot/zombienet-sdk-tests/tests/misc/paritydb.rs index 49c1f853760e..d8e099280830 100644 --- a/polkadot/zombienet-sdk-tests/tests/misc/paritydb.rs +++ b/polkadot/zombienet-sdk-tests/tests/misc/paritydb.rs @@ -100,6 +100,8 @@ fn build_network_config() -> Result { let mut builder = NetworkConfigBuilder::new().with_relaychain(|r| { r.with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(polkadot_image.as_str()) .with_default_args(vec![ "-lparachain=debug,runtime=debug".into(), @@ -135,6 +137,8 @@ fn build_network_config() -> Result { .cumulus_based(false) .with_default_image(col_image.as_str()) .with_default_command("undying-collator") + .with_chain_spec_command("undying-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_args(vec![ "-lruntime=debug,parachain=trace".into(), format!("--pov-size={pov_size}").as_str().into(), diff --git a/polkadot/zombienet-sdk-tests/tests/parachains/weights.rs b/polkadot/zombienet-sdk-tests/tests/parachains/weights.rs index 34cbfc7a18fc..740b12221872 100644 --- a/polkadot/zombienet-sdk-tests/tests/parachains/weights.rs +++ b/polkadot/zombienet-sdk-tests/tests/parachains/weights.rs @@ -159,6 +159,8 @@ async fn setup_network() -> Result, anyhow::Error> { .with_relaychain(|r| { r.with_chain("westend-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_default_db_snapshot("https://storage.googleapis.com/zombienet-db-snaps/polkadot/test_weights/relaychain.tgz") @@ -168,6 +170,8 @@ async fn setup_network() -> Result, anyhow::Error> { .with_parachain(|p| { p.with_id(2000) .with_default_command("polkadot-parachain") + .with_chain_spec_command("polkadot-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image( std::env::var("COL_IMAGE") .unwrap_or("docker.io/paritypr/colander:latest".to_string()) diff --git a/polkadot/zombienet-sdk-tests/tests/smoke/coretime_revenue.rs b/polkadot/zombienet-sdk-tests/tests/smoke/coretime_revenue.rs index a3e62e6e34ea..adef3bb0b0f3 100644 --- a/polkadot/zombienet-sdk-tests/tests/smoke/coretime_revenue.rs +++ b/polkadot/zombienet-sdk-tests/tests/smoke/coretime_revenue.rs @@ -233,6 +233,8 @@ async fn coretime_revenue_test() -> Result<(), anyhow::Error> { .with_relaychain(|r| { r.with_chain("westend-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_genesis_overrides( json!({ "configuration": { "config": { "scheduler_params": { "on_demand_base_fee": ON_DEMAND_BASE_FEE }}}}), @@ -244,6 +246,8 @@ async fn coretime_revenue_test() -> Result<(), anyhow::Error> { .with_parachain(|p| { p.with_id(1005) .with_default_command("polkadot-parachain") + .with_chain_spec_command("polkadot-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("coretime-westend-local") .with_collator(|n| n.with_name("coretime")) diff --git a/polkadot/zombienet-sdk-tests/tests/smoke/coretime_smoke.rs b/polkadot/zombienet-sdk-tests/tests/smoke/coretime_smoke.rs index a9687dd24475..8c83b067f810 100644 --- a/polkadot/zombienet-sdk-tests/tests/smoke/coretime_smoke.rs +++ b/polkadot/zombienet-sdk-tests/tests/smoke/coretime_smoke.rs @@ -124,6 +124,8 @@ fn build_network_config() -> Result { .with_relaychain(|r| { r.with_chain("westend-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(polkadot_image.as_str()) .with_validator(|node| { node.with_name("alice").with_args(vec![("-lruntime=debug,xcm=trace").into()]) @@ -140,6 +142,10 @@ fn build_network_config() -> Result { .with_parachain(|p| { p.with_id(CORETIME_PARA_ID) .with_default_command("polkadot-parachain") + .with_chain_spec_command( + "polkadot-parachain export-chain-spec --chain {{chainName}}", + ) + .chain_spec_command_is_local(true) .with_default_image(cumulus_image.as_str()) .with_chain("coretime-westend-local") // Add sudo key @@ -155,6 +161,8 @@ fn build_network_config() -> Result { p.with_id(TEST_PARA_ID) .with_registration_strategy(RegistrationStrategy::Manual) .with_default_command("test-parachain") + .with_chain_spec_command("test-parachain export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(cumulus_image.as_str()) .with_collator(|n| { n.with_name("collator-para-100").with_args(vec![ diff --git a/polkadot/zombienet-sdk-tests/tests/smoke/deregister_register_validator.rs b/polkadot/zombienet-sdk-tests/tests/smoke/deregister_register_validator.rs index 9927cb083fd0..46c3a3d226a1 100644 --- a/polkadot/zombienet-sdk-tests/tests/smoke/deregister_register_validator.rs +++ b/polkadot/zombienet-sdk-tests/tests/smoke/deregister_register_validator.rs @@ -137,6 +137,8 @@ fn build_network_config() -> Result { .with_relaychain(|r| { r.with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(polkadot_image.as_str()) .with_default_args(vec![("-lruntime=debug,parachain=trace").into()]) .with_validator(|node| node.with_name("alice")) diff --git a/polkadot/zombienet-sdk-tests/tests/smoke/parachains_smoke.rs b/polkadot/zombienet-sdk-tests/tests/smoke/parachains_smoke.rs index 5e898952a553..6f2d721b1616 100644 --- a/polkadot/zombienet-sdk-tests/tests/smoke/parachains_smoke.rs +++ b/polkadot/zombienet-sdk-tests/tests/smoke/parachains_smoke.rs @@ -56,6 +56,8 @@ fn build_network_config() -> Result { .with_relaychain(|r| { r.with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(polkadot_image.as_str()) .with_validator(|node| { node.with_name("alice") @@ -70,6 +72,8 @@ fn build_network_config() -> Result { p.with_id(PARA_ID) .cumulus_based(false) .with_default_command("adder-collator") + .with_chain_spec_command("adder-collator export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(col_image.as_str()) .with_collator(|n| { n.with_name("collator01") diff --git a/polkadot/zombienet-sdk-tests/tests/smoke/precompile_pvf_smoke.rs b/polkadot/zombienet-sdk-tests/tests/smoke/precompile_pvf_smoke.rs index 9ea54daf9f3c..82f4626855f2 100644 --- a/polkadot/zombienet-sdk-tests/tests/smoke/precompile_pvf_smoke.rs +++ b/polkadot/zombienet-sdk-tests/tests/smoke/precompile_pvf_smoke.rs @@ -206,6 +206,8 @@ fn build_network_config() -> Result { .with_relaychain(|r| { r.with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(polkadot_image.as_str()) .with_default_args(vec![("-lruntime=debug,parachain=trace").into()]) .with_validator(|node| node.with_name("alice")) @@ -216,6 +218,10 @@ fn build_network_config() -> Result { .with_parachain(|p| { p.with_id(PARA_ID) .with_default_command("polkadot-parachain") + .with_chain_spec_command( + "polkadot-parachain export-chain-spec --chain {{chainName}}", + ) + .chain_spec_command_is_local(true) .with_default_image(cumulus_image.as_str()) .with_collator(|n| n.with_name("collator-2000")) }) diff --git a/prdoc/pr_12586.prdoc b/prdoc/pr_12586.prdoc new file mode 100644 index 000000000000..00db2183110a --- /dev/null +++ b/prdoc/pr_12586.prdoc @@ -0,0 +1,17 @@ +title: Remove deprecated build-spec CLI subcommand +doc: +- audience: Node Dev + description: |- + ## Summary + + - Remove the deprecated `build-spec` CLI subcommand and `BuildSpecCmd` from `sc-cli`. + - Migrate all callers (nodes, templates, scripts, docs, zombienet) to `export-chain-spec`. +crates: +- name: polkadot-omni-node-lib + bump: major +- name: polkadot-cli + bump: major +- name: staging-chain-spec-builder + bump: patch +- name: sc-cli + bump: major diff --git a/substrate/bin/node/cli/src/cli.rs b/substrate/bin/node/cli/src/cli.rs index 7c7335c06d49..01b411e536ef 100644 --- a/substrate/bin/node/cli/src/cli.rs +++ b/substrate/bin/node/cli/src/cli.rs @@ -116,14 +116,6 @@ pub enum Subcommand { /// Sign a message, with a given (secret) key. Sign(sc_cli::SignCmd), - /// Build a chain specification. - /// DEPRECATED: `build-spec` command will be removed after 1/04/2026. Use `export-chain-spec` - /// command instead. - #[deprecated( - note = "build-spec command will be removed after 1/04/2026. Use export-chain-spec command instead" - )] - BuildSpec(sc_cli::BuildSpecCmd), - /// Export the chain specification. ExportChainSpec(sc_cli::ExportChainSpecCmd), diff --git a/substrate/bin/node/cli/src/command.rs b/substrate/bin/node/cli/src/command.rs index ec8f391d596f..1997263f82c2 100644 --- a/substrate/bin/node/cli/src/command.rs +++ b/substrate/bin/node/cli/src/command.rs @@ -180,11 +180,6 @@ pub fn run() -> Result<()> { Some(Subcommand::Sign(cmd)) => cmd.run(), Some(Subcommand::Verify(cmd)) => cmd.run(), Some(Subcommand::Vanity(cmd)) => cmd.run(), - #[allow(deprecated)] - Some(Subcommand::BuildSpec(cmd)) => { - let runner = cli.create_runner(cmd)?; - runner.sync_run(|config| cmd.run(config.chain_spec, config.network)) - }, Some(Subcommand::CheckBlock(cmd)) => { let runner = cli.create_runner(cmd)?; runner.async_run(|config| { diff --git a/substrate/bin/node/cli/tests/build_spec_works.rs b/substrate/bin/node/cli/tests/export_chain_spec_works.rs similarity index 74% rename from substrate/bin/node/cli/tests/build_spec_works.rs rename to substrate/bin/node/cli/tests/export_chain_spec_works.rs index ce97dea6f6c8..527231bc2661 100644 --- a/substrate/bin/node/cli/tests/build_spec_works.rs +++ b/substrate/bin/node/cli/tests/export_chain_spec_works.rs @@ -18,22 +18,14 @@ use assert_cmd::cargo::cargo_bin; use std::process::Command; -use tempfile::tempdir; #[test] -fn build_spec_works() { - let base_path = tempdir().expect("could not create a temp dir"); - +fn export_chain_spec_works() { let output = Command::new(cargo_bin("substrate-node")) - .args(&["build-spec", "--dev", "-d"]) - .arg(base_path.path()) + .args(&["export-chain-spec", "--chain", "dev"]) .output() .unwrap(); assert!(output.status.success()); - // Make sure that the `dev` chain folder exists, but the `db` doesn't - assert!(base_path.path().join("chains/dev/").exists()); - assert!(!base_path.path().join("chains/dev/db").exists()); - let _value: serde_json::Value = serde_json::from_slice(output.stdout.as_slice()).unwrap(); } diff --git a/substrate/bin/utils/chain-spec-builder/README.docify.md b/substrate/bin/utils/chain-spec-builder/README.docify.md index 1b0f78d278c5..29c5d0f724dc 100644 --- a/substrate/bin/utils/chain-spec-builder/README.docify.md +++ b/substrate/bin/utils/chain-spec-builder/README.docify.md @@ -5,7 +5,8 @@ Substrate's chain spec builder utility. A chain-spec is short for `chain-specification`. See the [`sc-chain-spec`](https://crates.io/docs.rs/sc-chain-spec/latest/sc_chain_spec) for more information. -_Note:_ this binary is a more flexible alternative to the `build-spec` subcommand, contained in typical Substrate-based nodes. +_Note:_ this binary is a more flexible alternative to the `export-chain-spec` subcommand, +contained in typical Substrate-based nodes. This particular binary is capable of interacting with [`sp-genesis-builder`](https://docs.rs/sp-genesis-builder/latest/sp_genesis_builder/index.html) implementation of any provided runtime allowing to build chain-spec JSON files. diff --git a/substrate/bin/utils/chain-spec-builder/README.md b/substrate/bin/utils/chain-spec-builder/README.md index 31e843077649..381e371daf7a 100644 --- a/substrate/bin/utils/chain-spec-builder/README.md +++ b/substrate/bin/utils/chain-spec-builder/README.md @@ -5,7 +5,8 @@ Substrate's chain spec builder utility. A chain-spec is short for `chain-specification`. See the [`sc-chain-spec`](https://crates.io/docs.rs/sc-chain-spec/latest/sc_chain_spec) for more information. -_Note:_ this binary is a more flexible alternative to the `build-spec` subcommand, contained in typical Substrate-based nodes. +_Note:_ this binary is a more flexible alternative to the `export-chain-spec` subcommand, +contained in typical Substrate-based nodes. This particular binary is capable of interacting with [`sp-genesis-builder`](https://docs.rs/sp-genesis-builder/latest/sp_genesis_builder/index.html) implementation of any provided runtime allowing to build chain-spec JSON files. diff --git a/substrate/client/cli/src/commands/build_spec_cmd.rs b/substrate/client/cli/src/commands/build_spec_cmd.rs deleted file mode 100644 index df8c6b7d0baa..000000000000 --- a/substrate/client/cli/src/commands/build_spec_cmd.rs +++ /dev/null @@ -1,91 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -use crate::{ - error, - params::{NodeKeyParams, SharedParams}, - CliConfiguration, -}; -use clap::Parser; -use log::info; -use sc_network::config::build_multiaddr; -use sc_service::{ - config::{MultiaddrWithPeerId, NetworkConfiguration}, - ChainSpec, -}; -use std::io::Write; - -/// The `build-spec` command used to build a specification. -#[derive(Debug, Clone, Parser)] -pub struct BuildSpecCmd { - /// Force raw genesis storage output. - #[arg(long)] - pub raw: bool, - - /// Disable adding the default bootnode to the specification. - /// By default the `/ip4/127.0.0.1/tcp/30333/p2p/NODE_PEER_ID` bootnode is added to the - /// specification when no bootnode exists. - #[arg(long)] - pub disable_default_bootnode: bool, - - #[allow(missing_docs)] - #[clap(flatten)] - pub shared_params: SharedParams, - - #[allow(missing_docs)] - #[clap(flatten)] - pub node_key_params: NodeKeyParams, -} - -impl BuildSpecCmd { - /// Run the build-spec command - pub fn run( - &self, - mut spec: Box, - network_config: NetworkConfiguration, - ) -> error::Result<()> { - info!("Building chain spec"); - let raw_output = self.raw; - - if spec.boot_nodes().is_empty() && !self.disable_default_bootnode { - let keys = network_config.node_key.into_keypair()?; - let peer_id = keys.public().to_peer_id(); - let addr = MultiaddrWithPeerId { - multiaddr: build_multiaddr![Ip4([127, 0, 0, 1]), Tcp(30333u16)], - peer_id: peer_id.into(), - }; - spec.add_boot_node(addr) - } - - let json = sc_service::chain_ops::build_spec(&*spec, raw_output)?; - if std::io::stdout().write_all(json.as_bytes()).is_err() { - let _ = std::io::stderr().write_all(b"Error writing to stdout\n"); - } - Ok(()) - } -} - -impl CliConfiguration for BuildSpecCmd { - fn shared_params(&self) -> &SharedParams { - &self.shared_params - } - - fn node_key_params(&self) -> Option<&NodeKeyParams> { - Some(&self.node_key_params) - } -} diff --git a/substrate/client/cli/src/commands/export_chain_spec_cmd.rs b/substrate/client/cli/src/commands/export_chain_spec_cmd.rs index 6af475d5aa07..88ad7615aa40 100644 --- a/substrate/client/cli/src/commands/export_chain_spec_cmd.rs +++ b/substrate/client/cli/src/commands/export_chain_spec_cmd.rs @@ -31,17 +31,13 @@ use std::{ /// genesis config presets which can be referenced via `--chain ` . The logic for /// loading the chain spec into memory based on an `id` is specific to each /// node and is a prerequisite to enable this command. -/// -/// Same functionality can be achieved currently via -/// [`crate::commands::build_spec_cmd::BuildSpecCmd`] but we recommend -/// `export-chain-spec` in its stead. `build-spec` is known -/// to be a legacy mix of exporting chain specs to JSON files or -/// converting them to raw, which will be better -/// represented under `export-chain-spec`. #[derive(Debug, Clone, Parser)] pub struct ExportChainSpecCmd { /// The chain spec identifier to export. - #[arg(long, default_value = "local")] + /// + /// Defaults to the empty id, matching [`crate::SharedParams::chain_id`] / the old + /// `build-spec` behaviour when `--chain` is omitted. + #[arg(long, default_value = "")] pub chain: String, /// `chain-spec` JSON file path. If omitted, prints to stdout. diff --git a/substrate/client/cli/src/commands/mod.rs b/substrate/client/cli/src/commands/mod.rs index b63fb1d90423..4af474dc40a7 100644 --- a/substrate/client/cli/src/commands/mod.rs +++ b/substrate/client/cli/src/commands/mod.rs @@ -18,7 +18,6 @@ //! Various subcommands that can be included in a substrate-based chain's CLI. -mod build_spec_cmd; mod chain_info_cmd; mod check_block_cmd; mod export_blocks_cmd; @@ -41,7 +40,7 @@ mod vanity; mod verify; pub use self::{ - build_spec_cmd::BuildSpecCmd, chain_info_cmd::ChainInfoCmd, check_block_cmd::CheckBlockCmd, + chain_info_cmd::ChainInfoCmd, check_block_cmd::CheckBlockCmd, export_blocks_cmd::ExportBlocksCmd, export_chain_spec_cmd::ExportChainSpecCmd, export_state_cmd::ExportStateCmd, generate::GenerateCmd, generate_node_key::GenerateKeyCmdCommon, import_blocks_cmd::ImportBlocksCmd, diff --git a/substrate/client/cli/src/params/shared_params.rs b/substrate/client/cli/src/params/shared_params.rs index e0c52deb44ca..dde472f57528 100644 --- a/substrate/client/cli/src/params/shared_params.rs +++ b/substrate/client/cli/src/params/shared_params.rs @@ -27,7 +27,8 @@ pub struct SharedParams { /// Specify the chain specification. /// /// It can be one of the predefined ones (dev, local, or staging) or it can be a path to - /// a file with the chainspec (such as one exported by the `build-spec` subcommand). + /// a file with the chainspec (such as one exported by a node's chain specification export + /// subcommand). #[arg(long, value_name = "CHAIN_SPEC")] pub chain: Option, diff --git a/substrate/client/transaction-pool/tests/zombienet/yap_test.rs b/substrate/client/transaction-pool/tests/zombienet/yap_test.rs index fd2fba3b9b95..d1acfe8a64ba 100644 --- a/substrate/client/transaction-pool/tests/zombienet/yap_test.rs +++ b/substrate/client/transaction-pool/tests/zombienet/yap_test.rs @@ -41,6 +41,8 @@ async fn slot_based_3cores_test() -> Result<(), anyhow::Error> { let r = r .with_chain("rococo-local") .with_default_command("polkadot") + .with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}") + .chain_spec_command_is_local(true) .with_default_image(images.polkadot.as_str()) .with_default_args(vec![("-lparachain=debug").into()]) .with_genesis_overrides(json!({ @@ -68,6 +70,10 @@ async fn slot_based_3cores_test() -> Result<(), anyhow::Error> { // commitment for selecting the core index p.with_id(2200) .with_default_command("polkadot-parachain") + .with_chain_spec_command( + "polkadot-parachain export-chain-spec --chain {{chainName}}", + ) + .chain_spec_command_is_local(true) .with_default_image(images.cumulus.as_str()) .with_chain("yap-rococo-local-2200") .with_genesis_overrides(json!({ diff --git a/substrate/frame/revive/dev-node/node/src/cli.rs b/substrate/frame/revive/dev-node/node/src/cli.rs index fe7717dd7651..3ed4cade3f00 100644 --- a/substrate/frame/revive/dev-node/node/src/cli.rs +++ b/substrate/frame/revive/dev-node/node/src/cli.rs @@ -58,8 +58,8 @@ pub enum Subcommand { #[command(subcommand)] Key(sc_cli::KeySubcommand), - /// Build a chain specification. - BuildSpec(sc_cli::BuildSpecCmd), + /// Export the chain specification. + ExportChainSpec(sc_cli::ExportChainSpecCmd), /// Validate blocks. CheckBlock(sc_cli::CheckBlockCmd), @@ -67,9 +67,6 @@ 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 7d92eeae1512..d6a8a075f422 100644 --- a/substrate/frame/revive/dev-node/node/src/command.rs +++ b/substrate/frame/revive/dev-node/node/src/command.rs @@ -68,10 +68,6 @@ pub fn run_with_args(args: Vec) -> sc_cli::Result<()> { match &cli.subcommand { Some(Subcommand::Key(cmd)) => cmd.run(&cli), - Some(Subcommand::BuildSpec(cmd)) => { - let runner = cli.create_runner(cmd)?; - runner.sync_run(|config| cmd.run(config.chain_spec, config.network)) - }, Some(Subcommand::CheckBlock(cmd)) => { let runner = cli.create_runner(cmd)?; runner.async_run(|config| { diff --git a/substrate/frame/transaction-storage/README.md b/substrate/frame/transaction-storage/README.md index 62741a012728..0ef2c02cd7b8 100644 --- a/substrate/frame/transaction-storage/README.md +++ b/substrate/frame/transaction-storage/README.md @@ -13,7 +13,7 @@ The following describes how to set up a new storage chain. Start with generating a chain spec. ```bash -cargo run --release -- build-spec --chain=local > sc_init.json +cargo run --release -- export-chain-spec --chain=local > sc_init.json ``` Edit the json chain spec file to customise the chain. The storage chain genesis params are configured in the @@ -23,7 +23,7 @@ changes at the moment. Build a raw spec from the init spec. ```bash -cargo run --release build-spec --chain=sc_init.json --raw > sc.json +cargo run --release export-chain-spec --chain=sc_init.json --raw > sc.json ``` Run a few validator nodes. diff --git a/substrate/zombienet/zombienet-sdk/tests/zombie_ci/block_building.rs b/substrate/zombienet/zombienet-sdk/tests/zombie_ci/block_building.rs index 0a95a1696bd6..94e65776b507 100644 --- a/substrate/zombienet/zombienet-sdk/tests/zombie_ci/block_building.rs +++ b/substrate/zombienet/zombienet-sdk/tests/zombie_ci/block_building.rs @@ -81,9 +81,10 @@ fn build_network_config() -> Result { .with_chain("local") .with_default_command("substrate") .with_default_image(integration_image.as_str()) - .with_chain_spec_command( - "substrate build-spec --chain {{chainName}} --disable-default-bootnode --raw", - ) + // `--raw` is required here: kitchensink's plain genesis cannot be converted via + // zombienet's GenericChainSpec path (missing `mixnet`). This is a substrate-only + // network, so skipping plain-spec customization is fine. + .with_chain_spec_command("substrate export-chain-spec --chain {{chainName}} --raw") .chain_spec_command_is_local(true) .with_default_args(default_args) .with_validator(|node| node.with_name("alice")) diff --git a/templates/minimal/node/src/cli.rs b/templates/minimal/node/src/cli.rs index 8284bf5b0ed1..fb83338119a8 100644 --- a/templates/minimal/node/src/cli.rs +++ b/templates/minimal/node/src/cli.rs @@ -58,14 +58,6 @@ pub enum Subcommand { #[command(subcommand)] Key(sc_cli::KeySubcommand), - /// Build a chain specification. - /// DEPRECATED: `build-spec` command will be removed after 1/04/2026. Use `export-chain-spec` - /// command instead. - #[deprecated( - note = "build-spec command will be removed after 1/04/2026. Use export-chain-spec command instead" - )] - BuildSpec(sc_cli::BuildSpecCmd), - /// Export the chain specification. ExportChainSpec(sc_cli::ExportChainSpecCmd), diff --git a/templates/minimal/node/src/command.rs b/templates/minimal/node/src/command.rs index e3115141a083..de2305d3f134 100644 --- a/templates/minimal/node/src/command.rs +++ b/templates/minimal/node/src/command.rs @@ -63,11 +63,6 @@ pub fn run() -> sc_cli::Result<()> { match &cli.subcommand { Some(Subcommand::Key(cmd)) => cmd.run(&cli), - #[allow(deprecated)] - Some(Subcommand::BuildSpec(cmd)) => { - let runner = cli.create_runner(cmd)?; - runner.sync_run(|config| cmd.run(config.chain_spec, config.network)) - }, Some(Subcommand::CheckBlock(cmd)) => { let runner = cli.create_runner(cmd)?; runner.async_run(|config| { diff --git a/templates/parachain/node/src/cli.rs b/templates/parachain/node/src/cli.rs index 3810ea4f1bdb..ae7097034e2d 100644 --- a/templates/parachain/node/src/cli.rs +++ b/templates/parachain/node/src/cli.rs @@ -5,14 +5,6 @@ use std::path::PathBuf; #[allow(clippy::large_enum_variant)] #[derive(Debug, clap::Subcommand)] pub enum Subcommand { - /// Build a chain specification. - /// DEPRECATED: `build-spec` command will be removed after 1/04/2026. Use `export-chain-spec` - /// command instead. - #[deprecated( - note = "build-spec command will be removed after 1/04/2026. Use export-chain-spec command instead" - )] - BuildSpec(sc_cli::BuildSpecCmd), - /// Export the chain specification. ExportChainSpec(sc_cli::ExportChainSpecCmd), @@ -51,7 +43,7 @@ pub enum Subcommand { const AFTER_HELP_EXAMPLE: &str = color_print::cstr!( r#"Examples: - parachain-template-node build-spec --disable-default-bootnode > plain-parachain-chainspec.json + parachain-template-node export-chain-spec --chain local > plain-parachain-chainspec.json Export a chainspec for a local testnet in json format. parachain-template-node --chain plain-parachain-chainspec.json --tmp -- --chain rococo-local Launch a full node with chain specification loaded from plain-parachain-chainspec.json. diff --git a/templates/parachain/node/src/command.rs b/templates/parachain/node/src/command.rs index 9d40e2d496ec..d8c6cbccc521 100644 --- a/templates/parachain/node/src/command.rs +++ b/templates/parachain/node/src/command.rs @@ -113,11 +113,6 @@ pub fn run() -> Result<()> { let cli = Cli::from_args(); match &cli.subcommand { - #[allow(deprecated)] - Some(Subcommand::BuildSpec(cmd)) => { - let runner = cli.create_runner(cmd)?; - runner.sync_run(|config| cmd.run(config.chain_spec, config.network)) - }, Some(Subcommand::CheckBlock(cmd)) => { construct_async_run!(|components, cli, cmd, config| { Ok(cmd.run(components.client, components.import_queue)) diff --git a/templates/solochain/node/src/cli.rs b/templates/solochain/node/src/cli.rs index c09905c7949e..6071376e0381 100644 --- a/templates/solochain/node/src/cli.rs +++ b/templates/solochain/node/src/cli.rs @@ -14,14 +14,6 @@ pub enum Subcommand { #[command(subcommand)] Key(sc_cli::KeySubcommand), - /// Build a chain specification. - /// DEPRECATED: `build-spec` command will be removed after 1/04/2026. Use `export-chain-spec` - /// command instead. - #[deprecated( - note = "build-spec command will be removed after 1/04/2026. Use export-chain-spec command instead" - )] - BuildSpec(sc_cli::BuildSpecCmd), - /// Export the chain specification. ExportChainSpec(sc_cli::ExportChainSpecCmd), diff --git a/templates/solochain/node/src/command.rs b/templates/solochain/node/src/command.rs index 460c0e766026..b5f8bb07ec2d 100644 --- a/templates/solochain/node/src/command.rs +++ b/templates/solochain/node/src/command.rs @@ -52,11 +52,6 @@ pub fn run() -> sc_cli::Result<()> { match &cli.subcommand { Some(Subcommand::Key(cmd)) => cmd.run(&cli), - #[allow(deprecated)] - Some(Subcommand::BuildSpec(cmd)) => { - let runner = cli.create_runner(cmd)?; - runner.sync_run(|config| cmd.run(config.chain_spec, config.network)) - }, Some(Subcommand::CheckBlock(cmd)) => { let runner = cli.create_runner(cmd)?; runner.async_run(|config| { diff --git a/templates/zombienet/tests/smoke.rs b/templates/zombienet/tests/smoke.rs index 5c0c9828e321..48641ea5a711 100644 --- a/templates/zombienet/tests/smoke.rs +++ b/templates/zombienet/tests/smoke.rs @@ -52,12 +52,20 @@ mod smoke { para_cmd_args: Option>, } + fn export_chain_spec_command(binary: &str) -> String { + format!("{binary} export-chain-spec --chain {{{{chainName}}}}") + } + fn get_config(network_spec: NetworkSpec) -> Result { let chain = if network_spec.relaychain_cmd == "polkadot" { "rococo-local" } else { "dev" }; let config = NetworkConfigBuilder::new().with_relaychain(|r| { let mut r = r.with_chain(chain).with_default_command(network_spec.relaychain_cmd); if let Some(path) = network_spec.relaychain_spec_path { r = r.with_chain_spec_path(path); + } else { + r = r + .with_chain_spec_command(export_chain_spec_command(network_spec.relaychain_cmd)) + .chain_spec_command_is_local(true); } if let Some(args) = network_spec.relaychain_cmd_args { @@ -76,6 +84,10 @@ mod smoke { } if let Some(path) = network_spec.para_chain_spec_path { p = p.with_chain_spec_path(path); + } else { + p = p + .with_chain_spec_command(export_chain_spec_command(para_cmd)) + .chain_spec_command_is_local(true); } p.with_collator(|n| n.with_name("collator")) })