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.
- git clone this repo
npm install .- Update
config.json.example npm start
If you use 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...")
}
});
You need to setup C-Lightning Websocket Plugin for C-Lightning, or any other C-Lightning websocket plugin.
You need to have your macaroon and tls files update config.json with path