Update the minimal template to stable2503 (#23)

This synchronizes the template to the stable2503 branch.

Co-authored-by: iulianbarbu <14218860+iulianbarbu@users.noreply.github.com>
This commit is contained in:
paritytech-polkadotsdk-templatebot[bot]
2025-04-17 13:31:07 +03:00
committed by GitHub
parent dbc4be1c1f
commit cf2536b751
13 changed files with 2740 additions and 2362 deletions
Generated
+2622 -2319
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -22,7 +22,7 @@ docify = { version = "0.2.9" }
futures = { version = "0.3.31" } futures = { version = "0.3.31" }
futures-timer = { version = "3.0.2" } futures-timer = { version = "3.0.2" }
jsonrpsee = { version = "0.24.3" } jsonrpsee = { version = "0.24.3" }
polkadot-sdk = { version = "0.12.2", default-features = false } polkadot-sdk = { version = "2503.0.1", default-features = false }
codec = { version = "3.7.4", default-features = false, package = "parity-scale-codec" }
scale-info = { version = "2.11.6", default-features = false }
serde_json = { version = "1.0.132", default-features = false } serde_json = { version = "1.0.132", default-features = false }
codec = { version = "3.6.12", default-features = false, package = "parity-scale-codec" }
scale-info = { version = "2.11.1", default-features = false }
+10 -5
View File
@@ -42,6 +42,7 @@ such as a [Balances pallet](https://paritytech.github.io/polkadot-sdk/master/pal
- 👤 The template has no consensus configured - it is best for experimenting with a single node network. - 👤 The template has no consensus configured - it is best for experimenting with a single node network.
## Template Structure ## Template Structure
A Polkadot SDK based project such as this one consists of: A Polkadot SDK based project such as this one consists of:
@@ -61,7 +62,7 @@ compiled unless building the entire workspace).
- 🛠️ Depending on your operating system and Rust version, there might be additional - 🛠️ Depending on your operating system and Rust version, there might be additional
packages required to compile this template - please take note of the Rust compiler output. packages required to compile this template - please take note of the Rust compiler output.
Fetch minimal template code: Fetch minimal template code.
```sh ```sh
git clone https://github.com/paritytech/polkadot-sdk-minimal-template.git minimal-template git clone https://github.com/paritytech/polkadot-sdk-minimal-template.git minimal-template
@@ -147,11 +148,13 @@ docker run --rm polkadot-sdk-minimal-template
We can install `zombienet` as described [here](https://paritytech.github.io/zombienet/install.html#installation), We can install `zombienet` as described [here](https://paritytech.github.io/zombienet/install.html#installation),
and `zombienet-omni-node.toml` contains the network specification we want to start. and `zombienet-omni-node.toml` contains the network specification we want to start.
#### Update `zombienet-omni-node.toml` with a valid chain spec path #### Update `zombienet-omni-node.toml` with a valid chain spec path
Before starting the network with zombienet we must update the network specification To simplify the process of starting the minimal template with ZombieNet and Omni Node, we've included a
with a valid chain spec path. If we need to generate one, we can look up at the previous pre-configured development chain spec (dev_chain_spec.json) in the minimal template. The zombienet-omni-node.toml
section for chain spec creation [here](#use-chain-spec-builder-to-generate-the-chain_specjson-file). file in this template points to it, but you can update it to a new path for the chain spec generated on your machine.
To generate a chain spec refer to [staging-chain-spec-builder](https://crates.io/crates/staging-chain-spec-builder)
Then make the changes in the network specification like so: Then make the changes in the network specification like so:
@@ -210,10 +213,12 @@ Previously minimal template's development chains:
## Getting Help ## Getting Help
- 🧑‍🏫 To learn about Polkadot in general, [Polkadot.network](https://polkadot.network/) website is a good starting point. - 🧑‍🏫 To learn about Polkadot in general, [docs.Polkadot.com](https://docs.polkadot.com/) website is a good starting point.
- 🧑‍🔧 For technical introduction, [here](https://github.com/paritytech/polkadot-sdk#-documentation) are - 🧑‍🔧 For technical introduction, [here](https://github.com/paritytech/polkadot-sdk#-documentation) are
the Polkadot SDK documentation resources. the Polkadot SDK documentation resources.
- 👥 Additionally, there are [GitHub issues](https://github.com/paritytech/polkadot-sdk/issues) and - 👥 Additionally, there are [GitHub issues](https://github.com/paritytech/polkadot-sdk/issues) and
[Substrate StackExchange](https://substrate.stackexchange.com/). [Substrate StackExchange](https://substrate.stackexchange.com/).
- 👥You can also reach out on the [Official Polkdot discord server](https://polkadot-discord.w3f.tools/)
- 🧑Reach out on [Telegram](https://t.me/substratedevs) for more questions and discussions
File diff suppressed because one or more lines are too long
+2 -3
View File
@@ -14,14 +14,13 @@ build = "build.rs"
targets = ["x86_64-unknown-linux-gnu"] targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
docify = { workspace = true }
clap = { features = ["derive"], workspace = true } clap = { features = ["derive"], workspace = true }
docify = { workspace = true }
futures = { features = ["thread-pool"], workspace = true } futures = { features = ["thread-pool"], workspace = true }
futures-timer = { workspace = true } futures-timer = { workspace = true }
jsonrpsee = { features = ["server"], workspace = true } jsonrpsee = { features = ["server"], workspace = true }
serde_json = { workspace = true, default-features = true }
polkadot-sdk = { workspace = true, features = ["experimental", "node"] }
minimal-template-runtime.workspace = true minimal-template-runtime.workspace = true
polkadot-sdk = { workspace = true, features = ["experimental", "node"] }
[build-dependencies] [build-dependencies]
polkadot-sdk = { workspace = true, features = ["substrate-build-script-utils"] } polkadot-sdk = { workspace = true, features = ["substrate-build-script-utils"] }
-5
View File
@@ -16,8 +16,3 @@
initial (genesis) state. initial (genesis) state.
- [`service.rs`](./src/service.rs): This file defines the node implementation. - [`service.rs`](./src/service.rs): This file defines the node implementation.
It's a place to configure consensus-related topics. In favor of minimalism, this template has no consensus configured. It's a place to configure consensus-related topics. In favor of minimalism, this template has no consensus configured.
## Release
Polkadot SDK Stable 2412
+1 -2
View File
@@ -134,7 +134,7 @@ pub fn new_full<Network: sc_network::NetworkBackend<Block, <Block as BlockT>::Ha
config.prometheus_config.as_ref().map(|cfg| &cfg.registry), config.prometheus_config.as_ref().map(|cfg| &cfg.registry),
); );
let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = let (network, system_rpc_tx, tx_handler_controller, sync_service) =
sc_service::build_network(sc_service::BuildNetworkParams { sc_service::build_network(sc_service::BuildNetworkParams {
config: &config, config: &config,
net_config, net_config,
@@ -264,6 +264,5 @@ pub fn new_full<Network: sc_network::NetworkBackend<Block, <Block as BlockT>::Ha
_ => {}, _ => {},
} }
network_starter.start_network();
Ok(task_manager) Ok(task_manager)
} }
+1 -1
View File
@@ -14,8 +14,8 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
codec = { features = ["derive"], workspace = true } codec = { features = ["derive"], workspace = true }
scale-info = { features = ["derive"], workspace = true }
polkadot-sdk = { workspace = true, features = ["experimental", "runtime"], default-features = false } polkadot-sdk = { workspace = true, features = ["experimental", "runtime"], default-features = false }
scale-info = { features = ["derive"], workspace = true }
[features] [features]
-5
View File
@@ -1,5 +0,0 @@
## Release
Polkadot SDK Stable 2412
+3 -3
View File
@@ -11,10 +11,10 @@ publish = false
[dependencies] [dependencies]
codec = { workspace = true } codec = { workspace = true }
scale-info = { workspace = true }
polkadot-sdk = { workspace = true, features = ["pallet-balances", "pallet-sudo", "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "runtime"] }
serde_json = { workspace = true, default-features = false, features = ["alloc"] }
pallet-minimal-template.workspace = true pallet-minimal-template.workspace = true
polkadot-sdk = { workspace = true, features = ["pallet-balances", "pallet-sudo", "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "runtime"] }
scale-info = { workspace = true }
serde_json = { workspace = true, default-features = false, features = ["alloc"] }
[build-dependencies] [build-dependencies]
polkadot-sdk = { optional = true, workspace = true, features = ["substrate-wasm-builder"] } polkadot-sdk = { optional = true, workspace = true, features = ["substrate-wasm-builder"] }
-5
View File
@@ -8,8 +8,3 @@ responsible for validating blocks and executing the state changes they define.
👉 Learn more about FRAME 👉 Learn more about FRAME
[here](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/polkadot_sdk/frame_runtime/index.html). [here](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/polkadot_sdk/frame_runtime/index.html).
## Release
Polkadot SDK Stable 2412
+11 -9
View File
@@ -41,7 +41,7 @@ pub mod genesis_config_presets {
use super::*; use super::*;
use crate::{ use crate::{
interface::{Balance, MinimumBalance}, interface::{Balance, MinimumBalance},
sp_keyring::AccountKeyring, sp_keyring::Sr25519Keyring,
BalancesConfig, RuntimeGenesisConfig, SudoConfig, BalancesConfig, RuntimeGenesisConfig, SudoConfig,
}; };
@@ -51,17 +51,14 @@ pub mod genesis_config_presets {
/// Returns a development genesis config preset. /// Returns a development genesis config preset.
pub fn development_config_genesis() -> Value { pub fn development_config_genesis() -> Value {
let endowment = <MinimumBalance as Get<Balance>>::get().max(1) * 1000; let endowment = <MinimumBalance as Get<Balance>>::get().max(1) * 1000;
let config = RuntimeGenesisConfig { frame_support::build_struct_json_patch!(RuntimeGenesisConfig {
balances: BalancesConfig { balances: BalancesConfig {
balances: AccountKeyring::iter() balances: Sr25519Keyring::iter()
.map(|a| (a.to_account_id(), endowment)) .map(|a| (a.to_account_id(), endowment))
.collect::<Vec<_>>(), .collect::<Vec<_>>(),
}, },
sudo: SudoConfig { key: Some(AccountKeyring::Alice.to_account_id()) }, sudo: SudoConfig { key: Some(Sr25519Keyring::Alice.to_account_id()) },
..Default::default() })
};
serde_json::to_value(config).expect("Could not build genesis config.")
} }
/// Get the set of the available genesis config presets. /// Get the set of the available genesis config presets.
@@ -121,6 +118,10 @@ type TxExtension = (
// Ensures that the sender has enough funds to pay for the transaction // Ensures that the sender has enough funds to pay for the transaction
// and deducts the fee from the sender's account. // and deducts the fee from the sender's account.
pallet_transaction_payment::ChargeTransactionPayment<Runtime>, pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
// Reclaim the unused weight from the block using post dispatch information.
// It must be last in the pipeline in order to catch the refund in previous transaction
// extensions
frame_system::WeightReclaim<Runtime>,
); );
// Composes the runtime by adding all the used pallets and deriving necessary types. // Composes the runtime by adding all the used pallets and deriving necessary types.
@@ -137,7 +138,8 @@ mod runtime {
RuntimeHoldReason, RuntimeHoldReason,
RuntimeSlashReason, RuntimeSlashReason,
RuntimeLockId, RuntimeLockId,
RuntimeTask RuntimeTask,
RuntimeViewFunction
)] )]
pub struct Runtime; pub struct Runtime;
+2 -2
View File
@@ -1,8 +1,8 @@
[relaychain] [relaychain]
default_command = "polkadot-omni-node" default_command = "polkadot-omni-node"
chain = "dev" chain = "dev"
chain_spec_path = "<path/to/chain_spec.json>" chain_spec_path = "./dev_chain_spec.json"
default_args = ["--dev"] default_args = ["--dev-block-time 3000"]
[[relaychain.nodes]] [[relaychain.nodes]]
name = "alice" name = "alice"