Substrate Recipes 🍴😋🍴

A Hands-On Cookbook for Aspiring Blockchain Chefs

Substrate Recipes is a cookbook of working examples that demonstrate best practices when building blockchains with Substrate. Each recipe contains a complete working code example as well as a detailed writeup describing the code. This book is open source. Check out the contributing guidelines for an overview of the structure and directions for getting involved.

How to Use This Book

The easiest place to read this book is at

The first two chapters are meant to be read in order.

In Chapter 1, Preparing your Kitchen, you will set up your toolchain, compile a blockchain node, and learn to interact with the blockchain.

In Chapter 2, Appetizers, you will cook your first few recipes, learning the fundamentals of Substrate development.

The rest of the book, the "Entrees", can be read in any order; skip to whichever recipes interest you.

Remember, you can't learn to cook by reading alone. As you work through the book, put on your apron, get out some pots and pans, and practice compiling, testing, and hacking on the recipes. Play with the code in the kitchen, extract patterns, and apply them to a problem that you want to solve!

Getting Help

When learning any new skill, you will inevitably get stuck at some point. When you do get stuck you can seek help in several ways:

What is Substrate?

Substrate is a framework for building blockchains. For a high level overview, read the following blog posts:

To learn more about Substrate, see the official documentation.

Learning Rust

Becoming productive with Substrate requires some familiarity with Rust. Fortunately, the Rust community is known for comprehensive documentation and tutorials. The most common resource for initially learning Rust is The Rust Book. To see examples of popular crate usage patterns, Rust by Example is also convenient.

While knowing some Rust is certainly necessary, it is not wise to delay learning Substrate until you are a Rust guru. Rather than learning Rust before you learn Substrate, consider learning Rust as you learn Substrate. If you're beyond the fundamentals of Rust, there are lots more Rust resources at the end of the book.