- 29 Nov 2024
- 4 Minutes to read
- DarkLight
- PDF
Getting Rust & Scrypto
- Updated on 29 Nov 2024
- 4 Minutes to read
- DarkLight
- PDF
Here you'll find steps for installing the Scrypto toolchain on Linux, macOS and Windows. Troubleshooting suggestions follow after the installation instructions.
Compatibility
The table below shows the compatibility between Scrypto and other tools.
Scrypto/Resim | LLVM/Clang | Rust |
---|---|---|
v1.3.0 | 18 | 1.81.0 |
v1.2.0 | 17 | 1.77.2 |
v1.1.0 | 17 | 1.75.0 |
v1.0.0 | 16 | 1.72.1 |
Other versions of LLVM and/or Rust may also work, but are not tested.
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. There are different steps for Windows, macOS and Linux systems.
Windows
1. Install LLVM & Rust compiler
Install git by running the git installer for windows
Enable git long path support:
git config --system core.longpaths true
Visit the Visual Studio Downloads page:
- Download "Build Tools for Visual Studio 2022"
- Once the download is complete, open the downloaded file to run the installer.
- In the installer, you will see various workloads you can install. Look for "Desktop development with C++".
- Tick the checkbox next to "Desktop development with C++". This will automatically select all the necessary components for C++ development.
- After selecting the necessary workload, click the "Install" button at the bottom right of the installer window.
- Once the installation is complete, you can close the installer.
- To verify the installation, you can a new Command Prompt or PowerShell window and type
cl
to check if the C++ compiler (cl.exe) is available.
Download and install
rustup-init.exe
Download and install
LLVM
from here or check the LLVM GitHub repository to find other versions - be sure to tick the option that addsLLVM
to the system PATHInstall the required Rust toolchain
rustup default 1.81.0
2. Enable cargo in the current shell
- Start a new PowerShell
3. Add WebAssembly target
rustup target add wasm32-unknown-unknown
4. Install Radix Engine Simulator and command-line tools
cargo install --force radix-clis@1.3.0
5. Next Steps
Go to the After Installing Scrypto
macOS
1. Install LLVM & Rust compiler
Make sure you have the
xcode
command line tools by running:xcode-select --install
Install
cmake
andLLVM
brewIf you don't already have homebrew installed you will need to follow the instructions here
brew install cmake llvm
Add
LLVM
to the system path by updating~/.zshrc
and~/.profile
:path_update='export PATH="$(brew --prefix llvm)/bin:$PATH"' echo $path_update >> ~/.zshrc && echo $path_update >> ~/.profile
Install Rust compiler
# Replace 1.81.0 with the required version curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=1.81.0
2. Enable cargo in the current shell
source $HOME/.cargo/env
3. Add WebAssembly target
rustup target add wasm32-unknown-unknown
4. Install Radix Engine Simulator and command-line tools
cargo install --force radix-clis@1.3.0
5. Next Steps
Go to the After Installing Scrypto
Linux
1. Install LLVM & Rust compiler
Make sure a C++ compiler and
LLVM
is installed:sudo apt install clang build-essential llvm
Install Rust compiler
# Replace 1.81.0 with the required version curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=1.81.0
2. Enable cargo in the current shell
source $HOME/.cargo/env
3. Add WebAssembly target
rustup target add wasm32-unknown-unknown
4. Install Radix Engine Simulator and command-line tools
cargo install --force radix-clis@1.3.0
5. Next Steps
Go to the After Installing Scrypto
Troubleshooting
Windows
Check your clang version
clang --version
Check your LLVM/Clang version is compatible with your Rust and Resim versions by looking at the Compatibility Table
Install the appropriate LLVM version from the LLVM GitHub repository.
Reinstall required Rust toolchain
# Replace 1.81.0 with the required version rustup default 1.81.0
Add WebAssembly target
rustup target add wasm32-unknown-unknown
Install Radix Engine Simulator and command-line tools
# Replace 1.3.0 with the required version cargo install --force radix-clis@1.3.0
macOS
Try the following steps:
Define rust stable:
# Replace 1.81.0 with the required version rustup default 1.81.0
Install LLVM 17 using brew:
# Replace 18 with the required version brew install llvm@18
Confirm the Installation Path:
# Replace 18 with the required version brew --prefix llvm@18
Output:
/usr/local/opt/llvm@18
Add the vesion
LLVM
to the system path:# Replace @18 with the required version path_update='export PATH="$(brew --prefix llvm@18)/bin:$PATH"' echo $path_update >> ~/.zshrc && echo $path_update >> ~/.profile
Open a new terminal window to reload the environment
Check that the installation of LLVM was done correctly by checking the clang version
clang --version
Install XCode from the App Store
Reset the XCode config:
xcodebuild -runFirstLaunch
Add WebAssembly target
rustup target add wasm32-unknown-unknown
Install Radix Engine Simulator and command-line tools
cargo install --force radix-clis@1.3.0
macOS Command line tools
- Remove command line tools
sudo rm -rf /Library/Developer/CommandLineTools
- Reinstall command line tools
xcode-select install
After Installing Scrypto
You have now successfully installed the Scrypto toolchain and can start writing your own Scrypto code. To do that you we advise you use an IDE/code-editor
Setting up Your IDE/Code Editor
An IDE, which stands for Integrated Development Environment, is like a text editor, but with added features to help you while programming. For writing Scrypto code you will need to install an IDE with rust support (because Scrypto is built on top of Rust). We recommend Visual Studio Code where there are rust and Radix Developer Tools extensions to assist.
Visual Studio Code
To set up Visual Studio Code:
Start by installing VS Code by following the download and install instructions.
Install the rust-analyzer and Radix Developer Tools extensions. This will give you syntax highlighting and code suggestion while you write your Scrypto code and manifests:
Open VS Code
Click on the extension icon on the left panel
Search for "rust-analyzer"
Click on install
Search for "Radix Developer Tools"
Click on install
You are now ready to start writing your first Scrypto blueprint.
What Should You do Next?
If your not sure what to do after installing scrypto have a look at our Learning Step-by-Step to learn how to start making Scrypto packages and dapps.