Install
Before you can begin developing, it’s essential to prepare your development environment by installing the necessary compiler and tools. Since Substrate—and most of the tools used for Substrate development—are built using the Rust programming language, the first step is to install Rust on your computer.
The installation process for Rust varies depending on your operating system. Below are the instructions for each platform:
Linux
Here's an improved version of your Rust installation guide. I've organized the information more clearly, enhanced readability, and provided additional context where needed.
Rust Installation Guide for Linux
Before You Begin
Prerequisites
Before installing Rust, ensure your system meets the following requirements:
Check Documentation: Refer to your operating system's documentation for information about installed packages and how to download and install any necessary packages.
Required Packages: At a minimum, you need the following packages:
clang
curl
git
make
Cryptography Support: Since blockchain development requires standard cryptography for generating public/private key pairs and validating transaction signatures, you also need a package that provides cryptography:
For Debian-based systems (like Ubuntu): libssl-dev
For Red Hat-based systems (like Fedora): openssl-devel
Install Required Packages
To install the necessary packages, follow these steps:
Open a Terminal: Log on to your computer and open a terminal shell.
Check Installed Packages: Use the appropriate package management command for your Linux distribution to check installed packages.
Install Missing Dependencies: Run the following command to install the required packages. Adjust the command based on your distribution.
Example for Ubuntu:
Other Distributions:
Debian:
Arch:
Fedora:
OpenSUSE:
Note:Different distributions may use different package managers and package names. Ensure you adjust the commands accordingly.
Install Rust
Download and Install rustup: Use the following command to download and install the Rust toolchain:
Follow the on-screen prompts to proceed with the default installation.
Update Your Shell: To ensure your current shell session recognizes Cargo (Rust's package manager), run:
Verify Installation: Check that Rust is installed correctly by running:
Configure Rust Toolchain
Set Default Toolchain: Configure the Rust toolchain to default to the latest stable version:
Add Nightly Release and Targets: If you need nightly features or WebAssembly support, add the nightly release and targets:
Verify Configuration: Check your development environment configuration:
You should see output similar to:
You have successfully installed the Rust toolchain on your Linux system! You can now start developing Rust applications. For more resources and documentation, visit The Rust Programming Language.
macOS
Here's an improved version of your documentation for installing Rust on macOS. You can copy this text into Google Docs to save it in .docx format.
Rust Installation Guide for macOS
Before You Install
Before setting up your development environment on macOS, ensure your computer meets the following requirements:
Operating System: macOS 10.7 Lion or later
Processor Speed: At least 2 GHz (3 GHz recommended)
Memory: Minimum of 8 GB RAM (16 GB recommended)
Storage: At least 10 GB of available storage
Internet Connection: Broadband connection
Apple Silicon Support: Ensure your setup supports Apple Silicon.
Additionally, Protobuf must be installed before the build process begins. To install it, run the following command:
Install Homebrew
Homebrew is the recommended package manager for macOS. If you don't have it installed, follow these steps:
Open Terminal: Launch the Terminal application on your Mac.
Install Homebrew: Run the following command to download and install Homebrew:
Verify Installation: Check that Homebrew is installed successfully by running:
You should see output similar to:
Installation of Rust and Dependencies
To set up Rust and its dependencies, follow these steps:
Open Terminal: Ensure you are in the Terminal application.
Update Homebrew: Make sure Homebrew is up to date by running:
Install OpenSSL: Install the OpenSSL package:
Install Rust: Download the
rustup
installation program and use it to install Rust:
Follow Prompts: Follow the on-screen prompts to complete the default installation.
Update Shell: Include Cargo in your current shell session:
Verify Installation: Confirm that Rust is installed correctly by running:
Configure the Rust Toolchain
Set Default Toolchain: Configure the Rust toolchain to use the latest stable version:
Add Nightly Release and Targets: To include nightly features and WebAssembly support, run:
Verify Configuration: Check your Rust environment configuration:
You should see output similar to:
Install CMake
To complete your setup, install CMake with the following command:
Last updated