Code Monkey home page Code Monkey logo

hopr_node_notification's Introduction

This a fork from https://github.com/Ziltar/HOPR_Node_Notification. Great thanks to Ziltar!

HOPR Node Notification

Simple script to get the status of a node via Telegram.

Telegram bot Node Notification

This bot checks the availability of the node (or multiple nodes) every certain time and sends a notification about the status of the node(s). A notification can be sent always or only when the availability changes.

Installation

  1. Clone the repository :
    git clone https://github.com/alpha7b/HOPR_Node_Notification.git && cd HOPR_Node_Notification
  2. Install requirements:
    pip install -r requirements.txt
  3. Rename setting.py_sample to setting.py
  4. Edit the settings.py File:

    NODES: HOPR Node Address(es)
    Example:
    NODES = ["16Uiu2HAmH3RhgTDN6cwysRnMtMf4jfzsvKuyuKPu5iDRZUZiVsqx", "16Uiu2HAkuTsuFSak6UJeF2w3KV2uzoNSpuGNFKC2vyLt63BpwuDC"]

    TELEGRAM_TOKEN
    Example:
    TELEGRAM_TOKEN = "5475148206:ABBc0fhQSwfBjKioPwbaZ9uxEPkpsgqbgi"
    You can get your token here: https://t.me/BotFather

    TELEGRAM_ID
    You can use a bot to find out your ID: https://t.me/userinfobot
    Example:
    TELEGRAM_ID = "15915301634711"

    ON_CHANGE
    If True, the bot sends a notification only when the availability changes (24 hours). If False, a notification is sent 30 minutes.
    Example:
    ON_CHANGE = True

    INTERVAL = '1800'
    By default, the bot will check node status every 1800 seconds which is 30 minutes. You can change the interval. For example, change to 3600 seconds.
    Example:
    INTERVAL = '3600'

    ON_REWARD_CHANGE
    If True, the bot sends a notification when reward changes.
    Example:
    ON_REWARD_CHANGE = True

    STAKE_WALLETS: For reward status:
    Example:
    STAKE_WALLETS = ["0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000001"]

Usage

Run main.py: python3 main.py

You can also run it in a screen session.

screen -r hoprd-monitor
python3 main.py

CTRL + A + D to detach the screen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.