Chainhook Overview
Chainhook enables you to target events on the Bitcoin and Stacks blockchain important to your use case in order to trigger actions based on those events.
Chainhook is a reorg-aware indexer that serves reliable blockchain data—you don’t have to waste time reindexing your database every time there’s a fork. Chainhook also lets you index only the data you need, which means you can build lighter databases, get faster query results, and deliver a better experience to your users.
Install Chainhook
Clone the Chainhook Repo:
Navigate to the root directory and run cargo chainhook-install
:
Create Event Streams
Create a Bitcoin chainhook
Build a chainhook that reacts to events on the Bitcoin blockchain.
Create a Stacks chainhook
Build a chainhook that reacts to events on the Stacks blockchain.
Test your chainhooks
Test and debug your chainhooks in a local environment.
Scan Blocks for Past Events
Index Bitcoin
Scan past Bitcoin blocks for the data you need.
Index Stacks
Scan past Stacks blocks for the data you need.
Related Tools
- Ordhook: Simplify your testing with the Clarinet SDK.
- Hiro Platform: Streamline your app development in our hosted dev experience.
Need help building with Chainhook? Reach out to us on the #chainhook
channel on Discord under Hiro Developer Tools section. We also host a weekly office hours on Discord every Monday at 11am ET.
Last updated on