ionet-official / ProductFeedback

Any feedback, create an issue
Apache License 2.0
3 stars 2 forks source link

Proposal: Alert Notification for Worker Readiness Changes #19

Open derrickpehjh opened 1 month ago

derrickpehjh commented 1 month ago

Objective

Implement an alert notification system to notify users via email, Telegram bot, or desktop notification whenever a worker's readiness status changes. This aims to enhance user awareness and responsiveness to changes in the worker's operational status, ensuring timely interventions and improved cluster management.

Background

In a distributed blockchain network, maintaining the readiness of workers is crucial for optimal performance and reliability. Workers may transition through various states such as "Cluster Ready," "Not Block Reward Ready," or "Hired." Immediate awareness of these transitions allows for prompt action, reducing downtime and maintaining the integrity of the network.

Proposal

This proposal outlines the implementation of an alert notification system that will send notifications to users through predefined channels (email, Telegram bot, desktop) when a worker's readiness status changes.

Details

  1. Trigger Events:

    • Cluster Ready: Indicates the worker is fully operational and part of the active cluster.
    • Not Block Reward Ready: Indicates the worker is not currently eligible for block rewards, possibly due to failing health checks or other issues.
    • Hired: Indicates the worker has been hired and is preparing to join the cluster.
  2. Notification Channels:

    • Email: Notifications sent to a specified email address.
    • Telegram Bot: Notifications sent via a Telegram bot to a predefined chat.
    • Desktop Notification: Pop-up notifications on the desktop for users with the application installed.
  3. Implementation Steps:

    1. Identify Readiness State Changes:

      • Implement hooks or listeners within the worker management system to detect state changes.
    2. Notification Service Integration:

      • Email: Use SMTP or a third-party email service (e.g., SendGrid) to send email notifications.
      • Telegram Bot: Create a Telegram bot using the Telegram Bot API to send messages to users.
      • Desktop Notification: Use web or desktop notification APIs/ websockets to send alerts to users' desktops.
    3. Configuration Interface:

      • Develop a configuration interface for users to manage their notification preferences (channel, contact details, etc.).
    4. Message Templates:

      • Create customizable message templates for each type of readiness state change, including relevant details such as worker ID, timestamp, and new state.
  4. Security and Privacy:

    • Ensure secure handling of contact information and secure transmission of notifications.
    • Provide an option for users to opt-in and opt-out of notifications.
  5. Testing and Validation:

    • Thoroughly test the notification system to ensure reliability and accuracy of alerts.
    • Conduct user acceptance testing with a subset of users before full deployment.

Benefits

Conclusion

Implementing an alert notification system for worker readiness changes will significantly enhance the ability to manage and maintain the blockchain network's health and performance. This proposal seeks approval to develop and deploy this notification system, ensuring timely and efficient handling of readiness state changes.

ZhijieWang commented 1 month ago

how do you plan to achieve this?

derrickpehjh commented 1 month ago

@ZhijieWang please refer to details section where the trigger events, notification channels and implementation steps are written out