Normally, we would teach you more about the Substrate blockchain development framework, however, setting up your computer for Substrate development can take a while.
To optimize your time, we will have you start the setup process. While things are compiling, you can continue to the next section to learn more about Substrate and what we are building.
You will probably need to do some set-up to prepare your computer for Substrate development.
If you are using a Unix-based machine (Linux, MacOS), Parity created a simple one-liner to help you set up your computer:
curl https://getsubstrate.io -sSf | bash -s -- --fast
If you did not have Rust installed prior to running this script, make sure to restart your terminal before continuing.
Learn what this script does.
You can view the source code for this script by visiting https://getsubstrate.io in your browser.
It will automatically install:
Once the prerequisites are installed, you can use Git to clone the Substrate Developer Hub Node Template, which serves as a good starting point for building on Substrate.
Clone the RioDeFi Node (version
git clone -b v1.0.0 --depth 1 https://github.com/RioDefi/riodefi-node
Initialize your WebAssembly build environment
# Load settings into the current shell script if you can't use rustup command # If you've run this before, you don't need to run it again. But doing so is harmless. source ~/.cargo/env # Update Rust rustup update nightly rustup update stable # Add Wasm target rustup target add wasm32-unknown-unknown --toolchain nightly
Compile the Node Template
cd riodefi-node/ cargo build --release
The time required for the compilation step depends on the hardware you're using. Don't wait before moving on.
Install the Front-End Template
This tutorial uses a ReactJS front-end template to allow you to interact with the Substrate-based blockchain node that you should have started compiling in the previous step. You can use this same front-end template to create UIs for your own projects in the future.
Now you can proceed to set up the front-end template with these commands.
# Clone the code from github git clone -b v2.0.0-rc6 --depth 1 https://github.com/substrate-developer-hub/substrate-front-end-template # Install the dependencies cd substrate-front-end-template yarn install