Block chain event#18
Merged
Merged
Conversation
Contributor
Author
|
Hi @akargi approve work flow and review pr |
8 tasks
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.
Implemented the Blockchain Event Indexing Module at src/modules/blockchain-indexer/ and integrated it into AppModule.
closes #10
Acceptance criteria coverage
Indexing state persisted: cursor + last ledger stored in indexer_state table
Query filtering: eventType, transactionHash, sourceAccount, destinationAccount, assetCode, assetIssuer, amountFrom/To, ledgerFrom/To, startTime/endTime
Reorg handling: detects current ledger < last indexed, invalidates events from that point, and backfills large gaps
Recovery without data loss: idempotent uniqueId dedup, persisted cursor, retry loops that swallow transient failures
Real-time streaming: Redis publish for new events, SSE endpoint for live consumption
Configurable: env vars under BLOCKCHAIN_INDEXER_* control poll interval, backfill limits, retention, etc.
New config added
BLOCKCHAIN_INDEXER_ENABLED
BLOCKCHAIN_INDEXER_POLL_INTERVAL_MS
BLOCKCHAIN_INDEXER_MAX_BACKFILL_LEDGERS
BLOCKCHAIN_INDEXER_STREAM_TTL_SECS
BLOCKCHAIN_INDEXER_INCLUDE_FAILED
Verification
All new unit tests pass: 14/14 (npm test -- --testPathPattern="blockchain-indexer")
TypeScript: npx tsc --noEmit clean
ESLint: npx eslint src/modules/blockchain-indexer/**/*.ts --fix clean