MacOS

Setting Up a macOS Development Environment for Rust

This guide will help you install Rust and set up a Substrate development environment on Apple macOS computers with either Intel or Apple M1 processors.

Before You Begin

Ensure your computer meets the following requirements:

  • Operating System: macOS 10.7 Lion or later

  • Processor: At least 2GHz (3GHz recommended)

  • Memory: At least 8 GB RAM (16 GB recommended)

  • Storage: At least 10 GB available space

  • Internet: Broadband connection

Step 1: Install Homebrew

If you don't have Homebrew installed, you should install it to manage packages on macOS.

  1. Open the Terminal application.

  2. Download and install Homebrew by running:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  3. Verify Homebrew installation:

    brew --version

Step 2: Install Required Packages

  1. Update Homebrew:

    brew update
  2. Install required packages:

    brew install protobuf openssl cmake python git

Step 3: Install Rust

  1. Download and run the rustup installation script:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. Follow the prompts for default installation.

  3. Update your current shell to include Cargo:

    source ~/.cargo/env
  4. Verify Rust installation:

    rustc --version
  5. Configure Rust to use the stable version and update:

    rustup default stable
    rustup update
    rustup target add wasm32-unknown-unknown
  6. Add the nightly toolchain and WebAssembly (wasm) targets:

    rustup update nightly
    rustup target add wasm32-unknown-unknown --toolchain nightly
  7. Verify the configuration:

    rustup show
    rustup +nightly show

Compile a Substrate Node

Now that Rust is installed and configured, you can compile a Substrate node.

Step 1: Clone the Node Template Repository

  1. Clone the Substrate node template repository:

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

Step 2: Compile the Node Template

  1. Compile the node template:

    cargo build --release

    The compilation process may take several minutes.

Your development environment is now set up for Substrate development.

Next Steps

Your local computer is ready for Substrate development activity. For further resources and guides, visit the Substrate Developer Hub.

Last updated