Magnet
  • Welcome to Magnet
  • Overview
    • Magnet Network Features
      • Magnet Coretime
      • Coretime Order Control and Assurance
      • Workflows of Magnet Network
      • Profit Calcuation and Distribution
    • Magnet Stack Features
      • Magnet Stack Coretime Modules
  • Product Guides
    • Setup a Local Node
      • Installing Substrate Dependencies
      • Launching the Local Relay Chain
      • Build the Magnet Node
      • Prepare the parachain Collator
      • Register on the Local Relay Chain
    • Deploy Contracts on Magnet Network
      • EVM Contract Deployment
      • WASM Contract Deployment
      • MoveVM Contract Deployment
    • Bridge Asset
      • Bridging Asset between EVM and Substrate
      • Bridging Asset with XCM
    • Develop Coretime-Ready chain with Magnet Stack
      • Preparation: Reserve a ParaID
      • Preparation: Generate the Collator's Address
      • Preparation: Purchase Bulk Core
      • Using Magnet Stack : Coretime Configuration
      • Using Magnet Stack : Virtual Machine Configuration
      • Using Magnet Stack : Functional Models
      • Using Magnet Stack : Summary
      • Deployment & Connection to Rocococ
        • Define the collator's address
Powered by GitBook
On this page
  1. Product Guides
  2. Setup a Local Node

Installing Substrate Dependencies

Installing Substrate Dependencies

Substrate is a modular framework that enables you to create purpose-built blockchains by composing custom or pre-built components. Below is a markdown document that you can use as a template for creating a guide on installing Substrate dependencies.

1. Install Rust

Substrate is developed using Rust; hence, Rust is a prerequisite for Substrate. Install Rust using rustup by running the following command in your terminal:

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

After completing the installation, restart your terminal and run:

source $HOME/.cargo/env

Or, add the following line to your shell profile file (e.g., ~/.bashrc or ~/.zshrc):

export PATH=$HOME/.cargo/bin:$PATH

Update Rust

Keep your Rust installation up to date by running:

rustup update

2. Install Additional Libraries

Substrate has several library dependencies. Install them using the appropriate commands for your operating system:

For Ubuntu

sudo apt update
sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev

For macOS

brew install cmake pkg-config openssl git llvm

3. Install Substrate

With Rust and the necessary libraries installed, proceed to install Substrate:

curl https://getsubstrate.io -sSf | bash -s -- --fast

4. Verify Installation

Check your Substrate installation by running:

substrate --version

This command should output the installed Substrate version.

5. Configure Rust Toolchain

Configure the Rust toolchain for Substrate by running:

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

Completion

At this point, you should have a working Substrate development environment. Regularly check for updates and keep your installations current by running rustup update and cargo update.

Remember to replace the placeholder text with the actual content, and feel free to modify the structure and formatting to suit your preferences and requirements.

PreviousSetup a Local NodeNextLaunching the Local Relay Chain

Last updated 9 months ago