Code Monkey home page Code Monkey logo

helium-heartbeat's Introduction

Helium Heartbeat ๐ŸŽˆ

hotspot-heartbeats

Overview

This script collects data for every hotspot in a given wallet, comparing the Helium Blockchain Height to the most recent activity block of each hotspot over time. This data is plotted and sent to the user via the Pushover API on a Report and Alert basis.

To anyone hoping to use this script to monitor your own hotspots please clone or fork this repo! If you see mistakes or have suggestions please submit pull requests!

Known Limitations

  • This script will be slow if you have dozens of hotspots, multithreading helps, but the Helium API is only so fast.
  • This whole system is designed to run with just a single wallet address at a time, passing a different WALLET_ADDR from run to run will throw all the data into one giant bucket.

Setup

You can find a more detailed walk through on the implementation on my blog but here are the basics

Create A virtualenv

This code was written with Python3.9, though I suspect it will work well with Python3.6+ (it uses f-strings quite a bit)

Create a virtual environment and install the requirements using

pip install -r requirements.txt

Store Your Wallet Address In Environment Variables

I do this in /postactivate and /predeactivate

Edit the /postactvate file:

#!/bin/zsh
# This hook is sourced after this virtualenv is activated.

export WALLET_ADDR="a-valid-wallet-address"

Edit the /predeactivate file:

#!/bin/zsh
# This hook is sourced before this virtualenv is deactivated.

unset WALLET_ADDR

Pushover API Keys

Two Pushover Apps are recommended, at least one is necessary.

App Name Environment Variable Description
Pushover Report Key PUSHOVER_APP_TOKEN_HNT_REPORT regular updates, when all hotspots are considered active
Pushover Alert Key PUSHOVER_APP_TOKEN_HNT_ALERT when a hotspot "active" status has changed to inactive or active

Add these to teh /postactivate and /predeactivate files


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.