Getting Rust & Scrypto
  • 09 Feb 2024
  • 1 Minute to read
  • Dark
    Light
  • PDF

Getting Rust & Scrypto

  • Dark
    Light
  • PDF

Article Summary

Install the Scrypto Toolchain

To begin working with Scrypto, you need to first prepare you system for Rust development. Then you can install the Scrypto Libraries, Radix Engine Simulator resim and command line tools from the Radixdlt-Scrypto github repository.

Install Rust compiler

  • On Windows:

    • Install git by running the installer that you can find here

      • Enable git long path support:

      git config --system core.longpaths true
    • Install "Desktop development with C++" with Build Tools for Visual Studio 2019

    • Download and install rustup-init.exe

    • Install LLVM 13.0.1 (make sure you tick the option that adds LLVM to the system PATH)

  • On macOS:

    • Make sure you have the xcode command line tools by running:

      xcode-select --install
    • Install cmake and LLVM

      brew install cmake llvm

      Add LLVM to the system path by adding below line to the ~/.profile

      PATH="/opt/homebrew/opt/llvm/bin:$PATH"

    • Install Rust compiler

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

    • Make sure a C++ compiler and LLVM is installed:

      sudo apt install clang build-essential llvm
    • Install Rust compiler

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

Enable cargo in the current shell

  • On Windows:

    • Start a new PowerShell

  • On Linux or macOS:

    source $HOME/.cargo/env

Add WebAssembly target:

rustup target add wasm32-unknown-unknown

Install Radix Engine Simulator and command-line tools:

git clone https://github.com/radixdlt/radixdlt-scrypto.git
cd radixdlt-scrypto
cargo install --path ./simulator

If you encounter problems when installing the simulator, make sure that you’re running the latest stable version of Rust before trying again!

rustup update stable

When you install the simulator crate you get two things, the scrypto CLI tool which is essentially a wrapper around the cargo CLI tool with a few adjustments and resim the Radix Engine Simulator

For more info:


Was this article helpful?