Contents
- New project to testnet
- Contract iteration loop
- Custom frontend with hooks
- Add SIP-010 token
- Add SIP-009 NFT
- Adopt existing Clarinet project
- Local devnet
- Mainnet deploy
- Upgrade project
- CI pipeline
- Clean slate
- Frontend-only against remote network
New project to testnet
Recommended first path (no Docker):- Fund testnet STX: Hiro testnet faucet
- Edit
contracts/settings/Testnet.tomlwith deployer mnemonic (local only; never commit) - Edit
contracts/contracts/counter.claras needed stacksdapp check && stacksdapp generate && stacksdapp teststacksdapp deploy --network testnet --yesstacksdapp dev --network testnet→ http://localhost:3000
Contract iteration loop
stacksdapp dev --network testnet, run generate manually or use stacksdapp generate --watch in a second terminal.
Custom frontend with hooks
End-to-end path when building your own UI (not just the debug panel):- Contracts — edit
contracts/contracts/*.clarorstacksdapp add … - Validate —
stacksdapp check && stacksdapp generate && stacksdapp test - Deploy —
stacksdapp deploy --network testnet --yes(populatesdeployments.json) - Custom UI — create
frontend/src/components/Feature.tsxwith"use client"; import hooks from@/generated/hooks - Page — add component to
app/page.tsxor a new App Router route - Run —
stacksdapp dev --network testnet; connect wallet for public calls
<DebugContracts /> during development to compare behavior with your custom components.
Add SIP-010 token
contracts/contracts/my-token.clar, then check → generate → test → deploy.
Trait functions, hooks, and impl-trait rules: SIP standards
Add SIP-009 NFT
Adopt existing Clarinet project
From a repo withClarinet.toml (standard or nested layout):
- Normalize layout to
contracts/Clarinet.toml+contracts/contracts/*.clar - Add frontend template (if missing)
- Install npm deps, generate bindings, git hooks, agent skill
- Write
stacksdapp.tomlif missing
Local devnet
Requires Docker Desktop.- Boots Clarinet devnet + Next.js + file watcher
--auto-deploydeploys contracts once:20443is healthy (recommended)- Devnet mnemonics in
settings/Devnet.tomlare public — devnet only
Mainnet deploy
- Audit contracts and test on testnet first
- Set
contracts/settings/Mainnet.tomlmnemonic (never commit) - For SIP tokens: uncomment mainnet
impl-traitline (see SIP standards) stacksdapp deploy --network mainnet --dry-run— review plan and feesstacksdapp deploy --network mainnet --yes --wait-confirmstacksdapp dev --network mainnet
Upgrade project
stacksdapp CLI.
Guide: Upgrade a project
CI pipeline
--json for machine-readable output. Rely on exit codes.
Do not run devnet in CI unless Docker is available and stall risk is acceptable.
Clean slate
.cache/, devnet state, and generated bindings. Does not delete .clar sources.
After clean: stacksdapp generate to restore bindings.
Redeploy / naming collisions
By default, redeploying auto-versions (counter → counter-v2). To fail instead: