Skip to content

Feat Implemented Advanced Stellar Ledger Indexer with Real-time Event Streaming - #54

Merged
akargi merged 12 commits into
Chulilee:mainfrom
DevMuhdishaq:feat/Advernce
Aug 23, 2026
Merged

Feat Implemented Advanced Stellar Ledger Indexer with Real-time Event Streaming#54
akargi merged 12 commits into
Chulilee:mainfrom
DevMuhdishaq:feat/Advernce

Conversation

@DevMuhdishaq

Copy link
Copy Markdown
Contributor

Closes #49

Summary

Implemented Advanced Stellar Ledger Indexer with Real-time Event Streaming

Related Issues

Closes #49

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behaviour)
  • Documentation only
  • Refactor / chore (no functional change)

Changes

new feature module

Checklist

  • I have read the CONTRIBUTING guide.
  • npm run lint passes.
  • npx tsc --noEmit passes (no type errors).
  • npm run build succeeds.
  • npm test passes, and I added/updated tests for my change where it
    made sense.
  • Any Stellar/Soroban network access goes through the stellar module
    services (no direct Horizon/RPC calls from feature modules).
  • I did not commit secrets, private keys, or mainnet credentials.

Notes for Reviewers

DevMuhdishaq and others added 12 commits August 23, 2026 07:22
…ipeline

Add configuration options for WebSocket reconnection, in-memory event
buffer, batched persistence, and configurable retention policies that
drive the new real-time ledger indexer.

🤖 Generated with Codebuff
Co-Authored-By: DevMuhdishaq <noreply@codebuff.com>
…nt types

Add soroban_contract_invocation, soroban_contract_event,
soroban_system_event, and soroban_diagnostic_event to support
Soroban contract event indexing alongside native Stellar operations.

🤖 Generated with Codebuff
Co-Authored-By: DevMuhdishaq <noreply@codebuff.com>
…torage

Create a unified event entity that stores both Stellar native operations
and Soroban contract events in a single table with optimized indexes on
sequence number, ledger, event type, contract ID, and account fields
to support temporal queries and high-throughput writes.

🤖 Generated with Codebuff
Co-Authored-By: DevMuhdishaq <noreply@codebuff.com>
…version

Normalize raw Horizon operations and Soroban contract events into a
unified IndexedEvent shape with monotonic sequence number assignment,
enabling consistent ordering and deduplication across event sources.

🤖 Generated with Codebuff
Co-Authored-By: DevMuhdishaq <noreply@codebuff.com>
…streaming

Replace polling with a persistent SSE connection to the Stellar Horizon
API for sub-second ledger close event detection. Includes automatic
reconnection with exponential backoff and cursor-based resumption.

🤖 Generated with Codebuff
Co-Authored-By: DevMuhdishaq <noreply@codebuff.com>
…nd ordering

In-memory event buffer that absorbs bursts while maintaining sequence-number
ordering guarantees and O(1) deduplication. Includes TTL-based expiry for
stale events and FIFO batch extraction for the persistence layer.

🤖 Generated with Codebuff
Co-Authored-By: DevMuhdishaq <noreply@codebuff.com>
…ughput writes

Batched PostgreSQL persistence layer using bulk INSERT with ON CONFLICT
DO NOTHING for idempotency. Configurable flush interval and batch size
to achieve >10k events/second throughput with a retention-based purge policy.

🤖 Generated with Codebuff
Co-Authored-By: DevMuhdishaq <noreply@codebuff.com>
…istribution

Client-side pub/sub system filtering events by type, contract ID, account,
and ledger range. Maintains reverse index for efficient per-client cleanup
and emits matched events for WebSocket delivery.

🤖 Generated with Codebuff
Co-Authored-By: DevMuhdishaq <noreply@codebuff.com>
…criptions

Socket.io WebSocket gateway at /blockchain-indexer namespace allowing
frontend clients to subscribe to real-time trade executions, balance
updates, liquidations, and Soroban contract events with typed filters.

🤖 Generated with Codebuff
Co-Authored-By: DevMuhdishaq <noreply@codebuff.com>
…full pipeline

Orchestrates Horizon SSE streaming, operation fetching, normalization,
in-memory buffering, batched persistence, and WebSocket distribution
into a single real-time indexing pipeline with sub-second latency.

🤖 Generated with Codebuff
Co-Authored-By: DevMuhdishaq <noreply@codebuff.com>
Add SubscribeEventsDto and TemporalQueryDto for typed event subscription
and state-at-block queries. Update controller with /realtime/status,
/realtime/events, and /realtime/temporal endpoints.

🤖 Generated with Codebuff
Co-Authored-By: DevMuhdishaq <noreply@codebuff.com>
… unit tests

Register all new services, IndexedEvent entity, and WebSocket gateway
in BlockchainIndexerModule. Add cursor and sequence state helpers to
IndexingStateService. Add 36 unit tests for EventNormalizer,
EventBufferService, and SubscriptionManager.

🤖 Generated with Codebuff
Co-Authored-By: DevMuhdishaq <noreply@codebuff.com>
@akargi
akargi merged commit 3df6378 into Chulilee:main Aug 23, 2026
1 check 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.

[Feature]: Advanced Stellar Ledger Indexer with Real-time Event Streaming

2 participants