Windows

Setting Up a Windows Development Environment for Rust

To create a suitable development environment for Substrate on a Windows computer, you can use Windows Subsystem for Linux (WSL) to emulate a UNIX operating system. While UNIX-based systems like macOS or Linux offer better environments for building Substrate-based blockchains, using WSL can be a viable alternative. All code examples and command-line instructions in Substrate tutorials and guides are UNIX-based.

Before You Begin

Ensure the following requirements are met:

  • Operating System: Microsoft Windows 10, version 2004 or later, or Windows 11

  • Internet Connection: Good broadband connection

  • Shell Access: Access to a terminal on your local computer

Set Up Windows Subsystem for Linux (WSL)

WSL enables you to emulate a Linux environment on a Windows computer, allowing you to use UNIX commands directly.

Step 1: Enable WSL

  1. Open PowerShell or Command Prompt as an administrator.

  1. Run the following command to enable WSL:

wsl --install

This command installs the required WSL 2 components, downloads the latest Linux kernel, and installs the Ubuntu Linux distribution by default.

  1. To see other available Linux distributions, run:

wsl --list --online

  1. Restart your computer to complete the installation.

Step 2: Install Required Packages and Rust

  1. Open the Ubuntu application from the Start menu.

  1. Create a UNIX user account by providing a username and password.

  1. Update the package list:

sudo apt update

  1. Install the required packages:

sudo apt install --assume-yes git clang curl libssl-dev llvm python3 python3-pip libudev-dev make protobuf-compiler

  1. Download and install Rust:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

  1. Follow the prompts for default installation.

  1. Update your shell to include Cargo:

source ~/.cargo/env

  1. Verify the Rust installation:

rustc --version

  1. Set Rust to use the stable version by default and update:

rustup default stable
rustup update

  1. Add the nightly toolchain and WebAssembly (wasm) targets:

rustup update nightly
rustup target add wasm32-unknown-unknown --toolchain nightly

  1. Verify the configuration:

rustup show
rustup +nightly show

Compile the Argochain Node

Now that Rust is installed and configured, you can compile an Argochain node.

Step 1: Clone the Argochain Repository

Clone the Argochain repository:

git clone https://github.com/devolved-ai/argochain
cd argochain

Step 2: Compile the Argochain Node

Compile the node template:

cargo build --release

The compilation process may take several minutes.

Your development environment is now configured for validation and staking on the Argochain network.

Last updated