https://github.com/rbndg/lightning-invoice-queue
Pass invoices from multiple Lightning Nodes to a Redis Queue
https://github.com/rbndg/lightning-invoice-queue
Last synced: 8 days ago
JSON representation
Pass invoices from multiple Lightning Nodes to a Redis Queue
- Host: GitHub
- URL: https://github.com/rbndg/lightning-invoice-queue
- Owner: rbndg
- License: apache-2.0
- Created: 2020-04-20T00:37:24.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-20T22:07:53.000Z (about 5 years ago)
- Last Synced: 2025-05-12T19:14:00.286Z (8 days ago)
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lightning-Invoice-Queue
Listen to lightning invoices from multiple LND and C-Lightning nodes and send to a redis queue for processing.
This is useful if you are managing multiple nodes and want to process the invoice payments.
This module pushes the `id` of the invoice and `node_pub` of a paid invoice to a redis queue.## How to run
1) git clone this repo
2) `npm install .`
3) Update `config.json.example`
4) `npm start`### How to read the queue
If you use [RSMQ](https://github.com/smrchy/rsmq) (Redis Simple Message Queue)```
const rsmq = new RedisSMQ( {host: "127.0.0.1", port: 6379, ns: "Lightning-Invoice-Queue"} );
rsmq.receiveMessage({ qname: "invoice-queue" }, function (err, resp) {
if (err) {
console.error(err)
return
}
if (resp.id) {
console.log("new invoice paid! Now we process it!", resp)
} else {
console.log("No invoices for me...")
}
});
```#### C-Lightning
You need to setup [C-Lightning Websocket Plugin](https://github.com/rbndg/c-lightning-events) for C-Lightning, or any other C-Lightning websocket plugin.#### LND
You need to have your `macaroon` and `tls` files update config.json with path