# Our solution

<figure><img src="https://2213319267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBrGfJBbeL38g5ePMhM3x%2Fuploads%2F0bKgZjGbOO9JMXMsR8OL%2Fimage.png?alt=media&#x26;token=57f28db8-9985-4a1e-bdcc-947f8c9afe51" alt=""><figcaption><p>Crypitor's workflow</p></figcaption></figure>

**Workflow Overview**

1. **User Interaction:**
   * Users create monitors through an API to track specific blockchain events or transactions.
2. **Worker Process:**
   * The worker loads block data from the blockchain network (e.g., Ethereum, Binance Smart Chain).
   * Events and transactions from the blockchain are added to a Kafka queue for further processing.
3. **Event Processing:**
   * Events are retrieved from the Kafka queue.
   * The monitor system processes these events to match predefined conditions set by the user.
4. **Data Management:**
   * Matching conditions and event data are stored and managed within a database.
   * The monitor retrieves and processes stored data as per the user's configuration.
5. **Event Delivery:**
   * The webhook system is used to send the matched events to the users.
   * Users receive notifications or data through the webhook, ensuring real-time updates.

**Detailed Components**

1. **API**
   * **Purpose:** Allows users to create and configure monitors for specific blockchain events.
   * **Interaction:** Users interact with the API to set up monitoring conditions.
2. **Worker**
   * **Purpose:** Loads block data from the blockchain network and adds events/transactions to the Kafka queue.
   * **Interaction:** Continuously communicates with the blockchain network to gather data.
3. **Kafka**
   * **Purpose:** Acts as a message broker to handle event and transaction data flow.
   * **Interaction:** Queues events and transactions for processing by the monitor system.
4. **Monitor**
   * **Purpose:** Processes events from Kafka, checks against user-defined conditions, and interacts with the database.
   * **Interaction:** Retrieves and processes data, matches conditions, and stores results in the database.
5. **Database**
   * **Purpose:** Stores event data, user configurations, and matching conditions.
   * **Interaction:** The monitor reads from and writes to the database to manage event data and user configurations.
6. **Webhook System**
   * **Purpose:** Delivers matched events to users in real-time.
   * **Interaction:** Sends notifications or data to users based on their configured monitors.
