Skip to content

Local environment setup

This guide walks through setting up a Starknet development environment, creating a project, and compiling your first smart contract.

Install toolchain with starkup

Run this one-time setup command to install essential Starknet tools:

Terminal
curl --proto '=https' --tlsv1.2 -sSf https://sh.starkup.dev | sh

This installs:

Create new project with scarb

Create a new Starknet project with Scarb:

Terminal
scarb new my_starknet_project

When prompted, select Starknet Foundry as the test runner.

Scarb version should matches Cairo version:

Terminal
cd my_starknet_project
scarb --version

Take a look at the generated Scarb.toml file. It manages:

  • Project metadata
  • Dependencies and workspace configuration
  • Build profiles, compiler settings
  • Project and tool configurations

Compile smart contract with scarb build

The template includes a starter HelloStarknet contract in src/lib.cairo. Compile it with:

Terminal
scarb build

Compilation artifacts can be found in target/dev/, where dev is the default build profile:

  • my_starknet_project_HelloStarknet.contract_class.json - The contract class

Next steps

You're now ready to modify the sample contract in lib.cairo. We will cover the rest of the tools in the next sections.

As a bonus step, we recommend you to explore the Scarb documentation

Powered By Nethermind