Skip to content

Latest commit

 

History

History
90 lines (65 loc) · 3.37 KB

script-nostrbandstats.md

File metadata and controls

90 lines (65 loc) · 3.37 KB
panelgroup name title layout description images
Nostr Panels
Nostr.Band statistics
Nostr.Band statistics
default
Renders images of stats about Nostr based on the data collated by Nostr.Band.
../images/nostrbandstats-activepubkeysperday.png
../images/nostrbandstats-badgescreatedperday.png
../images/nostrbandstats-zapsperday.png

Nostr.Band Stats

This script prepares images displaying stats about the Nostr protocol as gathered by Nostr.Band

sample image of stats for zaps per day

sample image of stats for active pubkeys per day

sample image of stats for badge definitions per day

Script Location

The script is installed at ~/nodeyez/scripts/nostrbandstats.py.

Configuration

To manage and configure this script, use the nodeyez-config tool

sudo nodeyez-config

To manually configure this script, edit the ~/nodeyez/config/nostrbandstats.json file

Fields are defined below

field name description
attributionColor The text color for the source attribution line expressed as a Hexadecimal color specifier. Default #A020A0
backgroundColor The background color of the image expressed as a hexadecimal color specifier. Default #000000
graphAverageColor The color to use for the average value line drawn across fee rates. Default #8888FF
graphBorderColor The color to use for outlining charts and their labels. Default #888888
graphDataColors An array of colors to use for multi valued charts. Default: #A020A0, #0000FF, #00FF00, #D0C000, #FF0000, #00FFFF, #800000, #808080, #008000, #800080, #FF00FF, #008080
headerColor The color of the text expressed as a Hexadecial color specifier. Default #ffffff
height The height, in pixels, to generate the image. Default 320
interval The amount of time, in seconds, the script should wait before data gathering and image creation again. Default 86400
renderActivePubkeysPerDay Indicates whether the image charting the active pubkeys per day should be rendered. Default True
renderBadgeDefinitionsPerDay Indicates whether the image charting the badge definitions created per day should be rendered. Default True
renderZapsPerDay Indicates whether the image charting the number of zaps per day should be rendered. Default True
statsUrl The url that provides the stats about Nostr from Nostr.band. Default https://stats.nostr.band/stats_api?method=stats&options=
useTor Indicates whether remote calls should use tor socks proxy for privacy. Default true
textColor The color of the text expressed as a Hexadecimal color specifier. Default #ffffff
width The width, in pixels, to generate the image. Default 480

Running Directly

Ensure the virtual environment is activated

source ~/.pyenv/nodeyez/bin/activate

Change to the scripts folder

cd ~/nodeyez/scripts

Run it

python nostrbandstats.py

Press CTRL+C to stop the process

Run at Startup

To enable the script to run at startup, as the privileged user run the following

sudo systemctl enable nodeyez-nostrbandstats.service

sudo systemctl start nodeyez-nostrbandstats.service

Home |