-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
117 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,121 @@ | ||
# Substrate Cumulus Parachain Template | ||
<div align="center"> | ||
|
||
A new [Cumulus](https://github.com/paritytech/cumulus/)-based Substrate node, ready for hacking ☁️.. | ||
# Polkadot SDK's Parachain Template | ||
|
||
This project is a fork of the [Substrate Node Template](https://github.com/substrate-developer-hub/substrate-node-template) | ||
modified to include dependencies required for registering this node as a **parathread** or | ||
**parachain** to the Rococo **relay chain**. | ||
Rococo is [Polkadot's parachain testnet](https://polkadot.network/blog/introducing-rococo-polkadots-parachain-testnet/) 👑. | ||
<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"/> | ||
<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"/> | ||
|
||
👉 Learn more about parachains [here](https://wiki.polkadot.network/docs/learn-parachains), and | ||
parathreads [here](https://wiki.polkadot.network/docs/learn-parathreads). | ||
> This is a template for creating a [parachain](https://wiki.polkadot.network/docs/learn-parachains) based on Polkadot SDK. | ||
> | ||
> This template is automatically updated after releases in the main [Polkadot SDK monorepo](https://github.com/paritytech/polkadot-sdk). | ||
To learn about how to actually use the template to hack together your own parachain check out the | ||
`README` from the [`substrate-parachain-template` repository](https://github.com/substrate-developer-hub/substrate-parachain-template/). | ||
</div> | ||
|
||
* ⏫ This template provides a starting point to build a [parachain](https://wiki.polkadot.network/docs/learn-parachains). | ||
|
||
* ☁️ It is based on the | ||
[Cumulus](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/polkadot_sdk/cumulus/index.html) 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](https://paritytech.github.io/polkadot-sdk/master/pallet_balances/index.html). | ||
|
||
* 👉 Learn more about parachains [here](https://wiki.polkadot.network/docs/learn-parachains) | ||
|
||
## Template Structure | ||
|
||
A Polkadot SDK based project such as this one consists of: | ||
|
||
* 💿 a [Node](./node/README.md) - the binary application. | ||
* 🧮 the [Runtime](./runtime/README.md) - the core logic of the parachain. | ||
* 🎨 the [Pallets](./pallets/README.md) - from which the runtime is constructed. | ||
|
||
## Getting Started | ||
|
||
* 🦀 The template is using the Rust language. | ||
|
||
* 👉 Check the | ||
[Rust installation instructions](https://www.rust-lang.org/tools/install) 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: | ||
|
||
```sh | ||
cargo build --package parachain-template-node --release | ||
``` | ||
|
||
🐳 Alternatively, build the docker image: | ||
|
||
```sh | ||
docker build . -t polkadot-sdk-parachain-template | ||
``` | ||
|
||
### Local Development Chain | ||
|
||
🧟 This project uses [Zombienet](https://github.com/paritytech/zombienet) to orchestrate the relaychain and parachain nodes. | ||
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). | ||
|
||
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](https://github.com/paritytech/polkadot-sdk/releases/latest). | ||
|
||
Make sure to bring the parachain node - as well as `polkadot`, `polkadot-prepare-worker`, `polkadot-execute-worker`, | ||
and `zombienet` - into `PATH` like so: | ||
|
||
```sh | ||
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: | ||
|
||
```sh | ||
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](https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9944) | ||
and [parachain](https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9988). | ||
|
||
* 🪐 A hosted version is also | ||
available on [IPFS](https://dotapps.io/). | ||
|
||
* 🧑🔧 You can also find the source code and instructions for hosting your own instance in the | ||
[`polkadot-js/apps`](https://github.com/polkadot-js/apps) repository. | ||
|
||
## Contributing | ||
|
||
* 🔄 This template is automatically updated after releases in the main [Polkadot SDK monorepo](https://github.com/paritytech/polkadot-sdk). | ||
|
||
* ➡️ Any pull requests should be directed to this [source](https://github.com/paritytech/polkadot-sdk/tree/master/templates/parachain). | ||
|
||
* 😇 Please refer to the monorepo's | ||
[contribution guidelines](https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md) and | ||
[Code of Conduct](https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CODE_OF_CONDUCT.md). | ||
|
||
## Getting Help | ||
|
||
* 🧑🏫 To learn about Polkadot in general, [Polkadot.network](https://polkadot.network/) website is a good starting point. | ||
|
||
* 🧑🔧 For technical introduction, [here](https://github.com/paritytech/polkadot-sdk#-documentation) are | ||
the Polkadot SDK documentation resources. | ||
|
||
* 👥 Additionally, there are [GitHub issues](https://github.com/paritytech/polkadot-sdk/issues) and | ||
[Substrate StackExchange](https://substrate.stackexchange.com/). |