Skip to content

feat: Implement blockchain indexer with deposit event processing#443

Merged
Devsol-01 merged 1 commit intoDevsol-01:mainfrom
testersweb0-bug:feat/soroban-event-daemon-indexer-payload
Mar 27, 2026
Merged

feat: Implement blockchain indexer with deposit event processing#443
Devsol-01 merged 1 commit intoDevsol-01:mainfrom
testersweb0-bug:feat/soroban-event-daemon-indexer-payload

Conversation

@testersweb0-bug
Copy link
Copy Markdown
Contributor

Description

This PR implements a Soroban event indexer and deposit handler for the Nestera backend. It enables real-time tracking of blockchain activity by polling Soroban RPC events and processing deposit events into application state.

Closes #401
Closes #402


Key Changes

1. Soroban Event Listener Daemon

  • Implemented IndexerService with a @Cron(CronExpression.EVERY_5_SECONDS) job
  • Polls Soroban RPC for new contract events
  • Tracks lastProcessedLedger via IndexerState entity to ensure resumability after restarts
  • Batched event requests across monitored contracts for improved efficiency

Stellar Service Enhancements

  • Added retryable getEvents method
  • Integrated RpcClientWrapper for failover across RPC endpoints

2. Deposit Event Handler

  • Implemented DepositHandler for "Deposit" events
  • Decodes Soroban event payload to extract:
    • publicKey
    • amount
  • Supports:
    • SHA256 topic matching
    • Direct symbol matching

Data Consistency

  • Uses TypeORM transactions to ensure:
    • LedgerTransaction creation
    • UserSubscription balance updates
      are executed atomically

3. Error Handling

  • Introduced DeadLetterEvent queue
  • Captures failed event processing for later inspection and recovery

4. Test Coverage

  • Added unit tests for:
    • IndexerService
    • DepositHandler
  • Covered:
    • Event polling logic
    • Payload decoding
    • Failure scenarios

Verification

npm test src/modules/blockchain/indexer.service.spec.ts
npm test src/modules/blockchain/event-handlers/deposit.handler.spec.ts

…te management, and dead letter queue, along with comprehensive unit tests.
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nestera Ready Ready Preview, Comment Mar 27, 2026 0:48am

@testersweb0-bug testersweb0-bug changed the title feat: Implement blockchain indexer with deposit event processing, state management, and dead letter queue, along with comprehensive unit tests. feat: Implement blockchain indexer with deposit event processing Mar 27, 2026
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 27, 2026

@testersweb0-bug Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Devsol-01 Devsol-01 merged commit 97f56c6 into Devsol-01:main Mar 27, 2026
4 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.

[Backend] Indexer Payload Extractor for Deposit Events [Backend] Build Base Soroban Event Listener Daemon

2 participants