diff --git a/.lndonate b/.lndonate new file mode 100644 index 0000000..c7377e9 --- /dev/null +++ b/.lndonate @@ -0,0 +1 @@ +lnurlp://ln.michaelbumann.com/.well-known/lnurlp/bumi diff --git a/README.md b/README.md index 8cd5dd1..6b32adf 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ LnMe is one [simple executable](https://github.com/bumi/lnme/releases) file that LnMe connects to your [LND node](https://github.com/lightningnetwork/lnd/blob/master/docs/INSTALL.md), so a running LND node is required. LnMe can easily run next to LND on the same system or any other hosting provider. -There are no other dependencies. Simply download the binary and run it! +There are no other dependencies. Simply download the binary and run it! 1. Download the latest [release](https://github.com/bumi/lnme/releases) 2. Run `lnme` @@ -105,11 +105,11 @@ To get the HEX versions of the files use `xxd -plain` e.g. `xxd -plain invoice.m LnMe can connect to your lightning node through [Tor](https://www.torproject.org/). You need to have Tor installed on your system and then simply provide your LND `.onion` address (don't forget to specify the port). -### Deployment +## Deployment -It is the easiest to run LnMe on the same node as LND. But you can run it anywhere as long as your LND node is accessible. +It is the easiest to run LnMe on the same node as LND. But you can run it anywhere as long as your LND node is accessible. Simply run the binary and make sure the PORT is accessible. -#### Heroku +### Heroku One click deployment with Heroku: You will need your LND address, the LND tls certificate (HEX) and the macaroon (HEX). @@ -118,7 +118,7 @@ You will need your LND address, the LND tls certificate (HEX) and the macaroon ( Here is a [Video Demo of the Heroku deployment](https://www.youtube.com/watch?v=hSFXhnLp_Rc) -#### Notes +### Deployment Notes To run LnMe as systemd service have a look at the [systemd service example config](https://github.com/bumi/lnme/blob/master/examples/lnme.service) @@ -133,6 +133,8 @@ lnme.michaelbumann.com { `$ caddy --config /etc/caddy/Caddyfile` +## Feature Usage + ### Lightning Address The Lightning Address is an Internet Identifier that allows anyone to send you Bitcoin over the Lightning Network. diff --git a/ln/lnd.go b/ln/lnd.go index 663d2b2..a4b39ee 100644 --- a/ln/lnd.go +++ b/ln/lnd.go @@ -46,13 +46,14 @@ type LNDclient struct { } // AddInvoice generates an invoice with the given price and memo. -func (c LNDclient) AddInvoice(value int64, memo string) (Invoice, error) { +func (c LNDclient) AddInvoice(value int64, memo string, descriptionHash []byte) (Invoice, error) { result := Invoice{} - stdOutLogger.Printf("Adding invoice: memo=%s value=%v ", memo, value) + stdOutLogger.Printf("Adding invoice: memo=%s value=%v", memo, value) invoice := lnrpc.Invoice{ - Memo: memo, - Value: value, + Memo: memo, + DescriptionHash: descriptionHash, + Value: value, } res, err := c.lndClient.AddInvoice(c.ctx, &invoice) if err != nil { diff --git a/lnme.go b/lnme.go index 4be8cf0..2910a0f 100644 --- a/lnme.go +++ b/lnme.go @@ -2,7 +2,6 @@ package main import ( "crypto/sha256" - "encoding/hex" "flag" "fmt" "log" @@ -110,7 +109,7 @@ func main() { return c.JSON(http.StatusBadRequest, "Bad request") } - invoice, err := lnClient.AddInvoice(i.Value, i.Memo) + invoice, err := lnClient.AddInvoice(i.Value, i.Memo, nil) if err != nil { stdOutLogger.Printf("Error creating invoice: %s", err) return c.JSON(http.StatusInternalServerError, "Error adding invoice") @@ -167,8 +166,7 @@ func main() { } sats := msats / 1000 // we need sats metadataHash := sha256.Sum256([]byte(lnurlMetadata)) - memo := hex.EncodeToString(metadataHash[:]) - invoice, err := lnClient.AddInvoice(sats, memo) + invoice, err := lnClient.AddInvoice(sats, lightningAddress, metadataHash[:]) lnurlPayResponse2 := lnurl.LNURLPayResponse2{ LNURLResponse: lnurl.LNURLResponse{Status: "OK"}, PR: invoice.PaymentRequest,