From cc85bacd4979e3ceb5c08654509e01291f76d084 Mon Sep 17 00:00:00 2001 From: Lavanya Kasturi Date: Tue, 8 Aug 2023 17:15:25 -0500 Subject: [PATCH] Fixed note and tip formats --- ...un-chainhook-as-a-service-using-bitcoind.md | 18 ++++++++++++------ ...-run-chainhook-as-a-service-using-stacks.md | 17 +++++++++++------ .../how-to-use-chainhooks-with-bitcoin.md | 3 ++- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/docs/how-to-guides/how-to-run-chainhook-as-a-service-using-bitcoind.md b/docs/how-to-guides/how-to-run-chainhook-as-a-service-using-bitcoind.md index ac69ea332..b4c9a9f5b 100644 --- a/docs/how-to-guides/how-to-run-chainhook-as-a-service-using-bitcoind.md +++ b/docs/how-to-guides/how-to-run-chainhook-as-a-service-using-bitcoind.md @@ -17,7 +17,8 @@ Bitcoind installation will download binaries in a zip format, `bitcoin-22.0-osx6 - Set a username of your choice for bitcoind and use it in the `rpcuser` configuration below. - Set a password of your choice for bitcoind and use it in the `rpcpassword` configuration below. ->[!NOTE] +> **_NOTE:_** +> > Make a note of the `rpcuser`, `rpcpassword` and `rpcport` values to use them later in the chainhook configuration. ```conf @@ -48,7 +49,8 @@ zmqpubhashblock=tcp://0.0.0.0:18543 Now that you have `bitcoin.conf` file ready with the bitcoind configurations, you can run the bitcoind node. In the command below, use the path to your `bitcoin.conf` file from your machine and run the command in the terminal. -> [!NOTE] +> **_NOTE:_** +> > The below command is a startup process that might take a few hours to run. ```console @@ -168,7 +170,8 @@ A JSON file `ordinals.json` is generated. } ``` -> [!NOTE] +> **_NOTE:_** +> > You can get blockchain height and current block by referring to https://explorer.hiro.so/blocks?chain=mainnet Now, use the following command to scan the blocks based on the predicates defined in the `ordinals.json` file. @@ -179,7 +182,8 @@ chainhook predicates scan ordinals.json --config-path=./Chainhook.toml The output of the above command will be a text file `inscription_feed.txt` generated based on the predicate definition. -> [!TIP] +> **_TIP:_** +> > To optimize your experience with scanning, the following are a few knobs you can play with: > - Use of adequate values for `start_block` and `end_block` in predicates will drastically improve the performance. > - Reducing the number of network hops between the Chainhook and the bitcoind processes can also help, so your network setup can play a major role in performance. @@ -219,7 +223,8 @@ A JSON file `ordinals_protocol.json` is generated. You can now edit the JSON bas } ``` -> [!Note] +> **_NOTE:_** +> > The `start_block` is the required field to use the `http_post` `then-that` predicate. Now, use the following command to scan the blocks based on the predicates defined in the `ordinals_protocol.json` file. @@ -313,7 +318,8 @@ Understand the output of the above JSON file with the following details. - The `rollback` payload includes the block header and the transactions that triggered the predicate for a past block that is no longer part of the canonical chain and must be reverted. -> [!TIP] +> **_TIP:_** +> > You can also run chainhook service by passing multiple predicates. > Example: ```chainhook service start --predicate-path=predicate_1.json --predicate-path=predicate_2.json --config-path=Chainhook.toml``` diff --git a/docs/how-to-guides/how-to-run-chainhook-as-a-service-using-stacks.md b/docs/how-to-guides/how-to-run-chainhook-as-a-service-using-stacks.md index fc3cf177d..9e29ba4d4 100644 --- a/docs/how-to-guides/how-to-run-chainhook-as-a-service-using-stacks.md +++ b/docs/how-to-guides/how-to-run-chainhook-as-a-service-using-stacks.md @@ -39,7 +39,8 @@ events_keys = ["*"] ``` -> [!NOTE] +> **_NOTE:_** +> > Ensure that the `username`, `password`, and `rpc_port` values in the `Stacks.toml` file match the values in the `bitcoin.conf` file. Also, note the `rpc_bind` port to use in the `Chainhook.toml` configuration in the next section of this article. ### Configure Chainhook @@ -98,7 +99,8 @@ Ensure the following configurations are matched to allow chainhook to communicat | | rpc_bind | stacks_node_rpc_url | | | endpoint | stacks_events_ingestion_port | -> [!NOTE] +> **_NOTE:_** +> > The `bitcoind_zmq_url` is optional when running chainhook as a service using stacks because stacks will pull the blocks from Stacks and the Bitcoin chain. ## Scan blockchain based on predicates @@ -161,7 +163,8 @@ A JSON file `print_event_1.json` is generated. } ``` -> [!NOTE] +> **_NOTE:_** +> > You can get blockchain height and current block in the [Explorer](https://explorer.hiro.so/blocks?chain=mainnet). The sample `arkadiko.txt` should look like this: @@ -178,7 +181,7 @@ chainhook predicates scan print_event_1.json --testnet The output of the above command will be a text file `arkadiko.txt` generated based on the predicate definition. -> [!TIP] +> **_TIP:_** > To optimize your experience with scanning, the following are a few knobs you can play with: > Use of adequate values for `start_block` and `end_block` in predicates will drastically improve the performance. > Networking: reducing the number of network hops between the chainhook and the bitcoind processes can also help. @@ -225,7 +228,8 @@ A JSON file `print_event_2.json` is generated. } ``` -> [!Note] +> **_NOTE:_** +> > The `start_block` is the required field to use the `http_post` `then-that` predicate. Now, use the following command to scan the blocks based on the predicates defined in the `print_event_2.json` file. @@ -259,6 +263,7 @@ In this section, you'll learn how to initiate the chainhook service using the fo - 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) -> [!TIP] +> **_TIP:_** +> > You can also run chainhook service by passing multiple predicates. > Example: ```chainhook service start --predicate-path=predicate_1.json --predicate-path=predicate_2.json --config-path=Chainhook.toml``` diff --git a/docs/how-to-guides/how-to-use-chainhooks-with-bitcoin.md b/docs/how-to-guides/how-to-use-chainhooks-with-bitcoin.md index 88f17dd7b..338cc5c0f 100644 --- a/docs/how-to-guides/how-to-use-chainhooks-with-bitcoin.md +++ b/docs/how-to-guides/how-to-use-chainhooks-with-bitcoin.md @@ -275,7 +275,8 @@ The following additional configurations can be used to improve the performance o Retrieve and HTTP Post to `http://localhost:3000/api/v1/wrapBtc` the five first transfers to the p2wpkh `bcrt1qnxk...yt6ed99jg` address of any amount, occurring after block height 10200. -> [!NOTE] +> **_NOTE:_** +> > The start_block is mandatory to post events using `http_post` `then-that` predicate. ```json