Skip to content

Feature/backend indexer webhooks operator expiry#729

Open
Mosas2000 wants to merge 17 commits into
StellarYield:mainfrom
Mosas2000:feature/backend-indexer-webhooks-operator-expiry
Open

Feature/backend indexer webhooks operator expiry#729
Mosas2000 wants to merge 17 commits into
StellarYield:mainfrom
Mosas2000:feature/backend-indexer-webhooks-operator-expiry

Conversation

@Mosas2000

Copy link
Copy Markdown
Contributor

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

Developer 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant