From 1d6e830474290d3a1893a475aca305c1c65b5f03 Mon Sep 17 00:00:00 2001 From: Jimmy Chu Date: Wed, 8 Jan 2020 11:54:10 +0800 Subject: [PATCH] readme update on generating your own node-template (#16) Added readme for generating your own substrate node template --- README.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4ae6047..355a412 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ cargo build --release ## Run -### Single node development chain +### Single Node Development Chain Purge any existing developer chain state: @@ -40,7 +40,7 @@ Start a development chain with: 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 +### Multi-Node Local Testnet If you want to see the multi-node consensus algorithm in action locally, then you can create a local testnet with two validator nodes for Alice and Bob, who are the initial authorities of the genesis chain that have been endowed with testnet units. @@ -74,3 +74,29 @@ cargo run -- \ ``` Additional CLI usage options are available and may be shown by running `cargo run -- --help`. + +### Advanced: Generate Your Own Substrate Node Template + +A substrate node template is always based on a certain version of Substrate. You can inspect it by +opening [Cargo.toml](Cargo.toml) and see the template referred to a specific Substrate commit( +`rev` field), branch, or version. + +You can generate your own Substrate node-template based on a particular Substrate +version/commit by running following commands: + +```bash +# git clone from the main Substrate repo +git clone https://github.com/paritytech/substrate.git +cd substrate + +# Switch to a particular branch or commit of the Substrate repo your node-template based on +git checkout + +# Run the helper script to generate a node template. +# This script compiles Substrate and takes a while to complete. It takes a relative file path +# from the current dir. to output the compressed node template. +.maintain/node-template-release.sh ../node-template.tar.gz +``` + +Noted though you will likely get faster and more thorough support if you stick with the releases +provided in this repository.