This is a template for creating a parachain based on Polkadot SDK.
This template is automatically updated after releases in the main Polkadot SDK monorepo.
-
โซ This template provides a starting point to build a parachain.
-
โ๏ธ It is based on the Cumulus framework.
-
๐ง 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.
-
๐ Learn more about parachains here
A Polkadot SDK based project such as this one consists of:
- ๐ฟ a Node - the binary application.
- ๐งฎ the Runtime - the core logic of the parachain.
- ๐จ the Pallets - from which the runtime is constructed.
-
๐ฆ 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.
๐จ Use the following command to build the node without launching it:
cargo build --package parachain-template-node --release
๐ณ Alternatively, build the docker image:
docker build . -t polkadot-sdk-parachain-template
๐ง This project uses Zombienet to orchestrate the relaychain and parachain nodes. You can grab a released binary or use an npm version.
This template produces a parachain node.
You still need a relaychain node - you can download the polkadot
(and the accompanying polkadot-prepare-worker
and polkadot-execute-worker
)
binaries from Polkadot SDK releases.
Make sure to bring the parachain node - as well as polkadot
, polkadot-prepare-worker
, polkadot-execute-worker
,
and zombienet
- into PATH
like so:
export PATH="./target/release/:$PATH"
This way, we can conveniently use them in the following steps.
๐ฅ The following command starts a local development chain, with a single relay chain node and a single parachain collator:
zombienet --provider native spawn ./zombienet.toml
# Alternatively, the npm version:
npx --yes @zombienet/cli --provider native spawn ./zombienet.toml
Development chains:
- ๐งน Do not persist the state.
- ๐ฐ Are preconfigured with a genesis state that includes several prefunded development accounts.
- ๐งโโ๏ธ Development accounts are used as validators, collators, and
sudo
accounts.
-
๐ You can interact with your local node using the hosted version of the Polkadot/Substrate Portal: relay chain and parachain.
-
๐ช 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/apps
repository.
-
๐ 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.
-
๐งโ๐ซ To learn about Polkadot in general, Polkadot.network website is a good starting point.
-
๐งโ๐ง For technical introduction, here are the Polkadot SDK documentation resources.
-
๐ฅ Additionally, there are GitHub issues and Substrate StackExchange.