Before we start writing code, we will need to setup your computer for this tutorial.
The tutorial is designed to be completed by anyone with basic familiarity with Rust, and little to no familiarity with the Polkadot SDK.
If you do not feel comfortable with the level of Rust used in this tutorial, we recommend you first check out the rust-state-machine
tutorial.
The goal of this tutorial is to create a custom Polkadot SDK Pallet that acts as an NFT Marketplace. Our NFTs will represent kitties, which will be a digital pets that can be created, traded, and more.
This Pallet could then be included into a Polkadot SDK blockchain and used to launch a Web3 application on the Polkadot Network.
TODO: need to create and link to a tutorial creating and launching a custom runtime with omninode.
This tutorial is broken up into small steps with documentation and code.
Documentation should teach you all the concepts needed to complete the tutorial, while the code will ensure that you can actually execute on the knowledge gained.
The code in each step should have comments marked TODO
, which indicate the actions you need to take in order to complete the step successfully.
At each step, we include a diff
view so that you can see what has changed from the last step (new action items), and what should change to complete the step (the solution).
At the end of each step, you should be able to run all the following commands without any errors or warnings:
cargo +nightly fmt
cargo +nightly clippy
cargo test
We recommend you run these during each step in the tutorial to confirm you are doing everything correctly.
The template for this project is a minimal starting point for developing a custom Pallet with a little bit of starting code.
The best way to follow this tutorial is to clone the starting template, and follow the steps of the tutorial locally.
Run the following:
git clone https://github.com/shawntabrizi/substrate-collectables-workshop/ -b starting-template --single-branchcd substrate-collectables-workshop
Or access the template directly here:
https://github.com/shawntabrizi/substrate-collectables-workshop/releases/tag/starting-template
The starting template includes a README
with instructions to setup your working environment. Follow those instructions.
Make sure you are able to run the following checks on this starting template without warnings or errors:
cargo +nightly fmtcargo +nightly clippycargo test
It may take a while for this to complete based on how powerful your computer is.
Feel free to move onto the next steps while these checks are compiling.
This tutorial is completely free to use, modify, and distribute in any way you see fit.
If you catch any problems with the tutorial or have ideas on how it can be improved, open an issue or a pull request.