Update to v2.0.1 (#126)
* Add Rust setup steps * Update to v2.0.1 * Cannot skip Wasm build * Update docs * Update build.rs * new wasm builder, cargo update, and script tweaks * minor update Co-authored-by: Dan Shields <35669742+NukeManDan@users.noreply.github.com> Co-authored-by: Dan Shields <nukemandan@protonmail.com> Co-authored-by: Jimmy Chu <jimmychu0807@gmail.com>main
parent
4d97032c11
commit
09d8af797f
File diff suppressed because it is too large
Load Diff
8
Makefile
8
Makefile
|
@ -4,16 +4,16 @@ init:
|
||||||
|
|
||||||
.PHONY: check
|
.PHONY: check
|
||||||
check:
|
check:
|
||||||
SKIP_WASM_BUILD=1 cargo check
|
SKIP_WASM_BUILD=1 cargo check --release
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
SKIP_WASM_BUILD=1 cargo test --all
|
SKIP_WASM_BUILD=1 cargo test --release --all
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run:
|
run:
|
||||||
WASM_BUILD_TOOLCHAIN=nightly-2020-10-05 cargo run --release -- --dev --tmp
|
cargo run --release -- --dev --tmp
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build:
|
build:
|
||||||
WASM_BUILD_TOOLCHAIN=nightly-2020-10-05 cargo build --release
|
cargo build --release
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Substrate Node Template
|
# Substrate Node Template
|
||||||
|
|
||||||
A new FRAME-based Substrate node, ready for hacking :rocket:
|
A fresh FRAME-based [Substrate](https://www.substrate.io/) node, ready for hacking :rocket:
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
|
@ -8,11 +8,8 @@ This project contains some configuration files to help get started :hammer_and_w
|
||||||
|
|
||||||
### Rust Setup
|
### Rust Setup
|
||||||
|
|
||||||
Setup instructions for working with the [Rust](https://www.rust-lang.org/) programming language can
|
Follow the [Rust setup instructions](./doc/rust-setup.md) before using the included Makefile to
|
||||||
be found at the
|
build the Node Template.
|
||||||
[Substrate Developer Hub](https://substrate.dev/docs/en/knowledgebase/getting-started). Follow those
|
|
||||||
steps to install [`rustup`](https://rustup.rs/) and configure the Rust toolchain to default to the
|
|
||||||
latest stable version.
|
|
||||||
|
|
||||||
### Makefile
|
### Makefile
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,73 @@
|
||||||
|
---
|
||||||
|
title: Installation
|
||||||
|
---
|
||||||
|
|
||||||
|
This page will guide you through the steps needed to prepare a computer for development with the
|
||||||
|
Substrate Node Template. Since Substrate is built with
|
||||||
|
[the Rust programming language](https://www.rust-lang.org/), the first thing you will need to do is
|
||||||
|
prepare the computer for Rust development - these steps will vary based on the computer's operating
|
||||||
|
system. Once Rust is configured, you will use its toolchains to interact with Rust projects; the
|
||||||
|
commands for Rust's toolchains will be the same for all supported, Unix-based operating systems.
|
||||||
|
|
||||||
|
## Unix-Based Operating Systems
|
||||||
|
|
||||||
|
Substrate development is easiest on Unix-based operating systems like macOS or Linux. The examples
|
||||||
|
in the Substrate [Tutorials](https://substrate.dev/tutorials) and [Recipes](https://substrate.dev/recipes/)
|
||||||
|
use Unix-style terminals to demonstrate how to interact with Substrate from the command line.
|
||||||
|
|
||||||
|
### macOS
|
||||||
|
|
||||||
|
Open the Terminal application and execute the following commands:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install Homebrew if necessary https://brew.sh/
|
||||||
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
||||||
|
|
||||||
|
# Make sure Homebrew is up-to-date, install openssl and cmake
|
||||||
|
brew update
|
||||||
|
brew install openssl cmake
|
||||||
|
```
|
||||||
|
|
||||||
|
### Ubuntu/Debian
|
||||||
|
|
||||||
|
Use a terminal shell to execute the following commands:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt update
|
||||||
|
# May prompt for location information
|
||||||
|
sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl
|
||||||
|
```
|
||||||
|
|
||||||
|
### Arch Linux
|
||||||
|
|
||||||
|
Run these commands from a terminal:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pacman -Syu --needed --noconfirm cmake gcc openssl-1.0 pkgconf git clang
|
||||||
|
export OPENSSL_LIB_DIR="/usr/lib/openssl-1.0"
|
||||||
|
export OPENSSL_INCLUDE_DIR="/usr/include/openssl-1.0"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Rust Developer Environment
|
||||||
|
|
||||||
|
This project uses [`rustup`](https://rustup.rs/) to help manage the Rust toolchain. First install
|
||||||
|
and configure `rustup`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install
|
||||||
|
curl https://sh.rustup.rs -sSf | sh
|
||||||
|
# Configure
|
||||||
|
source ~/.cargo/env
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally, configure the Rust toolchain to default to the latest stable version:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
rustup default stable
|
||||||
|
```
|
||||||
|
|
||||||
|
## Build the Project
|
||||||
|
|
||||||
|
Now that the standard Rust environment is configured, use the
|
||||||
|
[included Makefile](../README.md#makefile) to install the project-specific toolchains and build the
|
||||||
|
project.
|
|
@ -7,7 +7,7 @@ homepage = 'https://substrate.dev'
|
||||||
license = 'Unlicense'
|
license = 'Unlicense'
|
||||||
name = 'node-template'
|
name = 'node-template'
|
||||||
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
||||||
version = '2.0.0'
|
version = '2.0.1'
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = 'node-template'
|
name = 'node-template'
|
||||||
|
@ -16,41 +16,41 @@ name = 'node-template'
|
||||||
targets = ['x86_64-unknown-linux-gnu']
|
targets = ['x86_64-unknown-linux-gnu']
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
substrate-build-script-utils = '2.0.0'
|
substrate-build-script-utils = '2.0.1'
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
jsonrpc-core = '15.0.0'
|
jsonrpc-core = '15.0.0'
|
||||||
structopt = '0.3.8'
|
structopt = '0.3.8'
|
||||||
|
|
||||||
# local dependencies
|
# local dependencies
|
||||||
node-template-runtime = { path = '../runtime', version = '2.0.0' }
|
node-template-runtime = { path = '../runtime', version = '2.0.1' }
|
||||||
|
|
||||||
# Substrate dependencies
|
# Substrate dependencies
|
||||||
frame-benchmarking = '2.0.0'
|
frame-benchmarking = '2.0.1'
|
||||||
frame-benchmarking-cli = '2.0.0'
|
frame-benchmarking-cli = '2.0.1'
|
||||||
pallet-transaction-payment-rpc = '2.0.0'
|
pallet-transaction-payment-rpc = '2.0.1'
|
||||||
sc-basic-authorship = '0.8.0'
|
sc-basic-authorship = '0.8.1'
|
||||||
sc-cli = { features = ['wasmtime'], version = '0.8.0' }
|
sc-cli = { features = ['wasmtime'], version = '0.8.1' }
|
||||||
sc-client-api = '2.0.0'
|
sc-client-api = '2.0.1'
|
||||||
sc-consensus = '0.8.0'
|
sc-consensus = '0.8.1'
|
||||||
sc-consensus-aura = '0.8.0'
|
sc-consensus-aura = '0.8.1'
|
||||||
sc-executor = { features = ['wasmtime'], version = '0.8.0' }
|
sc-executor = { features = ['wasmtime'], version = '0.8.1' }
|
||||||
sc-finality-grandpa = '0.8.0'
|
sc-finality-grandpa = '0.8.1'
|
||||||
sc-rpc = '2.0.0'
|
sc-rpc = '2.0.1'
|
||||||
sc-rpc-api = '0.8.0'
|
sc-rpc-api = '0.8.1'
|
||||||
sc-service = { features = ['wasmtime'], version = '0.8.0' }
|
sc-service = { features = ['wasmtime'], version = '0.8.1' }
|
||||||
sc-transaction-pool = '2.0.0'
|
sc-transaction-pool = '2.0.1'
|
||||||
sp-api = '2.0.0'
|
sp-api = '2.0.1'
|
||||||
sp-block-builder = '2.0.0'
|
sp-block-builder = '2.0.1'
|
||||||
sp-blockchain = '2.0.0'
|
sp-blockchain = '2.0.1'
|
||||||
sp-consensus = '0.8.0'
|
sp-consensus = '0.8.1'
|
||||||
sp-consensus-aura = '0.8.0'
|
sp-consensus-aura = '0.8.1'
|
||||||
sp-core = '2.0.0'
|
sp-core = '2.0.1'
|
||||||
sp-finality-grandpa = '2.0.0'
|
sp-finality-grandpa = '2.0.1'
|
||||||
sp-inherents = '2.0.0'
|
sp-inherents = '2.0.1'
|
||||||
sp-runtime = '2.0.0'
|
sp-runtime = '2.0.1'
|
||||||
sp-transaction-pool = '2.0.0'
|
sp-transaction-pool = '2.0.1'
|
||||||
substrate-frame-rpc-system = '2.0.0'
|
substrate-frame-rpc-system = '2.0.1'
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
|
|
@ -6,7 +6,7 @@ homepage = 'https://substrate.dev'
|
||||||
license = 'Unlicense'
|
license = 'Unlicense'
|
||||||
name = 'pallet-template'
|
name = 'pallet-template'
|
||||||
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
||||||
version = '2.0.0'
|
version = '2.0.1'
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
targets = ['x86_64-unknown-linux-gnu']
|
targets = ['x86_64-unknown-linux-gnu']
|
||||||
|
@ -19,13 +19,13 @@ package = 'parity-scale-codec'
|
||||||
version = '1.3.4'
|
version = '1.3.4'
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
frame-support = { default-features = false, version = '2.0.0' }
|
frame-support = { default-features = false, version = '2.0.1' }
|
||||||
frame-system = { default-features = false, version = '2.0.0' }
|
frame-system = { default-features = false, version = '2.0.1' }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
sp-core = { default-features = false, version = '2.0.0' }
|
sp-core = { default-features = false, version = '2.0.1' }
|
||||||
sp-io = { default-features = false, version = '2.0.0' }
|
sp-io = { default-features = false, version = '2.0.1' }
|
||||||
sp-runtime = { default-features = false, version = '2.0.0' }
|
sp-runtime = { default-features = false, version = '2.0.1' }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ['std']
|
default = ['std']
|
||||||
|
|
|
@ -5,13 +5,13 @@ homepage = 'https://substrate.dev'
|
||||||
license = 'Unlicense'
|
license = 'Unlicense'
|
||||||
name = 'node-template-runtime'
|
name = 'node-template-runtime'
|
||||||
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
||||||
version = '2.0.0'
|
version = '2.0.1'
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
targets = ['x86_64-unknown-linux-gnu']
|
targets = ['x86_64-unknown-linux-gnu']
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
wasm-builder-runner = { package = 'substrate-wasm-builder-runner', version = '2.0.0' }
|
substrate-wasm-builder = '3.0.0'
|
||||||
|
|
||||||
# alias "parity-scale-code" to "codec"
|
# alias "parity-scale-code" to "codec"
|
||||||
[dependencies.codec]
|
[dependencies.codec]
|
||||||
|
@ -22,37 +22,37 @@ version = '1.3.4'
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
hex-literal = { optional = true, version = '0.3.1' }
|
hex-literal = { optional = true, version = '0.3.1' }
|
||||||
serde = { features = ['derive'], optional = true, version = '1.0.101' }
|
serde = { features = ['derive'], optional = true, version = '1.0.119' }
|
||||||
|
|
||||||
# local dependencies
|
# local dependencies
|
||||||
pallet-template = { path = '../pallets/template', default-features = false, version = '2.0.0' }
|
pallet-template = { path = '../pallets/template', default-features = false, version = '2.0.1' }
|
||||||
|
|
||||||
# Substrate dependencies
|
# Substrate dependencies
|
||||||
frame-benchmarking = { default-features = false, optional = true, version = '2.0.0' }
|
frame-benchmarking = { default-features = false, optional = true, version = '2.0.1' }
|
||||||
frame-executive = { default-features = false, version = '2.0.0' }
|
frame-executive = { default-features = false, version = '2.0.1' }
|
||||||
frame-support = { default-features = false, version = '2.0.0' }
|
frame-support = { default-features = false, version = '2.0.1' }
|
||||||
frame-system = { default-features = false, version = '2.0.0' }
|
frame-system = { default-features = false, version = '2.0.1' }
|
||||||
frame-system-benchmarking = { default-features = false, optional = true, version = '2.0.0' }
|
frame-system-benchmarking = { default-features = false, optional = true, version = '2.0.1' }
|
||||||
frame-system-rpc-runtime-api = { default-features = false, version = '2.0.0' }
|
frame-system-rpc-runtime-api = { default-features = false, version = '2.0.1' }
|
||||||
pallet-aura = { default-features = false, version = '2.0.0' }
|
pallet-aura = { default-features = false, version = '2.0.1' }
|
||||||
pallet-balances = { default-features = false, version = '2.0.0' }
|
pallet-balances = { default-features = false, version = '2.0.1' }
|
||||||
pallet-grandpa = { default-features = false, version = '2.0.0' }
|
pallet-grandpa = { default-features = false, version = '2.0.1' }
|
||||||
pallet-randomness-collective-flip = { default-features = false, version = '2.0.0' }
|
pallet-randomness-collective-flip = { default-features = false, version = '2.0.1' }
|
||||||
pallet-sudo = { default-features = false, version = '2.0.0' }
|
pallet-sudo = { default-features = false, version = '2.0.1' }
|
||||||
pallet-timestamp = { default-features = false, version = '2.0.0' }
|
pallet-timestamp = { default-features = false, version = '2.0.1' }
|
||||||
pallet-transaction-payment = { default-features = false, version = '2.0.0' }
|
pallet-transaction-payment = { default-features = false, version = '2.0.1' }
|
||||||
pallet-transaction-payment-rpc-runtime-api = { default-features = false, version = '2.0.0' }
|
pallet-transaction-payment-rpc-runtime-api = { default-features = false, version = '2.0.1' }
|
||||||
sp-api = { default-features = false, version = '2.0.0' }
|
sp-api = { default-features = false, version = '2.0.1' }
|
||||||
sp-block-builder = { default-features = false, version = '2.0.0' }
|
sp-block-builder = { default-features = false, version = '2.0.1' }
|
||||||
sp-consensus-aura = { default-features = false, version = '0.8.0' }
|
sp-consensus-aura = { default-features = false, version = '0.8.1' }
|
||||||
sp-core = { default-features = false, version = '2.0.0' }
|
sp-core = { default-features = false, version = '2.0.1' }
|
||||||
sp-inherents = { default-features = false, version = '2.0.0' }
|
sp-inherents = { default-features = false, version = '2.0.1' }
|
||||||
sp-offchain = { default-features = false, version = '2.0.0' }
|
sp-offchain = { default-features = false, version = '2.0.1' }
|
||||||
sp-runtime = { default-features = false, version = '2.0.0' }
|
sp-runtime = { default-features = false, version = '2.0.1' }
|
||||||
sp-session = { default-features = false, version = '2.0.0' }
|
sp-session = { default-features = false, version = '2.0.1' }
|
||||||
sp-std = { default-features = false, version = '2.0.0' }
|
sp-std = { default-features = false, version = '2.0.1' }
|
||||||
sp-transaction-pool = { default-features = false, version = '2.0.0' }
|
sp-transaction-pool = { default-features = false, version = '2.0.1' }
|
||||||
sp-version = { default-features = false, version = '2.0.0' }
|
sp-version = { default-features = false, version = '2.0.1' }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ['std']
|
default = ['std']
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
use wasm_builder_runner::WasmBuilder;
|
use substrate_wasm_builder::WasmBuilder;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
WasmBuilder::new()
|
WasmBuilder::new()
|
||||||
.with_current_project()
|
.with_current_project()
|
||||||
.with_wasm_builder_from_crates("2.0.0")
|
|
||||||
.export_heap_base()
|
|
||||||
.import_memory()
|
.import_memory()
|
||||||
|
.export_heap_base()
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,13 +2,11 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "*** Initializing WASM build environment"
|
echo "*** Initializing WASM build environment ***"
|
||||||
|
|
||||||
if [ -z $CI_PROJECT_NAME ] ; then
|
if [ -z $CI_PROJECT_NAME ] ; then
|
||||||
rustup update nightly
|
rustup update nightly
|
||||||
rustup update nightly-2020-10-05
|
|
||||||
rustup update stable
|
rustup update stable
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rustup target add wasm32-unknown-unknown --toolchain nightly
|
rustup target add wasm32-unknown-unknown --toolchain nightly
|
||||||
rustup target add wasm32-unknown-unknown --toolchain nightly-2020-10-05
|
|
||||||
|
|
Loading…
Reference in New Issue