Bringing Devnet to the Cloud: the Devnet <> Platform Integration Is Here

When working with smart contracts, you need a variety of environments to test your code. Before deploying contracts on public networks like testnet or mainnet, it’s useful to be able to iterate and experiment with your contracts in a local environment first. That’s where devnet comes in, and today, we’re launching devnet support in the Hiro Platform.

Type
Product update
Topic(s)
Product
Published
November 20, 2023
Author(s)
Sr Engineering Manager
Director of Product
New feature, better experience.
Contents

What Is Devnet?

Devnet lets you interact with contracts deployed on your machine in a local blockchain environment (including Stacks and Bitcoin nodes). Devnet enables you to quickly iterate on your code before going through the process of deploying on a public network like testnet or mainnet.

Devnet lets you quickly iterate on your code and test your contracts.

Since devnet is a local environment, you can spin up devnet quickly and with custom configurations (for example, you can start a devnet at an arbitrary block height close to a network upgrade). Additionally, the blocks themselves are mined much more quickly than on a public network (and can be further customized for faster feedback loops), enabling a more rapid testing process to validate how your contract interacts with the various components of a blockchain.

Devnet facilitates:

  • Rapid prototyping: quickly iterate your code with immediate feedback.
  • Cost-efficiency: test your code without incurring any cryptocurrency expenses due to transaction fees.
  • Customizable testing environment: tailor your blockchain parameters as needed for tighter feedback loops.
  • Isolated development: work in a secure and confidential testing environment.

Blockchains are complex, and it’s important to test how your code interacts with the different entities in them (be it a blockchain node, Proof of Transfer, the Bitcoin chain, etc). So as you work, you may want to validate your code as you go, and that’s what devnet provides.

However, setting up and configuring your own devnet can be time-consuming and isn’t as intuitive as it could be. That changes today. Now you can run those integration tests from the Hiro Platform before deploying your contracts to testnet for further validation.

Using Devnet in the Hiro Platform

Starting today, the Hiro Platform enables you to spin-up your own devnet network with just a few clicks. Once you login to the Platform, you can select a project, and you will see a “Devnet inactive” button on the top-right. By hovering over the button, you can then choose to “Start Devnet”.

Once your devnet environment is up and running, the contracts in your project are automatically deployed to that devnet instance. Once the devnet runs, you will see new blocks arriving and can track the deployment progress with an intuitive UI.

Devnet in the Hiro Platform is pre-configured with test wallets. When devnet is ready, the status will change to "Devnet active", and your 30-minute devnet session begins, giving you a fully isolated and secure testing ground with the convenience of rapid prototyping, cost savings, and privacy. If you need more time, simply restart a new devnet session. You can also navigate to "View Devnet activity" to explore the new blocks, and to track contract deployments.

Learn more about how to use devnet in the Hiro Platform in our documentation.

How We Put Devnet In the Cloud

Getting devnet to work in a cloud-hosted environment wasn’t easy. Inside the Hiro Platform, we streamline the development process. We take away the process of installing docker, installing Clarinet, and creating a new project, and we replace all of that with a single button click that takes users to an environment where they can write, test, and deploy their code.

To offer that experience, we settled on an architecture in which devnet is run as a microservice in which each user gets their own devnet. We wanted to provide a devnet experience that was as good if not better than the one that developers have when they run <code-rich-text>clarinet integrate<code-rich-text> locally. Therefore, a shared devnet instance was out of the question.

A microservice approach, however, enables developers to actually manage and control their own personal devnet, and under the hood, this approach enables us to build a standalone service that leverages the clarinet integrate engine and will be easy to keep up to date with the latest new features and extend moving forward.    

The benefits of this design is that devnet in the Hiro platform behaves exactly like devnet does when you use <code-rich-text>clarinet integrate<code-rich-text> in your local environment.

Conclusion

We are regularly shipping new features and improvements to the Hiro Platform. From deployment plans to chainhooks to SSH and Git, and now devnet, we want the Hiro Platform to ultimately be a one-stop shop for your smart contract, including dapp development needs, and we are getting closer to that vision every day.

If you don’t already have a platform account, give it a try below and let us know what you think:

Product updates & dev resources straight to your inbox
Your Email is in an invalid format
Checkbox is required.
Thanks for
subscribing.
Oops! Something went wrong while submitting the form.
Go to Platform
Copy link
Mailbox
Hiro news & product updates straight to your inbox
Only relevant communications. We promise we won’t spam.

Related stories