Git Product home page Git Product logo

nanoticker's Introduction

Nano Ticker

A real-time statistical tool to check Nano network health. Using data from public Nano Node Monitors.

Public Site

Requirements

  • Ubuntu 20.04 preferred (18 possible)
  • Apache: sudo apt install apache2

Install

I suggest --no-updates to not accidentially break the plugin. That being said, I cannot guarantee the plugin will work with the latest Netdata at the time you run this.

bash <(curl -Ss https://my-netdata.io/kickstart.sh) --no-updates --stable-channel
chmod +x autocopy.sh
./autocopy.sh
service netdata restart

Instructions and Config

You will run script/calc-reps.py on a machine that has connection to a Nano node. First open it and check the following:

  • BETA and DEV: If running on main net, set both to False
  • nodeUrl, telemetryAddress, telemetryPort and websocket needs to correspond to your node settings
  • statFile and monitorFile must be written by the script to a webserver that can be reached publicly from any remote client browser (cross-origin is a common error)
  • localTelemetryAccount is the nano account of your representative (if using that as the rpc/telemetry node). It's handled a bit different.

To run calc-reps.py you need repList.py in the same folder and the following:

  • Python: At least 3.6
  • Python aiohttp: pip3 install aiohttp
  • Python websockets: pip3 install websockets
  • Python numpy: pip3 install numpy

The netdata folder contains the python plugin for Netdata. Both for main net and beta net. It's configurable via the .conf files. The script/repList.py may be outdated but that's just for the initial sync. The peers are updated while the script is running but may take a while.

On the frontend machine (or if you use the same as backend):

  • The netdata nanoticker plugin will connect and read the stats.json file on the webserver (repstats_v21.conf)
  • The webpage itself (public_html/index.html) will connect and read both stats.json and monitors.json. It's configurable in the html file.
  • You may want to turn off google analytics in the index.html file
  • The main nanoticker site is hosted at /var/www/repstat/index.html
  • The beta nanoticker site is hosted at /var/www/repstat-beta/index.html

Debug the plugins

grep python /var/log/netdata/error.log

/usr/libexec/netdata/plugins.d/python.d.plugin repstats debug trace
/usr/libexec/netdata/plugins.d/python.d.plugin repstats-b debug trace
/usr/libexec/netdata/plugins.d/python.d.plugin 1 debug repstats
/usr/libexec/netdata/plugins.d/python.d.plugin 1 debug repstats-b

Config netdata

nano /etc/netdata/netdata.conf

hostname = NanoTicker
history = 100800
update every = 6
memory mode = dbengine
page cache size = 500
dbengine disk space = 500

Performance

The nanoticker frontend requires two json files to be read by each connected client every 30sec. The disk read could be minimized by running the json-cache proxy server as intermediate cache system.

  • Can be run as docker or docker compose
  • The json files that are output by the calc-reps.py will be read by the proxy. For example set the paths in the docker-compose.yml
  • Then point the repstats_v21.conf and/or repstats-b.conf to the proxy (localhost:9950/?file=stats)
  • Also point the index.html to the proxy (localhost:9950/?file=stats and localhost:9950/?file=monitors)
  • For beta network: localhost:9950/?file=stats-beta and localhost:9950/?file=monitors-beta

Find this useful? Send me a Nano donation at nano_1gur37mt5cawjg5844bmpg8upo4hbgnbbuwcerdobqoeny4ewoqshowfakfo

nanoticker's People

Contributors

joohansson avatar wesleym77 avatar

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.