Local Development Environment
Overview
Setting up a local development environment starts with the command clarinet devnet start
. This feature enables you to easily integrate your existing smart contracts with the blockchain in a local testing environment, allowing you to validate and verify your smart contract on an actual blockchain. While unit testing (the process of testing your code to ensure it works correctly) is a valuable way to test your code before implementation, certain features cannot be verified during unit testing, such as how your smart contract interacts with proof of transfer or the Bitcoin chain.
Topics covered in this guide:
Key concepts
Before using the local development environment with clarinet devnet start
, you should understand the following concepts described below.
Mainnet
Mainnet refers to a working, fully operational blockchain that has been deployed and is in production. This environment verifies and records transactions made to the blockchain.
Testnet
Testnet refers to a test environment that you can use to validate and verify smart contracts and integrations between your contracts and the blockchain. Any work you perform in testnet is written to the blockchain and is not deployed into production.
Devnet
Devnet refers to an environment where you perform development tasks, including creating smart contracts and other assets. Use this space during the development phase of your work whenever possible.
Working with clarinet devnet start
Setting up and configuring your own devnet can be time-consuming. This command speeds up the deployment process with an embedded orchestrator tool that enables you to run your own devnet network even when offline.
References
For a more detailed discussion on how to use clarinet devnet start
, please see the following resources:
-
Meet 4 New Features in Clarinet blog post.
-
Introduction to Smart Contract Integration With Clarinet YouTube video.
-
Setting Up an Integration Test Environment With the Stacks DevNet YouTube Video.