generated from defi-wonderland/ts-turborepo-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
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
docs: packages and apps #28
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bfdc8be
docs: update packages docs
0xkenj1 5d5862c
docs: update packages docs
0xkenj1 1a9fd23
fix: indexer client docs
0xkenj1 878d78c
fix: pr comments
0xkenj1 08cc6b0
Merge remote-tracking branch 'origin/dev' into docs/packages-and-apps
0xkenj1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -25,7 +25,7 @@ Available scripts that can be run using `pnpm`: | |||||
You can import the package in your TypeScript or JavaScript files as follows: | ||||||
|
||||||
```typescript | ||||||
import { EventsFetcher } from "@grants-stack-indexer/data-flow"; | ||||||
import { EventsFetcher, Orchestrator, EventsRegistry, EventsFetcher, EventsProcessor } from "@grants-stack-indexer/data-flow"; | ||||||
``` | ||||||
|
||||||
### Example | ||||||
|
@@ -43,3 +43,29 @@ const result = await eventsFetcher.fetcEventsByBlockNumberAndLogIndex( | |||||
logIndex, | ||||||
); | ||||||
``` | ||||||
|
||||||
## API | ||||||
|
||||||
### [Orchestrator](./src/orchestrator.ts) | ||||||
|
||||||
The `Orchestrator` class is responsible for orchestrating the processing pipeline for the gitcoin grants-stack-indexer. | ||||||
|
||||||
### [EventsRegistry](./src/eventsRegistry.ts) | ||||||
|
||||||
The `EventsRegistry` class is responsible for registering processed events in the processing pipeline. | ||||||
|
||||||
### [EventsProcessor](./src/eventsProcessor.ts) | ||||||
|
||||||
The `EventsProcessor` class is responsible for processing events in the processing pipeline. | ||||||
|
||||||
### [EventsFetcher](./src/eventsFetcher.ts) | ||||||
|
||||||
The `EventsFetcher` class is responsible for fetching events from the blockchain. | ||||||
|
||||||
### [StrategyRegistry](./src/strategyRegistry.ts) | ||||||
|
||||||
The `StrategyRegistry` stores strategy IDs in memory to populate strategy events with them. | ||||||
|
||||||
### [DataLoader](./src/data-loader/dataLoader.ts) | ||||||
|
||||||
The `DataLoader` is responsible for applying changesets to the database.. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,6 +1,6 @@ | ||||||
# grants-stack-indexer: processors package | ||||||
# Grants stack indexer v2 `processors` package | ||||||
|
||||||
Description of your package goes here. | ||||||
The `processors` package provides a set of utilities for processing and transforming data within the grants stack indexer project. It includes processors for handling Allo, Strategy, and Registry events. | ||||||
|
||||||
## Setup | ||||||
|
||||||
|
@@ -22,14 +22,55 @@ Available scripts that can be run using `pnpm`: | |||||
| `test` | Run tests using vitest | | ||||||
| `test:cov` | Run tests with coverage report | | ||||||
|
||||||
## 📋 Prerequisites | ||||||
|
||||||
- Ensure you have `node >= 20.0.0` and `pnpm >= 9.5.0` installed. | ||||||
|
||||||
## Installation | ||||||
|
||||||
```bash | ||||||
$ pnpm install | ||||||
``` | ||||||
|
||||||
## Building | ||||||
|
||||||
To build the monorepo packages, run: | ||||||
|
||||||
```bash | ||||||
$ pnpm build | ||||||
``` | ||||||
|
||||||
## Test | ||||||
|
||||||
```bash | ||||||
# unit tests | ||||||
$ pnpm run test | ||||||
|
||||||
# test coverage | ||||||
$ pnpm run test:cov | ||||||
``` | ||||||
|
||||||
## Usage | ||||||
|
||||||
Describe how to use your package here. | ||||||
```typescript | ||||||
import { AlloProcessor } from "@grants-stack-indexer/processors"; | ||||||
|
||||||
const alloProcessor = new AlloProcessor(chainId, dependencies); | ||||||
const changeset = await this.alloProcessor.process(event); | ||||||
``` | ||||||
|
||||||
## API | ||||||
|
||||||
Describe your package's API here. | ||||||
### Processors | ||||||
|
||||||
This package provides the following repositories: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
1. **AlloProcessor**: Handles the processing of Allo V2 events from the Allo contract by delegating them to the appropriate handler | ||||||
|
||||||
2. **RegistryProcessor**: Handles the processing of Allo V2 events from the Registry contract by delegating them to the appropriate handler | ||||||
|
||||||
3. **StrategyProcessor**: Handles the processing of Allo V2 events from the Strategy contract by delegating them to the appropriate handler | ||||||
|
||||||
## References | ||||||
|
||||||
Add any relevant references here. | ||||||
- [Allo Protocol](https://github.com/allo-protocol/allo-v2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.