Feature/backend indexer webhooks operator expiry#729
Open
Mosas2000 wants to merge 17 commits into
Open
Conversation
added 17 commits
June 26, 2026 15:51
…TypeScript backend - Add PostgreSQL database configuration - Configure Stellar RPC and webhook settings - Set up build and development scripts
…equired tables - Add indexed_events for blockchain event storage - Add vaults, users, and deposit tracking tables - Add yield_history and distribution tables - Add vault_operators table with expiry support - Add audit_log and webhook_subscriptions - Create migration runner and database pool
…ient for fetching blockchain events - Create event processor for all event types - Handle vault lifecycle events and state changes - Process deposits, withdrawals, and yield distributions - Track operator assignments with expiry - Implement webhook notification service with HMAC signatures - Add continuous indexer with replay capability
…iguration management - Add admin authentication middleware - Implement pagination headers helper for all endpoints - Set X-Total-Count and X-Page-Size headers
… expired operators inactive - Filter operators by expires_at timestamp - Log expiry events to audit trail - Support permanent operators with null expiry
… server with security middleware - Mount all API route handlers - Start operator expiry background task - Update gitignore for backend build artifacts
…oad schemas - Provide HMAC-SHA256 signature verification guide - Include Node.js and Python verification examples - Describe common envelope structure for all events - Add best practices for webhook handling
…features, architecture decisions, and testing procedures
…equired tables - Add indexed_events for blockchain event storage - Add vaults, users, and deposit tracking tables - Add yield_history and distribution tables - Add vault_operators table with expiry support - Add audit_log and webhook_subscriptions - Create migration runner and database pool
…ient for fetching blockchain events - Create event processor for all event types - Handle vault lifecycle events and state changes - Process deposits, withdrawals, and yield distributions - Track operator assignments with expiry - Implement webhook notification service with HMAC signatures - Add continuous indexer with replay capability
…iguration management - Add admin authentication middleware - Implement pagination headers helper for all endpoints - Set X-Total-Count and X-Page-Size headers
… expired operators inactive - Filter operators by expires_at timestamp - Log expiry events to audit trail - Support permanent operators with null expiry
… server with security middleware - Mount all API route handlers - Start operator expiry background task - Update gitignore for backend build artifacts
…oad schemas - Provide HMAC-SHA256 signature verification guide - Include Node.js and Python verification examples - Describe common envelope structure for all events - Add best practices for webhook handling
…features, architecture decisions, and testing procedures
…er-webhooks-operator-expiry
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.
Implementation Complete
Closes #596: Admin Replay Endpoint ✓
Created POST /api/v1/admin/indexer/replay endpoint
Accepts fromLedger and toLedger parameters
Deletes existing events in range, re-fetches from Stellar RPC, and re-processes
Returns HTTP 202 with unique replayId
Returns eventsReplayed: 0 for empty ranges
##Closes #597: Pagination Headers ✓
Created setPaginationHeaders() helper function
Applied to all 4 paginated endpoints:
GET /api/v1/vaults
GET /api/v1/users/:address/yield-history
GET /api/v1/admin/vaults/:contractId/audit
GET /api/v1/admin/events
Headers (X-Total-Count, X-Page-Size) present even when total is 0
Closes #598: Webhook Documentation ✓
Created comprehensive backend/docs/webhooks.md (194 lines)
Documented all 6 event types with payload schemas
Provided HMAC-SHA256 verification guide
Included complete Node.js and Python code examples
All event names match NotificationService.notify() calls
Closes #599: Operator Expiry Tracking ✓
Added expires_at column to vault_operators table (migration 002)
Populated from op_add event payload
GET /api/v1/vaults/:contractId/operators filters expired operators
Hourly background task marks expired operators inactive
NULL expires_at treated as permanent assignment
Architecture Delivered
21 files created across backend infrastructure
PostgreSQL database with 10 tables
Event indexer with Stellar RPC integration
Webhook service with HMAC-SHA256 signatures
REST API with authentication and pagination
Background tasks for operator expiry