Linux

Setting Up a Linux Development Environment for Rust

This guide will help you set up your Linux environment for Rust development, focusing on the necessary steps to install Rust and the required dependencies for developing and validating on the Argochain network.

Prerequisites

Before you begin, ensure your system is up to date and has the necessary tools installed. This guide uses Ubuntu as an example, but the commands can be adapted for other Linux distributions.

Step 1: Update Your System

Open a terminal and update your package lists.

sudo apt update

Step 2: Install Required Packages

Install the essential packages:

sudo apt install -y build-essential clang curl git libssl-dev llvm libudev-dev python3 python3-pip make protobuf-compiler

Step 3: Install Rust

Download and run the rustup installation script to install Rust:

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

Follow the on-screen instructions to complete the installation.

Step 4: Configure Rust

To update your current shell to include Cargo (Rust's package manager), run:

source $HOME/.cargo/env

Verify the Rust installation:

rustc --version

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

rustup default stable
rustup update

Step 5: Add Nightly Toolchain and WebAssembly Target

Add the nightly toolchain and the WebAssembly (wasm) target required for Substrate development:

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

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 Node Template

Compile the Argochain node:

cargo build --release

The compilation process may take several minutes.

Last updated