diff --git a/Dockerfile b/Dockerfile index e3462ed69..9db23b7ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,17 +5,13 @@ WORKDIR /dhx/node COPY . . -RUN apt-get update && apt-get install -y build-essential wget cmake pkg-config libssl-dev \ +# https://substrate.dev/docs/en/knowledgebase/getting-started +RUN apt-get update && apt-get install -y build-essential wget cmake pkg-config libssl-dev llvm \ openssl git gcc clang libclang-dev curl vim unzip screen bash \ && curl https://getsubstrate.io -sSf | bash -s -- --fast \ - && wget -O - https://sh.rustup.rs | sh -s -- -y \ + && . /root/.cargo/env \ && PATH=$PATH:/root/.cargo/bin \ - && rustup update stable \ - && rustup update nightly \ - && rustup toolchain install nightly-2021-03-10 \ - && rustup target add wasm32-unknown-unknown --toolchain nightly-2021-03-10 \ - && rustup default nightly-2021-03-10 \ - && rustup override set nightly-2021-03-10 \ + && ./scripts/init.sh && \ && cargo version \ && rustc --version \ && cargo build --release diff --git a/EXAMPLES.md b/EXAMPLES.md index 1f5fa89c4..1518d7e87 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -10,28 +10,21 @@ ## Install and update: Rust, Substrate, Wasm, and Subkey -* Install and update dependencies (i.e. cmake, gcc, ssl, llvm, etc) - * Refer to the [Dockerfile](./Dockerfile) for details on linux. - * Refer to https://getsubstrate.io/ for installation steps on various operating systems. +* Install and update Build Dependencies by following Substrate Developer Hub instructions https://substrate.dev/docs/en/knowledgebase/getting-started/#1-build-dependencies for your specific operating system -* Install and update Rust, Substrate, Wasm, and Subkey: +* Install and update Rust, Substrate, Wasm: ```bash -curl https://getsubstrate.io -sSf | bash -s -- --fast && \ -cargo install --force subkey --git https://github.com/paritytech/substrate --version 2.0.0 --locked && \ -./scripts/init.sh && \ -. ~/.cargo/env && \ wget -O - https://sh.rustup.rs | sh -s -- -y && \ +. ~/.cargo/env && \ PATH=$PATH:~/.cargo/bin && \ -rustup update stable nightly && \ -rustup toolchain install nightly-2021-03-10 && \ -rustup target add wasm32-unknown-unknown --toolchain nightly-2021-03-10 && \ -rustup default nightly-2021-03-10 && \ -rustup override set nightly-2021-03-10 && \ +./scripts/init.sh && \ cargo version && \ rustc --version ``` +* Optionally install Subkey from https://substrate.dev/docs/en/knowledgebase/integrate/subkey + ## Example "dev" development PoS testnet (with single node) ### Intro diff --git a/scripts/init.sh b/scripts/init.sh index 617e8a961..d889b98eb 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -4,6 +4,7 @@ set -e echo "*** Initializing WASM build environment" +rustup default stable rustup update stable rustup update nightly rustup toolchain install nightly-2021-03-10