KOR Protocol Developer Docs
  • KOR Protocol: Introduction
    • Overview
    • Partners
  • Overview of KOR SDK
    • Notable Features
    • Merits of using KOR SDK
    • Use Cases
  • SDK Reference
    • Introduction
    • SDK Installation
    • SDK Initialization
    • Client Methods
      • Asset
      • NFT
      • On-Chain IP
      • On-Chain License
      • Royalty Distribution
      • Conflict Management
    • Tutorials
      • Pre-requisites
      • Mint and Register in Own Collection
      • Mint in KOR Collection and Register
      • Register Existing Minted Token as IP
      • Launch 100-Song Album via IPFS
      • Launch 5-Song Album via AWS S3
      • Register Asset as Derivative
      • Update License Terms of Existing IP
      • Raise, resolve and cancel conflicts
      • Create a copy NFT of an IP
    • Releases
    • Deployed Smart Contracts
  • Essential Business Flows
  • Architecture
    • Overview
    • Event Listener
    • Modules
      • Asset Module
      • NFT Module
      • On-Chain IP Module
      • On-Chain License Module
      • Royalty Distribution Module
      • Conflict Management Module
  • Key Definitions
  • Community
Powered by GitBook
On this page
  • High-Level Architecture
  • Workflow
  1. Architecture

Event Listener

PreviousOverviewNextModules

Last updated 6 months ago

The Event Listener Service is a crucial component of our architecture, designed to monitor and handle events emitted by the KOR protocol smart contracts. This service is responsible for ensuring that all relevant blockchain events are captured, processed, and stored efficiently for further analysis and use.

High-Level Architecture

  1. Connection to RPC Providers

    • The Event Listener Service is connected to both Ankr and Alchemy RPC providers. These providers offer robust and reliable access to the Ethereum network, allowing our service to monitor the KOR protocol smart contracts for any events.

  2. Event Detection

    • When an event is emitted by a KOR protocol smart contract, the Event Listener Service detects this event in real-time. This ensures that no significant blockchain activity goes unnoticed.

  3. Message Queue Integration

    • Upon detecting an event, the Event Listener Service sends the event data to AWS SQS (Simple Queue Service). This decouples the event detection from the processing, allowing for more scalable and fault-tolerant operations.

  4. Consumer Service

    • The Consumer Service picks up the events from the AWS SQS queue. It decodes the event data and processes it to extract relevant information.

  5. Data Storage

    • The processed event data is then transmitted to a database where it is stored in an indexed form. This allows for efficient querying and retrieval of event data for various applications.

Workflow

  1. Listening for Events

    • The Event Listener Service continuously listens to the KOR protocol smart contracts through the connected RPC providers (Ankr and Alchemy).

  2. Event Emission

    • When an event is emitted, it is immediately detected by the Event Listener Service.

  3. Queuing the Event

    • The event data is packaged and sent to AWS SQS, ensuring it is queued for further processing.

  4. Consuming the Event

    • The Consumer Service retrieves the event from the AWS SQS queue, decodes it, and processes the data.

  5. Storing the Event

    • The processed data is stored in a database with appropriate indexing, facilitating efficient data management and retrieval.

Event Listener - High Level Architecture