Skip to content

feat: Set up event listeners for pool creation events #30

Description

@rafamiziara

Description

Implement Firebase Cloud Functions to listen for PoolCreated events from the PoolFactory contract and sync data to Firestore for off-chain queries.

Acceptance Criteria

  • Create event listener for PoolCreated events
  • Set up Firestore collections for pool data
  • Implement data synchronization logic
  • Add error handling for failed event processing
  • Create data validation and integrity checks
  • Add event replay functionality for missed events
  • Implement monitoring and alerting

Technical Requirements

  • Use ethers.js event listening capabilities
  • Integrate with existing Firebase architecture
  • Implement reliable event processing
  • Add proper error recovery mechanisms
  • Include event deduplication logic
  • Support for historical event processing

Event Processing

  • Listen for PoolCreated events from PoolFactory
  • Extract pool data from event logs
  • Validate and sanitize event data
  • Store pool information in Firestore
  • Update pool indexes and metadata

Data Structure (Firestore)

  • pools collection with pool documents
  • Pool metadata (name, description, creator, address)
  • Creation timestamp and transaction details
  • Pool status and configuration
  • Searchable indexes for pool discovery

Error Recovery

  • Handle network connectivity issues
  • Retry failed event processing
  • Detect and handle missed events
  • Maintain event processing state
  • Alert on critical failures

Definition of Done

  • Event listeners successfully capture PoolCreated events
  • Pool data is accurately synced to Firestore
  • Robust error handling and recovery
  • Event processing monitoring in place
  • Documentation for event system architecture

Metadata

Metadata

Assignees

Labels

comp: backendIssues for the Firebase Cloud Functions in packages/backend

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions