Skip to content

[S3] Implement cron job that polls Horizon every 10 seconds #685

Description

@Akshola00

Description

Add the cron job that calls Horizon on a schedule to check for new contract events.

Deliverables

  • SyncService has @Cron(CronExpression.EVERY_10_SECONDS) method syncEvents()
  • Calls HorizonService.getTransactions(contractId, cursor)
  • Stores the latest-seen cursor in memory between runs to avoid re-processing old events
  • Logs how many new events were found each run
  • Does not crash if Horizon is unreachable (catches and logs error)
  • npm run build passes

Notes

Depends on #47 (SyncModule).

Metadata

Metadata

Assignees

Labels

MediumStellar WaveIssues in the Stellar wave programbackendNestJS server workstage-3Backend API implementationsyncHorizon event indexing

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions