Learn how to stream data and post it to an external endpoint.
Ordhook is a tool that helps you find Ordinals activity on the Bitcoin chain and build your own customized database with that data. This guide will show you how to use Ordhook to stream Ordinals activity.
This section walks you through streaming Ordinals activity. To post that activity, you'll need to configure bitcoind. Refer to setting up a bitcoin node to understand the steps to configure Bitcoind.
NOTE
Ordhook is applicable to the Bitcoin chain only.
Once the Bitcoin node is configured, you can use the following command in your terminal to create a configuration for Ordhook:
ordhook config new --mainnet
You will see a success message "Created file Ordhook.toml" in your terminal.
The generated Ordhook.toml file looks like this:
Observe that the bitcoind configured fields will appear in the Ordhook.toml file. Now, ensure that these fields are configured with the right values and URLs, as shown below:
After adjusting the Ordhook.toml settings to make them match the bitcoind configuration, the following command can be run to scan blocks and post events to a local server:
The above command uses Ordhook to stream and then post Ordinals activity to http://localhost:3000/api/events where you can build out your own database or custom views.