Prerequisites
Before you begin, ensure you have the following installed:| Tool | Version | Purpose |
|---|---|---|
| Node.js | ≥ 20.x | JavaScript runtime for Next.js |
| npm | ≥ 10.x | Package manager |
| Scarb | ≥ 2.13.1 | Cairo package manager and build tool |
| Cairo | 2.14.0 | Smart contract language compiler |
| StarkNet Wallet | Latest | Argent X or Braavos browser extension |
Installing Scarb
Scarb is the Cairo package manager. Install it using:Installation
Running the Development Server
Start the Next.js development server with Turbopack:http://localhost:3000 with:
- Hot module replacement
- Fast refresh
- Real-time error overlay
Building for Production
Project Structure
Understanding the directory structure:Working with Smart Contracts
Compiling Contracts
contracts/target/dev/:
.sierra.json- Sierra intermediate representation.casm.json- Compiled Assembly (CASM) for StarkNet
Deploying Contracts
Upgrading Contracts
Sable contracts are upgradeable. To upgrade:Running the DCA Keeper Bot
The keeper bot executes due DCA orders automatically:Development Workflow
Test Locally
- Frontend: Changes hot-reload automatically
- Contracts: Rebuild with
scarb buildand redeploy
Connecting to StarkNet
The application uses the default Lava free RPC endpoint:- Alchemy StarkNet API
- Infura StarkNet
- Running your own StarkNet node
Common Commands
| Command | Description |
|---|---|
npm run dev | Start development server (Turbopack) |
npm run build | Build for production |
npm start | Start production server |
npm run lint | Run ESLint |
scarb build | Compile Cairo contracts |
scarb test | Run Cairo tests |
Troubleshooting
Having issues? Check the Troubleshooting guide for common problems and solutions.Next Steps
Architecture
Learn about Sable’s technical architecture
Smart Contracts
Explore the Cairo smart contracts
API Reference
Review API endpoints and usage
Testing
View on-chain testing evidence