Test and validate your code using devnet's private blockchain environment.
Devnet is a personal blockchain environment that lets you test and validate your contract code before deploying on a public network like testnet or mainnet. In this guide, you'll learn how to interact with devnet in the Hiro Platform to expedite your development.
Devnet is a private blockchain environment that lets you test and validate smart contracts quickly. Think of it as your personal sandbox: no one else can see your devnet instance, you don't have to worry about breaking it, and you can stop and restart it as many times as you need.
While developers can run devnet locally using Clarinet, the Hiro Platform provides a hosted version that eliminates the need to manage blockchain nodes and miners on your machine. The Platform-hosted devnet still produces blocks and processes transactions, but offloads the computational overhead to our infrastructure while providing a more intuitive interface for development.
Devnet provides a risk-free testing ground with the convenience of rapid prototyping, cost savings, and privacy.
First, log into the Hiro Platform. After setting up your project, navigate to the project page where you can select the "Devnet" tab to manage your devnet instance.
In your project page, you'll click on the "Devnet" tab to start and manage your devnet instance. Initially, it should read "Inactive." Click on the "Start Devnet" button to start your private devnet instance.
Programmatic API
You can also start and stop devnet programmatically via the Platform API.
If you want to configure your devnet (like you can locally using clarinet devnet start in the terminal), open your project's devnet.toml file in the platform VS Code editor before you start devnet. From there, you can configure the settings to match your development needs.
Once you start devnet, it will take a few moments to spin up. The status indicator on the project dashboard will keep you updated on the progress.
When devnet is ready, the status will change to 'Active'.
If needed, you can restart devnet to refresh the timer. Keep in mind that only one devnet instance can run at a time per user account. If you need to work on a different project, simply start devnet within that project to seamlessly transition your session. There is also a monthly limit of 100 devnet sessions per account, so plan your development schedule accordingly.