Local Blockchain Development
Clarinet ships with a complete local blockchain environment so you can build, test, and debug smart contracts without deploying to a public network.
Starting your local blockchain
Launch devnet with all required services:
clarinet devnet startUseful flags:
--manifest-path <path>
Use an alternate Clarinet.toml
--no-dashboard
Stream logs instead of showing the interactive UI
--deployment-plan-path <path>
Apply a specific deployment plan
--use-on-disk-deployment-plan
Use an existing plan without recomputing
--use-computed-deployment-plan
Recompute and overwrite the plan
--package <path>
Load a packaged devnet configuration
By default the dashboard displays service health, recent transactions, block production, contract deployments, and resource usage. Use --no-dashboard in CI or when you prefer streaming logs.
Core services and features
Devnet starts these services for you:
Stacks node
20443
Processes transactions and mines blocks
Bitcoin node
18443
Provides block anchoring in regtest mode
Stacks API
3999
REST API for blockchain data
Postgres
5432
Indexes blockchain data
Stacks Explorer
8000
Browse transactions in a web UI
Bitcoin Explorer
8001
View the Bitcoin regtest chain
Devnet includes pre-funded accounts:
When devnet starts it automatically deploys your project contracts so you can interact immediately.
Configuration and customization
Devnet behavior is controlled by configuration files in your project.
Basic configuration
settings/Devnet.toml defines network settings:
Port configuration
Avoid local conflicts by customizing ports:
Mining intervals
Control block production speed:
Custom accounts
Add accounts with specific balances:
Accessing services
Devnet exposes several ways to interact with the blockchain.
Stacks Explorer
Visit the explorer to browse transactions, blocks, contract state, and account balances:
API endpoints
Query blockchain data with the Stacks API:
Common endpoints:
/v2/info– network information/v2/accounts/{address}– account details/v2/contracts/source/{address}/{name}– contract source code/extended/v1/tx/{txid}– transaction details
Direct RPC
Submit transactions directly to the Stacks node:
Useful RPC endpoints:
/v2/transactions– broadcast transactions/v2/contracts/call-read– read-only contract calls/v2/fees/transfer– fee estimates for STX transfers
Advanced configuration
Performance optimization
For faster development cycles:
Epoch configuration
Test different Stacks versions:
Custom node/signer images
Clarinet runs Devnet with specific tags for each Docker image. For example, Clarinet v3.10.0 uses the following images:
stacks node:
blockstack/stacks-blockchain:3.3.0.0.1-alpinestacks signer:
blockstack/stacks-signer:3.3.0.0.1.0-alpine
We recommend Devnet users let Clarinet handle it and use the default version. This ensures that your Clarinet version can handle and properly configure the images it uses.
In some cases, you may need to use other images. Clarinet lets you do this by configuring it in settings/Devnet.toml. For example, if you don't want to run the alpine images:
Package deployment
Create reusable devnet configurations:
Use a packaged configuration:
Common issues
Additional Resources
[Hiro Blog] 5 Ways to Interact With Devnet in the Hiro Platform
Last updated
Was this helpful?
