- Labels:
backend, indexer, stellar, soroban
Description
To keep the database in sync with on-chain interactions, we need a backend service that polls the Stellar Horizon / Soroban RPC endpoint for events emitted by our Escrow and Dispute smart contracts.
Technical Scope & Steps
- Set up a polling interval script using the
@stellar/stellar-sdk to monitor ledger state.
- Filter transaction events by contract ID and event topics (e.g.,
fund_session, pause_session, refund_session, complete_session).
- Decode contract XDR event payloads into readable JSON data.
- Update the corresponding
Session and Transaction status in the PostgreSQL database based on event content.
- Track and store the last processed ledger sequence to prevent double-processing or missed sequences on restart.
Acceptance Criteria
- Simulating a contract event triggers the database update within 5 seconds.
- Restarts continue processing from the last saved ledger sequence.
- Failures in decoding event payloads do not crash the service.
backend,indexer,stellar,sorobanDescription
To keep the database in sync with on-chain interactions, we need a backend service that polls the Stellar Horizon / Soroban RPC endpoint for events emitted by our Escrow and Dispute smart contracts.
Technical Scope & Steps
@stellar/stellar-sdkto monitor ledger state.fund_session,pause_session,refund_session,complete_session).SessionandTransactionstatus in the PostgreSQL database based on event content.Acceptance Criteria