From 874c984c6d5b3fd128641d126917528d73476995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Fri, 2 May 2025 16:45:43 +0400 Subject: [PATCH] Add README --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..b3fd63b --- /dev/null +++ b/README.md @@ -0,0 +1,48 @@ +# lndhub.go stats + +A collection of [Deno][1] scripts for exporting anonymized statistics from +[lndhub.go][2] databases. + +## Requirements + +* [Deno](https://docs.deno.com/runtime/getting_started/installation/) (>= 2.3) + +## Configuration + +Copy `.env.example` to `.env` and edit the values. Or use system environment +variables instead. + +* `BATCH_SIZE` controls how many parallel connections to your database are established +* `MAX_INVOICES` will skip users with extreme amounts of transactions (above this threshold) + +## Generate anonymization key + +Generate a random key so you can use it as `ANONYMIZATION_KEY`: + +### Usage + + deno run generate-key.ts + +## Generate daily stats per user + +This will generate daily statistics per user, exported to `daily-stats.csv`: + +* Anonymized user ID +* Date +* Balance Start of Day +* Balance End of Day +* Balance Max Day +* Balance Min Day +* Total Flow Out +* Total Flow In + +### Usage + + deno run -A generate-stats.ts + +## Contact + +E-Mail, Chat, Social: raucao@kosmos.org + +[1]: https://deno.com +[2]: https://github.com/getAlby/lndhub.go