Announcing Programmatic API Access to Chainhook and Devnet

We’ve launched programmatic API access in the Hiro Platform, so now you can manage chainhooks and devnet programmatically from your code, unlocking powerful automation opportunities in your application code, development and CI scripts, and more.

Type
Product update
Topic(s)
NFTs
Hiro
Published
August 21, 2024
Author(s)
Team
Contents

We envision the Hiro Platform as a tool that supports your development lifecycle end-to-end, and this latest release brings us one step closer to that goal. With this new release, you now have access to programmatic APIs in the Hiro Platform for chainhooks and devnet.

This means two things:

  • You can programmatically create, update, query, and delete chainhooks
  • You can interact with a hosted devnet by calling the Platform API

Programatically Manage Your Platform Chainhooks

With this release, you can now programmatically create and manage chainhooks in your project. This offers new opportunities for continuous integration and continuous deployment for your project in the Hiro Platform.

Previously, in order to create and manage chainhooks for your platform-hosted project, you had to create those chainhooks via the platform UI. While that UI is intuitive and helpful, it is a manual process.

That may not be feasible if you are managing hundreds of chainhooks, and it also introduces human error to the deployment process. With these new endpoints, you can now bring chainhooks into a CI/CD pipeline.

For example, every time you deploy a new contract, you can now programmatically delete all of your chainhooks and create new ones to listen to your new contract, or if you need to update all of your chainhooks to point to a new database, you can programmatically change all of your chainhooks at once. No more one by one editing.

Interact With Your Project Locally in a Hosted Devnet

Alongside this programmatic access for Chainhook, you can now spin up a devnet instance for your project by calling a platform API endpoint. That means you don’t have to install Clarinet and run devnet locally or work from your browser in the Hiro Platform in order to take advantage of one of the platform’s strongest features.

Instead, you can keep your entire workflow local while taking full advantage of devnet, a hosted, private development network where you can test and iterate on your code before deploying on a public blockchain network like testnet or mainnet (learn more about the different networks here). And you can do this without running devnet itself on your local device, saving your machine’s compute for other tasks.

With programmatic API access to a cloud-hosted devnet, you can start and stop devnet for your project to rapidly iterate on your code in a full blockchain environment, complete with miners, block streams, blockchain nodes, and a Stacks Blockchain API.

Via these new endpoints, you can also interact with the Stacks Blockchain API and a Bitcoin node in order to trigger transactions, call smart contract functions, verify on-chain information in your devnet instance, and more.

This feature gives you a lot of power to improve your workflow. From dynamically starting a hosted devnet in the Platform from your CI for end-to-end testing or using an in-app script to automate local development flows, this feature unlocks new automation to supercharge your development.

How to Get Started

In order to use the Platform API, you first need to create an API key in the Hiro Platform. Once you have your key, you can access these new features from your local environment. View the new endpoints in Hiro documentation.

We hope you enjoy this new feature and stay tuned for more new features in the Hiro Platform coming soon. If you need to get in touch, please reach out to us on the #hiro-platform channel in the Hiro Developer Tools section on Discord.

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.
Copy link
Mailbox
Hiro news & product updates straight to your inbox
Only relevant communications. We promise we won’t spam.

Related stories