In order to interact with Starknet and compile Cairo code, you need to install several tools.
The following tools are recommended to begin developing on Starknet:
Tool nameDescriptionDocumentationCode Repository
Starkli
A command-line interface that allows you to interact with Starknet.
https://github.com/xJonathanLEI/starkli
Scarb
A build toolchain and package manager for Cairo and Starknet ecosystems.
https://docs.swmansion.com/scarb/
https://github.com/software-mansion/scarb
The steps for installing Starkli and upgrading Starkli are identical.
Procedure
Install Starkliup, the installer for the Starkli environment:
curl https://get.starkli.sh | shStarkliup should now be installed.
Restart the terminal.
Install Starkli:
Starkli should now be installed.
Restart the terminal and run the following command to verify the installation:
starkli --versionStarkli prints the current version.
For the majority of flags available on Starkli you can set environment variables to make the commands shorter and easier to manage.
Setting environment variables for Starkli significantly simplifies command execution and management, thereby enhancing efficiency, readability, and control when using Starkli.
The two primary environment variables that are vital for effective usage of Starkli’s CLI are:
STARKNET_ACCOUNT
The location of the keystore file for the Signer.
STARKNET_KEYSTORE
The location of the Account Descriptor file.
Set these environment variables as follows:
export STARKNET_ACCOUNT=~/.starkli-wallets/deployer/account.json
export STARKNET_KEYSTORE=~/.starkli-wallets/deployer/keystore.json
Scarb is compatible with macOS, Linux, and Windows operating systems.
The steps for installing Scarb and upgrading Scarb are identical.
Procedure
Open a terminal and execute the following command:
curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | shRestart the terminal and run the following command to verify the installation:
scarb --version
Scarb should now be installed.
Scarb’s installation on Windows requires manual setup.
Procedure
Follow the steps in the Scarb documentation.
Restart the terminal and run the following command to verify the installation:
scarb --version
Scarb should now be installed.
