1
0
mirror of https://github.com/nbd-wtf/satdress.git synced 2024-09-23 01:20:34 +00:00

adapt to new makeinvoice which fully supports updated CLN and commando.

This commit is contained in:
fiatjaf 2022-07-20 15:05:14 -03:00
parent dadd45cf08
commit 37a104729c
4 changed files with 7 additions and 8 deletions

View File

@ -2,6 +2,6 @@ satdress: $(shell find . -name "*.go") $(shell find . -name "*.html") $(shell fi
CC=$$(which musl-gcc) go build -ldflags='-s -w -linkmode external -extldflags "-static"' -o ./satdress CC=$$(which musl-gcc) go build -ldflags='-s -w -linkmode external -extldflags "-static"' -o ./satdress
deploy: satdress deploy: satdress
ssh root@turgot 'systemctl stop bitmia tinytip payaddress paymentlink' ssh root@turgot 'systemctl stop payaddress'
scp satdress turgot:satdress/satdress scp satdress turgot:satdress/satdress
ssh root@turgot 'systemctl start bitmia tinytip payaddress paymentlink' ssh root@turgot 'systemctl start payaddress'

2
go.mod
View File

@ -5,7 +5,7 @@ go 1.16
require ( require (
github.com/cockroachdb/pebble v0.0.0-20210812144839-61318a019370 github.com/cockroachdb/pebble v0.0.0-20210812144839-61318a019370
github.com/fiatjaf/go-lnurl v1.4.0 github.com/fiatjaf/go-lnurl v1.4.0
github.com/fiatjaf/makeinvoice v1.4.0 github.com/fiatjaf/makeinvoice v1.5.1
github.com/gorilla/mux v1.8.0 github.com/gorilla/mux v1.8.0
github.com/kelseyhightower/envconfig v1.4.0 github.com/kelseyhightower/envconfig v1.4.0
github.com/lib/pq v1.10.3 github.com/lib/pq v1.10.3

4
go.sum
View File

@ -220,8 +220,8 @@ github.com/fiatjaf/lightningd-gjson-rpc v1.4.0 h1:Iv5tt4YuNoSMfR39wiV0tqnHYTJ85o
github.com/fiatjaf/lightningd-gjson-rpc v1.4.0/go.mod h1:SQGA0qcY2qypaMXDQlE5V5+2MnLZzQ7NzfRsScliFeE= github.com/fiatjaf/lightningd-gjson-rpc v1.4.0/go.mod h1:SQGA0qcY2qypaMXDQlE5V5+2MnLZzQ7NzfRsScliFeE=
github.com/fiatjaf/ln-decodepay v1.0.0 h1:1YUMjvLock+BicMNwoZ/OA3oG2ZYEaJ8AzdS6EGVMTQ= github.com/fiatjaf/ln-decodepay v1.0.0 h1:1YUMjvLock+BicMNwoZ/OA3oG2ZYEaJ8AzdS6EGVMTQ=
github.com/fiatjaf/ln-decodepay v1.0.0/go.mod h1:/LWK+ZUa3i8MqbRjIMAiVQS2+NbhwKWlwib2n446cMQ= github.com/fiatjaf/ln-decodepay v1.0.0/go.mod h1:/LWK+ZUa3i8MqbRjIMAiVQS2+NbhwKWlwib2n446cMQ=
github.com/fiatjaf/makeinvoice v1.4.0 h1:lXae4tbEYQvjepZDO84xb0Lo+EkUe+KAAwO89rJAlRM= github.com/fiatjaf/makeinvoice v1.5.1 h1:mVkIjm7dcvkwgAVJeCbk12F1BDtedHNN4qDKPRQJoYc=
github.com/fiatjaf/makeinvoice v1.4.0/go.mod h1:ifTgHnXswV6LE21YBXKNAMC5g0wox6m1t1tT+O3dQiw= github.com/fiatjaf/makeinvoice v1.5.1/go.mod h1:ifTgHnXswV6LE21YBXKNAMC5g0wox6m1t1tT+O3dQiw=
github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA= github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA=
github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNyAWIKUMIwqxEtgHOs5c= github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNyAWIKUMIwqxEtgHOs5c=
github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=

View File

@ -1,7 +1,6 @@
package main package main
import ( import (
"crypto/sha256"
"fmt" "fmt"
"strconv" "strconv"
"time" "time"
@ -75,8 +74,8 @@ func makeInvoice(
mip.Description = fmt.Sprintf("%s's PIN for '%s@%s' lightning address: %s", params.Domain, params.Name, params.Domain, *pin) mip.Description = fmt.Sprintf("%s's PIN for '%s@%s' lightning address: %s", params.Domain, params.Name, params.Domain, *pin)
} else { } else {
// make the lnurlpay description_hash // make the lnurlpay description_hash
h := sha256.Sum256([]byte(makeMetadata(params))) mip.Description = makeMetadata(params)
mip.DescriptionHash = h[:] mip.UseDescriptionHash = true
} }
// actually generate the invoice // actually generate the invoice