paritytech/polkadot-sdk-minimal-template
The Minimal (Testing/Learning-Only) Template From Polkadot SDK
Polkadot SDK's Minimal Template
This is a minimal template for creating a blockchain based on Polkadot SDK.
This template is automatically updated after releases in the main Polkadot SDK monorepo.
Table of Contents
Intro
-
๐ค This template is a minimal (in terms of complexity and the number of components)
template for building a blockchain node. -
๐ง Its runtime is configured with a single custom pallet as a starting point, and a handful of ready-made pallets
such as a Balances pallet. -
๐ค The template has no consensus configured - it is best for experimenting with a single node network.
Template Structure
A Polkadot SDK based project such as this one consists of:
- ๐งฎ the Runtime - the core logic of the blockchain.
- ๐จ the Pallets - from which the runtime is constructed.
- ๐ฟ a Node - the binary application (which is not part of the cargo default-members list and is not
compiled unless building the entire workspace).
Getting Started
-
๐ฆ The template is using the Rust language.
-
๐ Check the
Rust installation instructions for your system. -
๐ ๏ธ 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.
Fetch minimal template code.
git clone https://github.com/paritytech/polkadot-sdk-minimal-template.git minimal-template
cd minimal-templateStarting a Minimal Template Chain
Minimal Template Node
Build both node & runtime
cargo build --workspace --release๐ณ Alternatively, build the docker image which builds all the workspace members,
and has as entry point the node binary:
docker build . -t polkadot-sdk-minimal-templateStart the minimal-template-node
The minimal-template-node has dependency on the minimal-template-runtime. It will use
the minimal_template_runtime::WASM_BINARY constant (which holds the WASM blob as a byte
array) for chain spec building, while starting.
<target/release/path/to/minimal-template-node> --tmp --consensus manual-seal-3000
# or via docker
docker run --rm polkadot-sdk-minimal-templateZombienet with minimal-template-node
For this one we just need to have zombienet installed and run:
zombienet --provider native spawn zombienet-multi-node.tomlConnect with the Polkadot-JS Apps Front-End
-
๐ You can interact with your local node using the
hosted version of the Polkadot/Substrate
Portal. -
๐ช A hosted version is also
available on IPFS. -
๐งโ๐ง You can also find the source code and instructions for hosting your own instance in the
polkadot-js/appsrepository.
Takeaways
Previously minimal template's development chains:
- โ Started in a multi-node setup will produce forks because minimal lacks consensus.
- ๐งน Do not persist the state.
- ๐ฐ Are pre-configured with a genesis state that includes several pre-funded development accounts.
- ๐งโโ๏ธ One development account (
ALICE) is used assudoaccounts.
Contributing
-
๐ This template is automatically updated after releases in the main Polkadot SDK monorepo.
-
โก๏ธ Any pull requests should be directed to this source.
-
๐ Please refer to the monorepo's
contribution guidelines and
Code of Conduct.
Getting Help
-
๐งโ๐ซ To learn about Polkadot in general, docs.Polkadot.com website is a good starting point.
-
๐งโ๐ง For technical introduction, here are
the Polkadot SDK documentation resources. -
๐ฅ Additionally, there are GitHub issues and
Substrate StackExchange. -
๐ฅYou can also reach out on the Official Polkadot discord server
-
๐งReach out on Telegram for more questions and discussions