Skip to content

Commit

Permalink
Merge branch 'develop' into elenananana-patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
LakshmiLavanyaKasturi authored Aug 8, 2023
2 parents 43589f7 + df16203 commit 2ee44ce
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 13 deletions.
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@

## Introduction

Blockchains are pieces of infrastructure that unblock new use cases and introduce a new generation of decentralized applications by relying on a public ledger.
`chainhook` is a fork-aware transaction indexing engine aiming at helping developers focus on the information they need, by helping with the on-chain data extraction. By focusing on the data they care about, developers are working with much lighter datasets. Benefits are plurals:
- Improved Developer Experience: instead of working with a generic blockchain indexer, taking hours to process every single transaction of every single block, developers can create their own indexes, build, iterate, and refine them in minutes.
- Cost Optimization: by avoiding full chain indexation, developers avoid massive storage management and unnecessary storage scaling issues. Also, `chainhook` helps developers create elegant event-based architectures. Developers write `if_this` / `then_that` **predicates**, being evaluated on transactions and blocks. When the evaluation of these **predicates** appears to be true, the related transactions are packaged as events and forwarded to the configured destination. By using cloud functions as destinations, developers can also cut costs on processing by only paying for processing when a block that contains some data relevant to the developer's application is being mined.
- Optimized User Experience: lighter indexes implies faster query results, which helps minimize end-user response time.
Blockchains serve as foundational infrastructure that unblocks new use cases and introduces a new generation of decentralized applications by relying on a public ledger.
`chainhook` is a reorg-aware transaction indexing engine that helps developers get reliable blockchain data, regardless of forks and reorgs. By focusing only on the data devs care about, Chainhook helps developers work with much lighter datasets and build IFTTT logic into their applications.
Chainhook can be used as a tool in your local development environment and as a service in the cloud environment.

Key Features:
- **Faster, More Efficient Indexing:** Instead of working with a generic blockchain indexer, taking hours to process every single transaction of every single block, developers can create their own indexes, build, iterate, and refine them in minutes. Chainhook can help developers avoid massive storage management and storage scaling issues by avoiding full chain indexation. Lighter indexes imply faster query results, which helps minimize end-user response time. This leads to an enhanced Developer Experience and an improved End-User Experience.
- **Re-org and Fork Aware:** Chainhook keeps a store of possible chain forks and checks each new chain event against the forks to maintain the current valid fork. All triggers, also known as **predicates**, are evaluated against the current valid fork. In the event of a reorg, Chainhook computes a list of new blocks to apply and old blocks to rollback and evaluates the registered predicates against those blocks.
- **IFTTT Logic, powering your applications:** Chainhook helps developers create elegant event-based architectures using triggers, also known as **predicates**. Developers can write “if_this / then_that” **predicates**that when triggered, are packaged as events and forwarded to the configured destination. By using cloud functions as destinations, developers can also cut costs on processing by only paying for processing when a block that contains some data relevant to the developer's application is being mined.

Benefits are plurals:
- Improved Developer + End User Experience
- Cost Optimization for data storage management and scaling.

---
## Install chainhook
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ Chainhook can be installed from the source by following the steps below:

If you want to start using Chainhook for extracting data from Bitcoin or Stacks, you can design your predicates using the following guides:

- [How to use chainhook with bitcoin](./how-to-guides/how-to-use-chainhook-with-bitcoin.md)
- [How to use chainhook with stacks](./how-to-guides/how-to-use-chainhook-with-stacks.md)
- [How to use chainhooks with bitcoin](./how-to-guides/how-to-use-chainhooks-with-bitcoin.md)
- [How to use chainhooks with stacks](./how-to-guides/how-to-use-chainhooks-with-stacks.md)
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ In the `Chainhook.toml` file,

## Scan blockchain based on predicates

Now that your bitcoind and Chainhook configurations are done, you can scan your blocks by defining your [predicates](../overview.md#if-this-predicate-design). This section helps you with an example JSON file to scan a range of blocks in the blockchain and render the results. To understand the supported predicates for Bitcoin, refer to [how to use chainhook with bitcoin](how-to-use-chainhook-with-bitcoin.md).
Now that your bitcoind and Chainhook configurations are done, you can scan your blocks by defining your [predicates](../overview.md#if-this-predicate-design). This section helps you with an example JSON file to scan a range of blocks in the blockchain and render the results. To understand the supported predicates for Bitcoin, refer to [how to use chainhooks with bitcoin](how-to-use-chainhooks-with-bitcoin.md).

The following are the two examples to walk you through `file_append` and `http_post` `then-that` predicate designs.

Expand Down Expand Up @@ -192,7 +192,7 @@ Run the following command to generate a sample JSON file with predicates in your
chainhook predicates new ordinals_protocol.json --bitcoin
```

A JSON file `ordinals_protocol.json` is generated. You can now edit the JSON based on the available predicates for Bitcoin. To understand the available predicates, refer to [how to use chainhook with bitcoin](how-to-use-chainhook-with-bitcoin.md).
A JSON file `ordinals_protocol.json` is generated. You can now edit the JSON based on the available predicates for Bitcoin. To understand the available predicates, refer to [how to use chainhooks with bitcoin](how-to-use-chainhooks-with-bitcoin.md).

```json
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Ensure the following configurations are matched to allow chainhook to communicat
## Scan blockchain based on predicates

Now that the stacks and chainhook configurations are done, you can scan your blocks by defining your [predicates](../overview.md#if-this-predicate-design). This section helps you with sample JSON files to scan the blocks in the blockchain and render the results. To understand the supported predicates for Stacks, refer to [how to use chainhook with stacks](how-to-use-chainhook-with-stacks.md).
Now that the stacks and chainhook configurations are done, you can scan your blocks by defining your [predicates](../overview.md#if-this-predicate-design). This section helps you with sample JSON files to scan the blocks in the blockchain and render the results. To understand the supported predicates for Stacks, refer to [how to use chainhook with stacks](how-to-use-chainhooks-with-stacks.md).

The following are the two examples to walk you through `file_append` and `http_post` `then-that` predicate designs.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Use Chainhook with Bitcoin
title: Use Chainhooks with Bitcoin
---

The following guide helps you define predicates to use Chainhook with Bitcoin. The predicates are specified based on `if-this`, `then-that` constructs.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Use Chainhook with Stacks
title: Use Chainhooks with Stacks
---

This guide helps you define predicates to use Chainhook with Stacks. The predicates are specified based on `if-this`, and `then-that` constructs.
Expand Down
2 changes: 1 addition & 1 deletion docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ The `then-that` predicate design can use the following attributes to output the
}
```

For more information on predicate definitions, refer to [how to use chainhook with bitcoin](./how-to-guides/how-to-use-chainhook-with-bitcoin.md) and [how to use chainhook with Stacks](./how-to-guides/how-to-use-chainhook-with-stacks.md).
For more information on predicate definitions, refer to [how to use chainhooks with bitcoin](./how-to-guides/how-to-use-chainhooks-with-bitcoin.md) and [how to use chainhooks with Stacks](./how-to-guides/how-to-use-chainhooks-with-stacks.md).

0 comments on commit 2ee44ce

Please sign in to comment.