-
Notifications
You must be signed in to change notification settings - Fork 79
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
[Custom Processors] Proposal for Enhancing Aptos Indexer: Subgraph-Inspired Improvements #508
Comments
After further investigation it would seem like:
would only be applicable to |
I've hacked a work around using the
https://github.com/mshakeg/super-processor-example.git |
@larry-aptos do you think I should add the |
Hey @rtso @bowenyang007 not sure who to tag here, but I really think the ecosystem would benefit from this immensely. |
Thanks for your feedback! I'll get back to you when I have time. Also, feel free to chime in. @aptos-labs/ecosystem-infra |
Overview
The Aptos Indexer is a powerful tool. However, drawing inspiration from established systems like The Graph's subgraphs could significantly improve its usability, efficiency, and developer experience. This issue proposes several key enhancements to align the Aptos Indexer more closely with subgraph functionality and developer experience.
Proposed Improvements
1. Schema Definition and Code Generation
Current State: manually defined database schemas in code(e.g. using
SQLAlchemy
ORM inpython
ortypeorm
fortypescript
).Proposal:
schema.graphql
file for declarative schema definition, similar to subgraphs.schema.graphql
.Benefits:
2. Configuration and Event Filtering
Current State: Manual implementation of event filtering logic in processors.
Proposal:
Extend
config.yaml
to specify:Example structure:
Modify the Transaction Stream Service to stream only the module events specified in this extended
config.yaml
. It currently seems like the Aptos Indexer receives a stream of ALL txs processed by the entirety of the chain, instead of ONLY the events relevant to it, which is quite inefficient. This may require changes to the Transaction Stream Service to facilitate a stream of only relevant/desired events for a given Aptos Indexer Processor.Benefits:
3. Deployment Pipeline and Hosting
Current State: Manual deployment and hosting of processors.
Proposal:
Introduce an "Aptos Indexer Node":
Develop a deployment pipeline:
Benefits:
4. Testing Framework
Current State: Limited specialized testing tools for processors.
Proposal:
Develop a testing framework for each supported language, inspired by the Matchstick framework for testing subgraphs. See uniswap/v3-subgraph for a good illustration of the ease of implementing tests for the Aptos Indexer should be.
Features:
Benefits:
5. Language-Specific API/SDK Libraries
Current State: Developers are required to fork the aptos-indexer-processors repo and implement custom processors within the relevant language folder(e.g.
./python
,./rust
,./typescript
) in this repo.Proposal:
Introduce language-specific API/SDK libraries (
aptos-indexer-py
,aptos-indexer-rs
,aptos-indexer-ts
) for Python, Rust, and TypeScript respectively, inspired by@graphprotocol/graph-ts
used in subgraphs.These libraries should provide:
Benefits:
For reference on functionality and API design, see The Graph's
@graphprotocol/graph-ts
documentation:https://thegraph.com/docs/en/developing/graph-ts/api/
The text was updated successfully, but these errors were encountered: