Setting up your environment
Overview
In order to use Starknet, you need to install several tools. This section will walk you through installing the three most recommended tools to begin developing on Starknet:
-
Starkli, a command-line interface that allows you to interact with Starknet.
-
Scarb, a build toolchain and package manager for Cairo and Starknet ecosystems.
-
Starknet Foundry, the go-to framework for building and testing Starknet Smart Contracts
To review all Starknet developer tools, check out the tools and resources section.
Setting up Starkli
MacOS and Linux installation
It is highly recommended to install Starkli on MacOS and Linux using the starkliup
portable script. starkliup
manages shell configuration for you, and using any other installation method requires to manually set up shell completions.
-
Download
starkliup
:curl https://get.starkli.sh | sh
-
Restart the terminal and install Starkli:
starkliup
-
Restart the terminal and verify that Starkli is installed correctly:
starkli --version
Windows installation
Starknet Foundry’s installation on Windows requires manually setting up shell completions.
-
Install Starkli:
cargo install --locked --git https://github.com/xJonathanLEI/starkli
-
Restart the terminal and verify that Starkli is installed correctly:
starkli --version
-
Set up Starkli’s shell completions by following the instructions in the Starkli documentation.
Setting up Scarb
MacOS and Linux installation
It is highly recommended to install Scarb on MacOS and Linux via the asdf
version manager. Installing Scarb with asdf
seamlessly integrates with the Cairo Cairo VSCode extension, and allows to easily switch between different versions of Scarb, both globally and per project (see full details in the asdf
documentation or by running asdf --help
).
-
Verify that
asdf
is installed:asdf --version
or install it by following the instructions in the
asdf
documentation. -
Install the
asdf
Scarb plugin:asdf plugin add scarb
-
Install the latest version of Scarb:
asdf install scarb latest
-
Set a global version for Scarb (need for using
scarb init
):asdf global scarb latest
-
Restart the terminal and verify that Scarb is installed correctly:
scarb --version
Windows installation
Scarb’s installation on Windows requires manual setup.
-
Follow the instructions in the Scarb documentation.
-
Restart the terminal and verify that Scarb is installed correctly:
scarb --version
Setting up Starknet Foundry
MacOS and Linux installation
It is highly recommended to install Starknet Foundry on MacOS and Linux using the asdf
version manager. Installing Starknet Foundry with asdf
allows to easily switch between different versions of Starknet Foundry, both globally and per project (see full details in the asdf
documentation or by running asdf --help
).
-
Verify that
asdf
is installed, or install it by following the instructions on theasdf
documentation. -
Install the
asdf
Starknet Foundry plugin:asdf plugin add starknet-foundry
-
Install the latest version of Starknet Foundry:
asdf install starknet-foundry latest
-
Set a global version for Starknet Foundry using
asdf
(need for usingscarb init
):asdf global starknet-foundry latest
-
Restart the terminal and verify that Starknet Foundry is installed correctly:
snforge --version sncast --version
Windows installation
Starknet Foundry’s installation on Windows requires manual setup.
-
Follow the instructions in the Starknet Foundry documentation.
-
Restart the terminal and verify that Starknet Foundry is installed correctly:
snforge --version sncast --version