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 testnet → http://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. Validate — stacksdapp check && stacksdapp generate && stacksdapp test
  3. Deploy — stacksdapp 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. Run — stacksdapp 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 and Clarinet 3.23+.
  • Terminal 1 is only the chain. It does not start Next.js or deploy.
  • The debug UI says Choose Wallet and lists the funded accounts in settings/Devnet.toml.
  • A name already on that chain is versioned (counter → counter-v2), including after you restart the toolchain.
  • Those mnemonics are public. Devnet only.
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. Prefer testnet for deploy checks.

Clean slate

Removes generated bindings and local cache files. Does not delete .clar sources. When a devnet is running, clean restores that chain to the snapshot and leaves the process up. It waits until Stacks mines a new block. If the tip does not move, it restarts only the signer. Deploy after that finishes. When no devnet is running, clean deletes the cache so the next stacksdapp dev starts fresh. After clean: stacksdapp generate to restore bindings.

Redeploy / naming collisions

By default, redeploying auto-versions (counter → counter-v2) on devnet, testnet, and mainnet. Chain state on devnet survives a toolchain restart. To fail instead:

Frontend-only against remote network

No local chain required:

Subdirectory commands