Skip to content

Implement Contract Event Push to Backend via Signed Webhook #1717

Description

@RUKAYAT-CODER

Overview

The backend polls on-chain state on demand. There is no mechanism for the contract or a Horizon event indexer to push events to the backend, causing latency in status updates.

Specifications

Features:

  • Horizon event streaming script that listens to contract topic events
  • Signs events with a shared secret and POSTs to backend webhook endpoint
  • Backend webhook handler verifies signature and updates DB

Tasks:

  • Create scripts/event-indexer.ts using Stellar SDK SSE
  • Wire to existing WebhooksController in backend
  • Add integration test

Impacted Files:

  • contracts/earn-quest/examples/indexer-example.ts (extend)
  • BackEnd/src/modules/webhooks/webhooks.controller.ts`n

Acceptance Criteria:

  • On-chain events delivered to backend within 10s
  • Backend DB status updated on receipt

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignStellar WaveIssues in the Stellar wave programcontractenhancementNew feature or request

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