Skip to main content
Recommended paths for new projects, contract iteration, token dApps, CI, and adoption of existing Clarinet repos.

Contents

New project to testnet

Recommended first path (no Docker):
  1. Fund testnet STX: Hiro testnet faucet
  2. Edit contracts/settings/Testnet.toml with deployer mnemonic (local only; never commit)
  3. Edit contracts/contracts/counter.clar as needed
  4. stacksdapp check && stacksdapp generate && stacksdapp test
  5. stacksdapp deploy --network testnet --yes
  6. stacksdapp dev --network testnethttp://localhost:3000
Connect Leather or Xverse on testnet. The debug UI calls contract functions. See also: Quickstart

Contract iteration loop

With 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):
  1. Contracts — edit contracts/contracts/*.clar or stacksdapp add …
  2. Validatestacksdapp check && stacksdapp generate && stacksdapp test
  3. Deploystacksdapp deploy --network testnet --yes (populates deployments.json)
  4. Custom UI — create frontend/src/components/Feature.tsx with "use client"; import hooks from @/generated/hooks
  5. Page — add component to app/page.tsx or a new App Router route
  6. Runstacksdapp dev --network testnet; connect wallet for public calls
Full hook patterns, wallet vs devnet signing: Frontend guide Keep <DebugContracts /> during development to compare behavior with your custom components.

Add SIP-010 token

Customize contracts/contracts/my-token.clar, then check → generate → test → deploy. Trait functions, hooks, and impl-trait rules: SIP standards

Add SIP-009 NFT

Same workflow. See SIP standards for trait table and hook examples.

Adopt existing Clarinet project

From a repo with Clarinet.toml (standard or nested layout):
Init will:
  • 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.toml if missing
Then:
Full guide: Adopt an existing project

Local devnet

Requires Docker Desktop.
  • Boots Clarinet devnet + Next.js + file watcher
  • --auto-deploy deploys contracts once :20443 is healthy (recommended)
  • Devnet mnemonics in settings/Devnet.toml are public — devnet only
Deploy separately:
Guide: Local devnet

Mainnet deploy

  1. Audit contracts and test on testnet first
  2. Set contracts/settings/Mainnet.toml mnemonic (never commit)
  3. For SIP tokens: uncomment mainnet impl-trait line (see SIP standards)
  4. stacksdapp deploy --network mainnet --dry-run — review plan and fees
  5. stacksdapp deploy --network mainnet --yes --wait-confirm
  6. stacksdapp dev --network mainnet
Guide: Mainnet deployment

Upgrade project

Refreshes npm lockfiles, regenerates bindings, updates git hooks and agent skill. Safe to run after updating the stacksdapp CLI. Guide: Upgrade a project

CI pipeline

Use --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

Removes .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 (countercounter-v2). To fail instead:

Frontend-only against remote network

No local chain required:

Subdirectory commands