Installation
Requirementsโ
Before you begin, you need to install the following tools:
- Node (>= v22)
- Yarn (v1 or v2+)
- Git
Install developer toolsโ
You can install the developer tools natively or use Dev Containers.
Option 1: Natively install developer toolsโ
1.1 Starkupโ
Tool for installing all the Starknet essentials for development. Starkup will install the latest stable versions of:
- Scarb - Cairo package manager and build toolchain
- Starknet Foundry - Development toolchain for testing on Starknet
- asdf - Version manager to easily switch between tool versions
- Cairo 1.0 extension for VSCode - Syntax highlighting and language support
- Starknet Devnet - Starknet Devnet
To install starkup, run the following command:
curl --proto '=https' --tlsv1.2 -sSf https://sh.starkup.sh | sh
1.2 Create your projectโ
Open a terminal and run the following command:
npx create-stark@latest
cd my-dapp-example
yarn install
Now you have a new project with the basic structure.
Now you are ready!!!. You can now start developing your dApp!
1.3 Installing ASDF and ASDF fast installsโ
There might be some cases where you need to install the dependencies that are required by scaffold but not necessarily the latest version. In this case, you can use ASDF to install the dependencies by the following commans.
asdf install
1.4 Troubleshootingโ
- If you run into version errors after using
starkuporasdf, you can try to install the dependencies manually. Check the details below.
Details
Scarb versionโ
To ensure the proper functioning of scaffold-stark, your Scarb version must be 2.15.1. To accomplish this, first check Scarb version:
scarb --version
If your Scarb version is not 2.15.1, you need to install it. If you already have installed Scarb via starkup, you can setup this specific version with the following command:
asdf install scarb 2.15.1 && asdf set scarb 2.15.1
Otherwise, you can install Scarb 2.15.1 following the instructions.
Starknet Foundry versionโ
To ensure the proper functioning of the tests on scaffold-stark, your Starknet Foundry version must be 0.55.0. To accomplish this, first check your Starknet Foundry version:
snforge --version
If your Starknet Foundry version is not 0.55.0, you need to install it. If you already have installed Starknet Foundry via starkup, you can setup this specific version with the following command:
asdf install starknet-foundry 0.55.0 && asdf set starknet-foundry 0.55.0
Otherwise, you can install Starknet Foundry 0.55.0 following the instructions.
Starknet-devnet versionโ
To ensure the proper functioning of scaffold-stark, your starknet-devnet version must be 0.7.2. To accomplish this, first check your starknet-devnet version:
starknet-devnet --version
If your starknet-devnet version is not 0.7.2, you need to install it.
- Install starknet-devnet
0.7.2viaasdf(instructions).
Option 2. Dev Containersโ
2.1 Install Docker Desktopโ
As an alternative to installing the tools locally (Scarb, Starknet Foundry, Starknet Devnet), you can use Docker, this is the recommended option for Windows users. Here's what you need to do:
- Install Docker Desktop
- Install Dev Containers
- Create a new project folder.
npx create-stark@latestcd my-dapp-example
- Check your project folder contains a
devcontainer.jsonfile. This file is used to set up the environment:
- The configuration uses the
starknetfoundation/starknet-dev:2.15.1image. - This includes all required tools pre-installed, such as Scarb, Starknet Foundry, Starknet Devnet and other dependencies.
2.2 Getting Started with Docker Setupโ
To start using the Docker-based setup:
- Open the project in Visual Studio Code.
- Select "Reopen in Container".
- If you need to rebuild the container, open the Command Palette (View -> Command Palette) and choose:
- Dev Containers: Rebuild and Reopen in Container
Once inside the container, you can start working with all the tools and dependencies pre-configured.
Now you are ready!!!
Setup RPC specific versionโ
Details
To ensure the proper functioning of the scaffold-stark with Testnet or Mainnet, your RPC version must be 0.10.x. This repository contains .env.example files, where we provided the default RPC URL for the Starknet Testnet: RPC_URL_SEPOLIA=https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_8. Let's verify this RPC version is 0.10.x by calling a POST request in an API platform like Postman or Insomnia. Your API endpoint should be https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_8 and the body should be:
{
"jsonrpc": "2.0",
"method": "starknet_specVersion",
"id": 1
}
You have to paste the endpoint and body in the API platform and click on the Send button. If the response is 0.10.x, then you are good to go. Otherwise, you have to get the correct RPC URL endpoint.
Compatible versionsโ
| Dependency | Version |
|---|---|
| scarb | v2.15.1 |
| cairo | v2.15.0 |
| rpc | v0.10.x |
| starknet-devnet | v0.7.2 |
| snforge | v0.55.0 |
| starknet.js | v9.4.2 |
| starknet-start | v1.0.0 |
Setupโ
For a simplified setup, Scaffold-Stark offers a npx method that guides you interactively through the setup.
npx create-stark@latest
You will be presented with a series of prompts:
- Where to install files?: Enter your project name, e.g., my-dapp-example. Or input
.to install in the current directory. - Install packages?: Press
Enterforyes(default option) or typenand pressEnterfor no
Once the setup is complete, navigate to the project directory:
cd project-name