Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cumulus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 0 additions & 16 deletions cumulus/polkadot-omni-node/lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),

Expand Down
5 changes: 0 additions & 5 deletions cumulus/polkadot-omni-node/lib/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,7 @@ where
Cli::<CliConfig>::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| {
Expand Down
4 changes: 2 additions & 2 deletions cumulus/scripts/create_bridge_hub_westend_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cumulus/scripts/create_coretime_westend_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cumulus/scripts/create_glutton_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions cumulus/scripts/create_people_westend_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cumulus/scripts/create_seedling_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cumulus/scripts/create_shell_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 0 additions & 8 deletions cumulus/test/service/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),

Expand Down
6 changes: 0 additions & 6 deletions cumulus/test/service/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ async fn build_network_config() -> Result<NetworkConfig, 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=trace").into()])
.with_default_resources(|resources| {
Expand Down Expand Up @@ -194,6 +196,8 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
.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![
Expand All @@ -215,13 +219,17 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
.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"))
})
.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"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ async fn build_network_config() -> Result<NetworkConfig, 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=trace").into()])
.with_default_resources(|resources| {
Expand All @@ -231,6 +233,8 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
.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![
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ async fn build_network_config() -> Result<NetworkConfig, 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_resources(|resources| {
// These settings are applicable only for `k8s` provider.
Expand Down Expand Up @@ -153,6 +155,8 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!({
Expand All @@ -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![
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ async fn build_network_config() -> Result<NetworkConfig, 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=trace").into()])
.with_default_resources(|resources| {
Expand All @@ -213,6 +215,8 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
.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![
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ async fn build_network_config() -> Result<NetworkConfig, 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=trace").into()])
.with_default_resources(|resources| {
Expand All @@ -98,6 +100,8 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
.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![
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ async fn build_network_config() -> Result<NetworkConfig, 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=trace").into()])
.with_default_resources(|resources| {
Expand Down Expand Up @@ -132,6 +134,8 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
.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![
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
let r = r
.with_chain("rococo-local")
.with_default_command("polkadot")
.with_chain_spec_command("polkadot export-chain-spec --chain {{chainName}}")
Comment thread
Kanasjnr marked this conversation as resolved.
.chain_spec_command_is_local(true)
.with_default_image(images.polkadot.as_str())
.with_default_args(vec![("-lparachain=trace").into()])
.with_default_resources(|resources| {
Expand All @@ -152,6 +154,8 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
.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![
Expand Down
6 changes: 6 additions & 0 deletions cumulus/zombienet/zombienet-sdk/tests/zombie_ci/bootnodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ async fn build_network_config() -> Result<NetworkConfig, 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())
// Not strictly necessary for the test, but to keep it consistent
// with the parachain part we also pass `--no-mdns` to the relaychain.
Expand All @@ -37,6 +39,10 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
.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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ async fn build_network_config() -> Result<NetworkConfig, 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_resources(|resources| {
Expand All @@ -115,6 +117,8 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
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| {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
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| {
Expand Down Expand Up @@ -53,6 +55,8 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
.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![
Expand Down
Loading
Loading