You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-2
Original file line number
Diff line number
Diff line change
@@ -604,7 +604,24 @@ Tbe first time this command run, a chainstate archive will be downloaded, uncomp
604
604
The subsequent scans will use the cached chainstate if already present, speeding up iterations and the overall feedback loop.
605
605
606
606
---
607
-
## Running`chainhook`in production mode
607
+
## Run`chainhook`as a service for streaming new blocks
608
608
609
-
To be documented.
609
+
`chainhook` can be ran as a background service for streaming and processing new canonical blocks appended to the Bitcoin and Stacks blockchains.
610
610
611
+
When running chainhook as a service, `if_this` / `then_that` predicates can be registered by passing the path of the `json` file in the command line:
612
+
613
+
```bash
614
+
$ chainhook service start --predicate-path=./path/to/predicate-1.json --predicate-path=./path/to/predicate-2.json --config-path=./path/to/config.toml
615
+
```
616
+
617
+
Predicates can also be added dynamically. When the `--predicate-path` option is not passed or when the `--start-http-api` option is passed, `chainhook` will instantiate a REST API allowing developers to list, add and removes preducates at runtime:
618
+
619
+
```bash
620
+
$ chainhook service start --config-path=./path/to/config.toml
621
+
```
622
+
623
+
```bash
624
+
$ chainhook service start --predicate-path=./path/to/predicate-1.json --start-http-api --config-path=./path/to/config.toml
625
+
```
626
+
627
+
A comprehensive OpenAPI spcification explaining how to interact with the Chainhook REST API can be found [here](./docs/chainhook-openapi.json).
0 commit comments