nodewatcher

module
v0.0.0-...-672e050 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2023 License: MIT

README

Nodewatcher

This program monitors the status of a Lightning Node and sends an alert if the node is unsynced or another issue is detected. It also and makes static channel backups.

Rationale

If lightning node is offline, channel parter could force close channels and steal the money on that channel. Routing nodes are also monitored for uptime by their peers and payment routing is deprioritized for less reliable nodes.

Requirements

  • Twilio account

Build and Run locally

  1. Set environment variables
cp env-example.sh env.sh
(make applicable changes)
source env.sh
  1. Seed the database by adding your node and user details here:
/internal/db/migrations/20230228010000_seed_users.up.sql
/internal/db/migrations/20230228010000_seed_nodes.up.sql
  1. Buld and run
docker compose up postgres
make build
make run

Sample Output

Getting node status ...

SMS sent successfully!

Good news, lightning node "abcxyz" is fully synced!
Last block received 15m18.211865s minutes ago

Directories

Path Synopsis
cmd
nw
internal
backup
Package backup saves LND static channel backups to a PostgreSQL database
Package backup saves LND static channel backups to a PostgreSQL database
db
Package db implements database models, insert and select functions for a postgres database using the "bun" ORM (github.com/uptrace/bun)
Package db implements database models, insert and select functions for a postgres database using the "bun" ORM (github.com/uptrace/bun)
health
Package health provides functions to check the status of an LND lightning node
Package health provides functions to check the status of an LND lightning node

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL