Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated "chainhooks service with bitcoind" How To doc #377

Merged
merged 5 commits into from
Aug 14, 2023

Conversation

mefrem
Copy link
Contributor

@mefrem mefrem commented Aug 10, 2023

Description

The "Run Chainhook as a Service using Bitcoind" guide was revamped in advance of Chainhooks general launch.

Breaking change?

N/A

Example

N/A

Checklist

  • All tests pass
  • Tests added in this PR (if applicable)


> **_NOTE:_**
>
> While bitcoind can and will start syncing a Bitcoin node, customizing this node to your use cases beyond supporting a Chainhook is out of scope for this guide. See the Bitcoin wiki for [bitcoind](https://en.bitcoin.it/wiki/Bitcoind), ["Running Bitcoin"](https://en.bitcoin.it/wiki/Running_Bitcoin), or bitcoin.org's [Running A Full Node guide](https://bitcoin.org/en/full-node).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean? https://bitcoin.org/ for bitcoin.org's?

- Now, the predicate registration server is running at `localhost:20456`. To dynamically register a new predicate, send a POST request to `localhost:20456/v1/chainhooks` with the new predicate, in JSON format, included in the request body. For complete documentation on the API endpoints available, see the [OpenAPI](https://raw.githubusercontent.com/hirosystems/chainhook/develop/docs/chainhook-openapi.json) specification.
- ![Example post request](../images/chainhook-post-request.jpeg)

The sample payload response should look like this:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intended to remove the sample payload response?

chainhook service start --predicate-path=ordinals_protocol.json --config-path=Chainhook.toml
```

The above command registers the predicates based on the predicate definition in the `ordinals_protocol.json` file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is important to specify. May I know why we are deleting this?


- Initiate the chainhook service by passing the predicate path to the command as shown below.

```console
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we start the service if this is removed?

@ryanwaits
Copy link
Contributor

so there's a couple things here that ill create some issues for, but wanted to add here to provide some context since its docs related:

ingesting historical data and triggering actions based on predicates when using Chainhook as a Service:

there are outstanding questions regarding the behavior of the Chainhook service when dealing with historical data and triggering actions based on registered or scanned predicates

examples provided in the documentation, including those mentioned here, have not been successful in scanning based on start_block and/or end_block criteria.

better examples:

currently, for demonstration purposes, a stacking pool's Bitcoin address is being used to guarantee some data generation. However, Bitcoin related examples are preferred and updates will be made once we resolve current issues around ordinals_protocol scope.

Clarifying language to bitcoind guide
- Get the downloaded path of the bitcoind from the [prerequisites section](#prerequisites) and use it in the `datadir` configuration below.
> **_NOTE:_**
>
> While bitcoind can and will start syncing a Bitcoin node, customizing this node to your use cases beyond supporting a Chainhook is out of scope for this guide. See the Bitcoin wiki for ["Running Bitcoin"](https://en.bitcoin.it/wiki/Running_Bitcoin) or bitcoin.org [Running A Full Node guide](https://bitcoin.org/en/full-node).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -2,18 +2,22 @@
title: Run Chainhook as a Service using Bitcoind
---

You can run Chainhook as a service to evaluate Bitcoin against your predicates. You can also dynamically register new predicates by enabling predicates registration API.
You can run Chainhook as a service to evaluate your `if_this / then_that` predicates against the Bitcoin blockchain, delivering results—either file appendations or HTTP POST requests to a server you designate—for your application's use case. You can also dynamically register new predicates as the service is running by enabling the predicates registration API.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chainhook can be used as a service to assess your 'if_this / then_that' predicates against the Bitcoin blockchain. This delivers outcomes by appending files or making HTTP POST requests to your chosen server for your application's needs. You can also dynamically register new predicates as the service runs by enabling the predicates registration API.

@LakshmiLavanyaKasturi
Copy link
Contributor

@mefrem @ryanwaits: LGTM, just a few re-wordings that I suggested.

@lgalabru lgalabru merged commit d28d202 into develop Aug 14, 2023
@lgalabru lgalabru deleted the mefrem-chainhook-doc-patch branch August 14, 2023 13:12
@github-actions
Copy link

🎉 This PR is included in version 1.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants