Implement a service to listen to SafeGig smart contract events and update the backend database in real-time.
Tasks:
Load ABI + contract address from deployment config.
Create EventListenerService to subscribe to events (GigCreated, PaymentReleased, etc.).
Update Postgres tables (jobs, escrow) when events fire.
Implement error handling for blockchain reorgs (retry sync).
Add logging for received events.
Acceptance Criteria:
✅ Events from the blockchain are detected.
✅ Relevant DB entries are created/updated in sync.
✅ Service can recover from downtime by resyncing missed blocks.
Implement a service to listen to SafeGig smart contract events and update the backend database in real-time.
Tasks:
Load ABI + contract address from deployment config.
Create EventListenerService to subscribe to events (GigCreated, PaymentReleased, etc.).
Update Postgres tables (jobs, escrow) when events fire.
Implement error handling for blockchain reorgs (retry sync).
Add logging for received events.
Acceptance Criteria:
✅ Events from the blockchain are detected.
✅ Relevant DB entries are created/updated in sync.
✅ Service can recover from downtime by resyncing missed blocks.