Skip to content

[CONTRACTS] Add structured log for Soroban contract event ingestion with ledger number and topicΒ #157

Description

@chizzy192

Metadata

Field Value
Domain Contracts
Difficulty Easy (1–2 Days)
Effort Estimate effort: 3h
Priority P2-Medium
Labels good first issue, easy, Stellar Wave
Target Branch dev
Depends On #135

🎯 Context & Goal

When the event indexer worker ingests on-chain contract events from Soroban RPC getEvents, structured logs must be emitted via Winston logger to facilitate operational monitoring in Datadog or CloudWatch.

This issue adds structured logging in src/services/stellar/event-indexer.service.ts recording ledgerSequence, contractId, topicSymbol, and eventPayload.

πŸ“‚ Target Files

  • src/services/stellar/event-indexer.service.ts -> Log event ingestion

πŸ“‹ Implementation Tasks

  • Add logger.info() call upon receiving each valid contract event
  • Include metadata fields: ledgerSequence, contractId, topic, txHash
  • Add unit tests verifying logger output format

πŸ› οΈ Technical Guidance

logger.info('Soroban event ingested', { ledgerSequence, contractId, topic, txHash });

πŸ”— References & Related

  • Winston Structured Logging

⏳ Delivery Window

This issue should be completed within 2 day(s) of assignment.

Contribution Workflow

  1. Branch off dev: git checkout -b feature/descriptive-name dev
  2. Implement all tasks in the checklist above.
  3. Run all CI checks locally (see DEVELOPMENT.md).
  4. Open a Pull Request targeting dev.
  5. Link this issue in your PR description: Closes #XX.

βœ… Acceptance Criteria

  • All implementation tasks above are completed.
  • Code compiles/builds without errors.
  • All existing tests continue to pass.
  • New tests are added with >80% coverage of new code.
  • Code follows project style guidelines (formatting, linting).
  • PR targets dev branch (NOT main).
  • PR description references this issue.
  • Documentation is updated if public API changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programeasySmall scope / straightforwardgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions