In this hands-on workshop, participants will start a Polkadot-like chain (the relay chain), register parachains, make cross-chain asset transfers, and convert their own Substrate runtimes to parachains using Cumulus.
If you are here without any former Substrate experience, you are likely to not understand or complete this tutorial. Before you continue please complete the following tutorials:
We will reference these assuming you have already understand all the steps involved, and have your machine configured to compile Substrate-based projects.
In this workshop, we will be using Substrate Parachain Template. Compiling this project is a resource intensive process! We suggest compiling and running Parachain template on a machine with no less than:
- 8 GB of RAM (16 is suggested)
- 4 CPU cores (8 is suggested)
- 50 GB of free HDD/SSD space
Without the minimal RAM here, you are likely to run out of memory resulting in a SIGKILL
error. This generally happens on the polkadot-service
build - so be sure to monitor your RAM
usage (with something like htop
) and look out as swap memory starting to be
used.
If you cannot find a machine with the minimums here, try the following that trade longer build time for more limited memory usage.
- Use less threads: cargo's
-j
flag specifies the number of threads to use to build. Try to use one less than the CPU cores your machine has. - Cargo's codegen units feature makes more optimized builds, with less ram, but much longer compile times.
# use less codegen units
RUSTFLAGS="-C codegen-units=1" cargo build --release
# set the number of cores/threads to compile (used to build cumulus/polkadot on rpi 3)
cargo build --release -j 1
At the moment, parachains are very tightly coupled with the relay chain's codebase they are connecting to. If you want to connect your parachian to a running relay network like the Rococo test network, you must be sure that you are testing against the exact same build of that relay chain.
This workshop has been tested on commits:
- Polkadot tagged
release-v0.9.9
- Parachain Template tagged
polkadot-v0.9.9
- Polkadot-JS Apps tagged
v0.95.1
. It is generally expected that the hosted Polkadot-JS Apps should work. If you have issues, build and run this UI yourself, at this tagged version.
NOTE: you must use these version exactly to ensure that you do not run into conflicts as parachain development is actively making breaking changes between commits on these repositories!
We are doing our best to keep the parachain template & this workshop updated presently with the latest release of Polkadot. Please check with us in the Parachain Technical matrix channel when breaking changes and testnet resets occur.
Read about The Path of a Parachain Block on the official Polkadot Blog.
Refer to Acknowledgement & Contribution
Cumulus is pre-release software that is still under development. While this workshop strives to be useful, the material it covers may change or break before Cumulus is fully released. Nothing presented here is ready for use in value-bearing blockchains!