feat: Stellar Transaction History Importer module [#642]#7
Closed
gidson5 wants to merge 1 commit into
Closed
Conversation
- HistoryImportJob entity (id, walletId, status, totalImported, cursor, startedAt, completedAt) with PENDING/RUNNING/COMPLETED/FAILED states - StellarHistoryImporterService with importHistory, getImportStatus, syncNewTransactions, mapHorizonTxToInternal, deduplicateByTxHash, and resumeFromCursor methods - Cursor-based Horizon pagination (200 tx/page), progress saved after each page so jobs are resumable on failure - Deduplication by txHash via stellar_transactions table with graceful fallback when table does not exist yet - HistoryImportProcessor (BullMQ WorkerHost) with 3 retries and exponential backoff - StellarHistoryImporterController: POST /wallets/:id/import-history and GET /wallets/:id/import-status - WalletVerifiedListener auto-triggers import on wallet.verified event - BullModule.forRootAsync wired into AppModule with Redis config - Unit tests (22 cases) covering all public methods with mocked Horizon SDK and repository - Added @nestjs/bullmq, bullmq, ioredis, @nestjs/event-emitter to deps
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.
Closes #642
Implements the full Stellar Transaction History Importer module:
HistoryImportJobentity with PENDING/RUNNING/COMPLETED/FAILED status and resumable cursorStellarHistoryImporterService:importHistory,getImportStatus,syncNewTransactions,mapHorizonTxToInternal,deduplicateByTxHash,resumeFromCursortxHashviaON CONFLICT DO NOTHING; gracefully handles missing table on first runHistoryImportProcessor(BullMQWorkerHost) with 3 retries and exponential backoffStellarHistoryImporterController:POST /wallets/:id/import-history,GET /wallets/:id/import-statusWalletVerifiedListenerauto-triggers import onwallet.verifiedEventEmitter eventBullModule.forRootAsyncwired intoAppModule(readsREDIS_HOST,REDIS_PORT,REDIS_PASSWORD)wallet.history.importedevent on completion