Installation
Starknet Foundry is easy to install on Linux, Mac and Windows systems. In this section, we will walk through the process of installing Starknet Foundry.
Requirements
To use Starknet Foundry, you need:
- Scarb
- Universal-Sierra-Compiler
- Rust >= 1.80.1
all installed and added to your PATH
environment variable.
📝 Note
Universal-Sierra-Compiler
will be automatically installed if you usesnfoundryup
orasdf
. You can also createUNIVERSAL_SIERRA_COMPILER
env var to make it visible forsnforge
.
Install via snfoundryup
Snfoundryup is the Starknet Foundry toolchain installer.
You can install it by running:
curl -L https://raw.githubusercontent.com/foundry-rs/starknet-foundry/master/scripts/install.sh | sh
Follow the instructions and then run:
snfoundryup
See snfoundryup --help
for more options.
To verify that the Starknet Foundry is installed correctly, run snforge --version
and sncast --version
.
Installation via asdf
First, add the Starknet Foundry plugin to asdf:
asdf plugin add starknet-foundry
Install the latest version:
asdf install starknet-foundry latest
See asdf guide for more details.
Installation on Windows
As for now, Starknet Foundry on Windows needs manual installation, but necessary steps are kept to minimum:
- Download the release archive matching your CPU architecture.
- Extract it to a location where you would like to have Starknet Foundry installed. A folder named snfoundry in
your
%LOCALAPPDATA%\Programs
directory will suffice:
%LOCALAPPDATA%\Programs\snfoundry
- Add path to the snfoundry\bin directory to your PATH environment variable.
- Verify installation by running the following command in new terminal session:
snforge --version
sncast --version
Universal-Sierra-Compiler update
If you would like to bump the USC manually (e.g. when the new Sierra version is released) you can do it by running:
curl -L https://raw.githubusercontent.com/software-mansion/universal-sierra-compiler/master/scripts/install.sh | sh
How to build Starknet Foundry from source code
If you are unable to install Starknet Foundry using the instructions above, you can try building it from the source code as follows:
- Set up a development environment.
- Run
cd starknet-foundry && cargo build --release
. This will create atarget
directory. - Move the
target
directory to the desired location (e.g.~/.starknet-foundry
). - Add
DESIRED_LOCATION/target/release/
to yourPATH
.