diff --git a/templates/parachain/README.docify.md b/templates/parachain/README.docify.md index 95c96fdbc01e..35eea4c34f20 100644 --- a/templates/parachain/README.docify.md +++ b/templates/parachain/README.docify.md @@ -1,8 +1,9 @@
-[cfg(all(doc, feature = "generate-readme"))] compile_markdown!("README.docify.md", "README.md"); + + # Polkadot SDK's Parachain Template Polkadot SDK Logo @@ -99,7 +100,7 @@ Please see the installation section at [`crates.io/staging-chain-spec-builder`]( #### Use `chain-spec-builder` to generate the `chain_spec.json` file ```sh -chain-spec-builder create --relay-chain "rococo-local" --para-id --runtime \ +chain-spec-builder create --relay-chain "rococo-local" --para-id --runtime \ target/release/wbuild/parachain-template-runtime/parachain_template_runtime.wasm named-preset development ``` @@ -144,7 +145,7 @@ export PATH="$PATH:" ```toml # ... [[parachains]] -id = {{PARACHAIN_ID}} +id = chain_spec_path = "" # ... ``` diff --git a/templates/parachain/runtime/build.rs b/templates/parachain/runtime/build.rs index 7676150f6747..41d60b46481c 100644 --- a/templates/parachain/runtime/build.rs +++ b/templates/parachain/runtime/build.rs @@ -1,7 +1,5 @@ use std::process::Command; -#[cfg(all(feature = "std", feature = "metadata-hash"))] -#[docify::export(template_enable_metadata_hash)] fn main() { println!("cargo:rerun-if-changed=../../parachain/runtime/src/genesis_config_presets.rs"); substrate_wasm_builder::WasmBuilder::init_with_defaults() diff --git a/templates/parachain/runtime/src/genesis_config_presets.rs b/templates/parachain/runtime/src/genesis_config_presets.rs index cbdd3c5fd32e..9af04a7223b4 100644 --- a/templates/parachain/runtime/src/genesis_config_presets.rs +++ b/templates/parachain/runtime/src/genesis_config_presets.rs @@ -6,11 +6,12 @@ use crate::{ use alloc::{vec, vec::Vec}; use polkadot_sdk::{staging_xcm as xcm, *}; +use docify::{compile_markdown, export, export_content}; +#[doc = include_str!("../../README.md")] #[cfg(feature = "generate-readme")] docify::compile_markdown!("../../README.docify.md","../../README.md"); -use docify::{export, export_content}; use cumulus_primitives_core::ParaId; use frame_support::build_struct_json_patch; @@ -22,7 +23,7 @@ use sp_keyring::Sr25519Keyring; /// The default XCM version to set in genesis config. const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION; /// Parachain id used for genesis config presets of parachain template. -pub const PARACHAIN_ID: u32 = 2000; +pub const PARACHAIN_ID: u32 = 1000; /// Generate the session keys from individual elements. /// @@ -30,9 +31,9 @@ pub const PARACHAIN_ID: u32 = 2000; pub fn template_session_keys(keys: AuraId) -> SessionKeys { SessionKeys { aura: keys } } -#[export(name = "get_parachain_id")] -const fn get_parachain_id() -> u32 { - 1000 +#[docify::export_content] +pub fn get_parachain_id() -> String { + PARACHAIN_ID.to_string() } fn testnet_genesis(