Prerequisites

If you do not have substrate installed on your machine, run:

curl https://getsubstrate.io -sSf | bash

While the code compiles, read about how the Substrate runtime architecture composes modules to configure a runtime.

Module

At the moment, this resource focuses primarily on module development patterns, though there are plans to add examples of interesting runtime configurations using the existing modules. To develop in the context of the module, it is sufficient to clone the module-template

$ git clone https://github.com/shawntabrizi/substrate-module-template

build with

$ cargo build

test with

$ cargo test

Runtime

To develop in the context of the runtime, clone the substrate-node-template and add module logic to runtime/src/template.rs.

Updating the Runtime

Compile runtime binaries

cd runtime
cargo build --release

Delete the old chain before you start the new one (this is a very useful command sequence when building and testing runtimes)

./target/release/substrate-example purge-chain --dev
./target/release/substrate-example --dev