Go to file
Dan Forbes f8924ad3e0 🔖 update image 2020-06-27 17:01:25 +00:00
.devcontainer 🔖 update image 2020-06-27 17:01:25 +00:00
.github/workflows Playground updates (#58) 2020-06-19 04:06:30 -07:00
.vscode Add some playground love (#57) 2020-06-17 14:16:26 +02:00
node Upgrade to v2.0.0-rc4 (#62) 2020-06-27 09:14:55 -07:00
pallets/template Upgrade to v2.0.0-rc4 (#62) 2020-06-27 09:14:55 -07:00
runtime Upgrade to v2.0.0-rc4 (#62) 2020-06-27 09:14:55 -07:00
scripts Use docker to setup a local dev chain (#41) 2020-05-15 12:27:30 +08:00
.gitignore Use docker to setup a local dev chain (#41) 2020-05-15 12:27:30 +08:00
Cargo.lock Upgrade to v2.0.0-rc4 (#62) 2020-06-27 09:14:55 -07:00
Cargo.toml Update to v2.0.0-rc1 (#45) 2020-05-25 23:48:38 +02:00
LICENSE Initial commit 2019-08-28 20:36:44 +02:00
README.md Upgrade to v2.0.0-rc4 (#62) 2020-06-27 09:14:55 -07:00
docker-compose.yml change (ci): new CI image 2020-06-10 16:31:53 +02:00

README.md

Try on playground

Substrate Node Template

A new FRAME-based Substrate node, ready for hacking 🚀

Local Development

Follow these steps to prepare your local environment for Substrate development 🛠️

Simple Method

You can install all the required dependencies with a single command (be patient, this can take up to 30 minutes).

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

Manual Method

Manual steps for Linux-based systems can be found below; you can find more information at substrate.dev.

Install Rust:

curl https://sh.rustup.rs -sSf | sh

Initialize your Wasm Build environment:

./scripts/init.sh

Build

Once you have prepared your local development environment, you can build the node template. Use this command to build the Wasm and native code:

cargo build --release

Playground Try on playground

The Substrate Playground is an online development environment that allows you to take advantage of a pre-configured container with pre-compiled build artifacts 🤸‍♀️

Run

Single Node Development Chain

Purge any existing developer chain state:

./target/release/node-template purge-chain --dev

Start a development chain with:

./target/release/node-template --dev

Detailed logs may be shown by running the node with the following environment variables set: RUST_LOG=debug RUST_BACKTRACE=1 cargo run -- --dev.

Multi-Node Local Testnet

If you want to see the multi-node consensus algorithm in action, refer to our Start a Private Network tutorial.

Run in Docker

First, install Docker and Docker Compose.

Then run the following command to start a single node development chain.

./scripts/docker_run.sh

This command will firstly compile your code, and then start a local development network. You can also replace the default command (cargo build --release && ./target/release/node-template --dev --ws-external) by appending your own. A few useful ones are as follow.

# Run Substrate node without re-compiling
./scripts/docker_run.sh ./target/release/node-template --dev --ws-external

# Purge the local dev chain
./scripts/docker_run.sh ./target/release/node-template purge-chain --dev

# Check whether the code is compilable
./scripts/docker_run.sh cargo check