Substrate tutorials
Substate tutorials is a collection of exercises that will teach you the basics of Substrate development and broaden your skillsets through real-world use cases.
Getting started
Go to the tutorial
repository, fork it,
clone it and start with the
first exercise.
Run the crate tests, you will see they fail. Give a look to the README.md and
code until all tests pass :)
If you want to run your pallet in a real runtime, you can easily edit the
substrate-node-template and add your pallet to its runtime. It will allow you
to interact with your code through tools like
polkadot.js.
Table of content
| name | objectives | |
|---|---|---|
| 0 | testing | learn how to write simple tests for an existing pallet |
| 1 | pallet easy | write a really simple erc20-like pallet |
| 2 | runtime | add your pallet to a substrate runtime and launch a node |
| 3 | pallet intermediate | writing pallet is the bread and butter of substrate development, let's double down on those basics |
| 4 | coupling | pallets can interact with each other, in different complex ways |
| 5 | hooks | substrate allow you to write hooks that will multiply the possibilities of your chain |
| 6 | weights | in order to be incentive the block consensus authorities fees are collected on users transactions |
| 7 | imbalances | the supply of your chain token can vary, but there are some rules to respect when playing with it |
| 8 | genesis config | you can give your chain an initial state before launching it |
| 9 | mock | learn how to mock your runtime in order to write handy and powerfull tests |
| 10 | offchain worker | another hook that allow nodes to do complex async computation in parallel of the chain execution |
Contribute
This work is open-source, financed by a Web3 Foundation grant, so it really belongs to the community. Feel free to contribute to the repository with anything you think could help others.