|
1 |
| -# Substrate Cumulus Parachain Template |
| 1 | +<div align="center"> |
2 | 2 |
|
3 |
| -A new [Cumulus](https://github.com/paritytech/cumulus/)-based Substrate node, ready for hacking ☁️.. |
| 3 | +# Polkadot SDK's Parachain Template |
4 | 4 |
|
5 |
| -This project is a fork of the [Substrate Node Template](https://github.com/substrate-developer-hub/substrate-node-template) |
6 |
| -modified to include dependencies required for registering this node as a **parathread** or |
7 |
| -**parachain** to the Rococo **relay chain**. |
8 |
| -Rococo is [Polkadot's parachain testnet](https://polkadot.network/blog/introducing-rococo-polkadots-parachain-testnet/) 👑. |
| 5 | +<img height="70px" alt="Polkadot SDK Logo" src="https://github.com/paritytech/polkadot-sdk/raw/master/docs/images/Polkadot_Logo_Horizontal_Pink_White.png#gh-dark-mode-only"/> |
| 6 | +<img height="70px" alt="Polkadot SDK Logo" src="https://github.com/paritytech/polkadot-sdk/raw/master/docs/images/Polkadot_Logo_Horizontal_Pink_Black.png#gh-light-mode-only"/> |
9 | 7 |
|
10 |
| -👉 Learn more about parachains [here](https://wiki.polkadot.network/docs/learn-parachains), and |
11 |
| -parathreads [here](https://wiki.polkadot.network/docs/learn-parathreads). |
| 8 | +> This is a template for creating a [parachain](https://wiki.polkadot.network/docs/learn-parachains) based on Polkadot SDK. |
| 9 | +> |
| 10 | +> This template is automatically updated after releases in the main [Polkadot SDK monorepo](https://github.com/paritytech/polkadot-sdk). |
12 | 11 |
|
13 |
| -To learn about how to actually use the template to hack together your own parachain check out the |
14 |
| -`README` from the [`substrate-parachain-template` repository](https://github.com/substrate-developer-hub/substrate-parachain-template/). |
| 12 | +</div> |
| 13 | + |
| 14 | +* ⏫ This template provides a starting point to build a [parachain](https://wiki.polkadot.network/docs/learn-parachains). |
| 15 | + |
| 16 | +* ☁️ It is based on the |
| 17 | + [Cumulus](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/polkadot_sdk/cumulus/index.html) framework. |
| 18 | + |
| 19 | +* 🔧 Its runtime is configured with a single custom pallet as a starting point, and a handful of ready-made pallets |
| 20 | + such as a [Balances pallet](https://paritytech.github.io/polkadot-sdk/master/pallet_balances/index.html). |
| 21 | + |
| 22 | +* 👉 Learn more about parachains [here](https://wiki.polkadot.network/docs/learn-parachains) |
| 23 | + |
| 24 | +## Template Structure |
| 25 | + |
| 26 | +A Polkadot SDK based project such as this one consists of: |
| 27 | + |
| 28 | +* 💿 a [Node](./node/README.md) - the binary application. |
| 29 | +* 🧮 the [Runtime](./runtime/README.md) - the core logic of the parachain. |
| 30 | +* 🎨 the [Pallets](./pallets/README.md) - from which the runtime is constructed. |
| 31 | + |
| 32 | +## Getting Started |
| 33 | + |
| 34 | +* 🦀 The template is using the Rust language. |
| 35 | + |
| 36 | +* 👉 Check the |
| 37 | + [Rust installation instructions](https://www.rust-lang.org/tools/install) for your system. |
| 38 | + |
| 39 | +* 🛠️ Depending on your operating system and Rust version, there might be additional |
| 40 | + packages required to compile this template - please take note of the Rust compiler output. |
| 41 | + |
| 42 | +### Build |
| 43 | + |
| 44 | +🔨 Use the following command to build the node without launching it: |
| 45 | + |
| 46 | +```sh |
| 47 | +cargo build --package parachain-template-node --release |
| 48 | +``` |
| 49 | + |
| 50 | +🐳 Alternatively, build the docker image: |
| 51 | + |
| 52 | +```sh |
| 53 | +docker build . -t polkadot-sdk-parachain-template |
| 54 | +``` |
| 55 | + |
| 56 | +### Local Development Chain |
| 57 | + |
| 58 | +🧟 This project uses [Zombienet](https://github.com/paritytech/zombienet) to orchestrate the relaychain and parachain nodes. |
| 59 | +You can grab a [released binary](https://github.com/paritytech/zombienet/releases/latest) or use an [npm version](https://www.npmjs.com/package/@zombienet/cli). |
| 60 | + |
| 61 | +This template produces a parachain node. |
| 62 | +You still need a relaychain node - you can download the `polkadot` |
| 63 | +(and the accompanying `polkadot-prepare-worker` and `polkadot-execute-worker`) |
| 64 | +binaries from [Polkadot SDK releases](https://github.com/paritytech/polkadot-sdk/releases/latest). |
| 65 | + |
| 66 | +Make sure to bring the parachain node - as well as `polkadot`, `polkadot-prepare-worker`, `polkadot-execute-worker`, |
| 67 | +and `zombienet` - into `PATH` like so: |
| 68 | + |
| 69 | +```sh |
| 70 | +export PATH="./target/release/:$PATH" |
| 71 | +``` |
| 72 | + |
| 73 | +This way, we can conveniently use them in the following steps. |
| 74 | + |
| 75 | +👥 The following command starts a local development chain, with a single relay chain node and a single parachain collator: |
| 76 | + |
| 77 | +```sh |
| 78 | +zombienet --provider native spawn ./zombienet.toml |
| 79 | + |
| 80 | +# Alternatively, the npm version: |
| 81 | +npx --yes @zombienet/cli --provider native spawn ./zombienet.toml |
| 82 | +``` |
| 83 | + |
| 84 | +Development chains: |
| 85 | + |
| 86 | +* 🧹 Do not persist the state. |
| 87 | +* 💰 Are preconfigured with a genesis state that includes several prefunded development accounts. |
| 88 | +* 🧑⚖️ Development accounts are used as validators, collators, and `sudo` accounts. |
| 89 | + |
| 90 | +### Connect with the Polkadot-JS Apps Front-End |
| 91 | + |
| 92 | +* 🌐 You can interact with your local node using the |
| 93 | + hosted version of the Polkadot/Substrate Portal: |
| 94 | + [relay chain](https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9944) |
| 95 | + and [parachain](https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9988). |
| 96 | + |
| 97 | +* 🪐 A hosted version is also |
| 98 | + available on [IPFS](https://dotapps.io/). |
| 99 | + |
| 100 | +* 🧑🔧 You can also find the source code and instructions for hosting your own instance in the |
| 101 | + [`polkadot-js/apps`](https://github.com/polkadot-js/apps) repository. |
| 102 | + |
| 103 | +## Contributing |
| 104 | + |
| 105 | +* 🔄 This template is automatically updated after releases in the main [Polkadot SDK monorepo](https://github.com/paritytech/polkadot-sdk). |
| 106 | + |
| 107 | +* ➡️ Any pull requests should be directed to this [source](https://github.com/paritytech/polkadot-sdk/tree/master/templates/parachain). |
| 108 | + |
| 109 | +* 😇 Please refer to the monorepo's |
| 110 | + [contribution guidelines](https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md) and |
| 111 | + [Code of Conduct](https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CODE_OF_CONDUCT.md). |
| 112 | + |
| 113 | +## Getting Help |
| 114 | + |
| 115 | +* 🧑🏫 To learn about Polkadot in general, [Polkadot.network](https://polkadot.network/) website is a good starting point. |
| 116 | + |
| 117 | +* 🧑🔧 For technical introduction, [here](https://github.com/paritytech/polkadot-sdk#-documentation) are |
| 118 | + the Polkadot SDK documentation resources. |
| 119 | + |
| 120 | +* 👥 Additionally, there are [GitHub issues](https://github.com/paritytech/polkadot-sdk/issues) and |
| 121 | + [Substrate StackExchange](https://substrate.stackexchange.com/). |
0 commit comments