feat(stellar): add Stellar event indexing service (lib/stellar/indexer.ts)#34
Merged
Merged
Conversation
… and idempotent MongoDB sync
Collaborator
|
Great work on implementing the Stellar event indexing service and providing a comprehensive test suite. I especially appreciate the attention to idempotency, cursor checkpointing, and the coverage around mock and live modes. Thanks for the solid contribution! 🚀 |
Collaborator
|
Resolve your CI Errors |
4dfa12d to
b004ba3
Compare
…pm install sync errors
8 tasks
Collaborator
|
@devfoma that a great work you did there |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pr closes #13
Summary
Implements the Stellar event indexing service to synchronize Stellar ledger events into MongoDB idempotently for monitoring/dashboards.
Changes
lib/stellar/indexer.ts— Core indexer factory. Supports mock and live Horizon modes, maps events to ChainMove records, handles checkpoints, and stores records in MongoDB safely.models/StellarIndexedEvent.ts— Mongoose model for storing indexed events where_idacts as the idempotency key (Stellar operation ID).models/StellarIndexerCursor.ts— Mongoose model tracking the paging token / cursor checkpoint for the stream.lib/stellar/indexer.test.ts— Complete Vitest suite containing 21 tests covering unit mappings, mock mode sync, repeated syncs, cursor resumption, live mode queries, and error handling.Acceptance Criteria Met
mock: trueor configuration-driven)StellarIndexerCursormodel)mapEventToChainMoveRecord)vi.stubGlobalfor fetch)Screenshot