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

Protokit indexer #196

Merged
merged 38 commits into from
Oct 20, 2024
Merged

Protokit indexer #196

merged 38 commits into from
Oct 20, 2024

Conversation

maht0rz
Copy link
Member

@maht0rz maht0rz commented Sep 9, 2024

This PR introduces the app-chain indexer, acting as an archive node for the sequencer. I did not implement pruning of historical blocks on the sequencer, we need to do that separately. Rationale here is that we want to keep the sequencer DB lean and small, so it can operate fast.

On the other hand the indexer can afford to store a lot of historical data - as in all historical blocks and transactions.

The indexer can be found in packages/indexer, and contains the following components:

  • GeneratedResolverFactoryGraphqlModule
    • Auto-generated GQL resolvers based on the Indexer's prisma schema, using typegraphql-prisma
  • IndexBlockTask.ts
    • Task for processing the inbound blocks from the sequencer and storing them in the indexer's storage services
  • IndexerNotifier.ts
    • Sequencer module for listening to block production events, and pushing indexing tasks to the task queue for the indexer to pick up

Additional changes done to the packages/api:

  • ResolverFactoryGraphqlModule
    • Introduced a new graphql module type, responsible for returning an array of predefined resolvers(). This is helpful for returning an array of automatically generated resolvers

@maht0rz maht0rz marked this pull request as ready for review September 11, 2024 12:55
Copy link
Collaborator

@ejMina226 ejMina226 left a comment

Choose a reason for hiding this comment

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

LGTM.

@maht0rz maht0rz merged commit cb1e23e into develop Oct 20, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants