Skip to content

paritytech/polkadot-sdk-parachain-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polkadot SDK's Parachain Template

Polkadot SDK Logo Polkadot SDK Logo

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

Template Structure

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.

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.

Build

๐Ÿ”จ 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

Local Development Chain

๐ŸงŸ 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.

Connect with the Polkadot-JS Apps Front-End

  • ๐ŸŒ 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.

Contributing

Getting Help

  • ๐Ÿง‘โ€๐Ÿซ 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.