feat/Implemented Webhook Listener for Stellar Ledger Events#257
Open
samjay8 wants to merge 3 commits into
Open
feat/Implemented Webhook Listener for Stellar Ledger Events#257samjay8 wants to merge 3 commits into
samjay8 wants to merge 3 commits into
Conversation
|
@samjay8 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Collaborator
|
@samjay8 you might want to look in to CI |
Author
I don't think it's from my end. |
Author
|
@gabito1451, I guess this is from your end. I just worked on it again, yet the CI still failed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #201
🔔 Feature: Webhook Listener for Stellar Ledger Events
Replaces manual status updates with a real-time Soroban event streaming service that automatically updates booking and payment status when on-chain events are detected.
New Files
backend/app/services/webhook_listener.py(234 lines)WebhookListenerService— streams contract events viaSorobanServer.stream()EngagementInitializedEventandReclaimedEventby contract addressbackend/app/services/event_handler.py(138 lines)EngagementInitializedEvent→ BookingIN_PROGRESSReclaimedEvent→ BookingPENDING, PaymentFAILEDbackend/app/db/migrations/004_add_events_table.py(65 lines)eventstable for tracking processed on-chain eventscontract_address,topic, andledger_sequenceModified Files
backend/app/core/config.py— addedWEBHOOK_LISTENER_ENABLED,EVENT_STREAM_INTERVAL(5s),EVENT_CURSOR_TTL(24h)backend/app/api/v1/endpoints/health.py— comprehensive health checks (DB, Redis, Soroban, Webhook); addedPOST /api/v1/webhook/listenerbackend/app/main.py— registered webhook listener route; updated root endpointAcceptance Criteria
✅
SorobanServer.stream()used for real-time event streaming✅
EngagementInitializedEventandReclaimedEventhandled✅ Booking/payment status updated automatically on event detection
✅ Idempotent processing via Redis cursor tracking