Skip to content

[CT-14] Build VerificationWebhookNotifier #546

Description

@mftee

Problem

When a document hash is successfully anchored or verified on Stellar, no external system is notified. Integrators who need to react to on-chain confirmation events must poll the API continuously.

Proposed Solution

Create a VerificationWebhookNotifier inside contract/module/webhook/ that sends an HTTP POST notification to a configured webhook URL after each successful Stellar operation.

Acceptance Criteria

  • Reads the WEBHOOK_URL environment variable on startup — if not set the notifier is disabled and logs a warning
  • notify(event_type: &str, document_hash: &str, tx_hash: &str, timestamp: i64) async function fires a POST request to the configured URL
  • Webhook payload is JSON: { event_type, document_hash, tx_hash, timestamp, service: smalda-contract }
  • The submit, revoke, and transfer handlers call the notifier after a successful Stellar transaction
  • Uses reqwest with a 5-second timeout — failed webhook deliveries are logged at WARN level but do not cause the handler to return an error
  • Retries the webhook delivery once after a 2-second delay on the first failure before giving up
  • Implementation files live inside contract/module/webhook/

Metadata

Metadata

Assignees

Labels

Type

No type
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