Skip to content
This repository has been archived by the owner on Jul 23, 2023. It is now read-only.

Commit

Permalink
modularize invoicewithdescriptionhash method, still keep it on sparko.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Oct 3, 2020
1 parent dde1cb7 commit f607b86
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dist: $(shell find . -name "*.go") spark-wallet/client/dist
go-bindata -prefix spark-wallet/client/dist-o bindata.go spark-wallet/client/dist/...
go-bindata -prefix spark-wallet/client/dist -o bindata.go spark-wallet/client/dist/...
mkdir -p dist
gox -ldflags="-s -w" -osarch="darwin/amd64 linux/386 linux/amd64 linux/arm freebsd/amd64" -output="dist/sparko_{{.OS}}_{{.Arch}}"

Expand Down
6 changes: 6 additions & 0 deletions invoicewithdescriptionhash/cmd/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist: $(shell find . -name "*.go")
mkdir -p dist
gox -ldflags="-s -w" -osarch="darwin/amd64 linux/386 linux/amd64 linux/arm freebsd/amd64" -output="dist/invoicewithdescriptionhash_{{.OS}}_{{.Arch}}"

invoicewithdescriptionhash: $(shell find . -name "*.go")
go build -o ./invoicewithdescriptionhash
18 changes: 18 additions & 0 deletions invoicewithdescriptionhash/cmd/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package main

import (
"github.com/fiatjaf/lightningd-gjson-rpc/plugin"
"github.com/fiatjaf/sparko/invoicewithdescriptionhash"
)

func main() {
p := plugin.Plugin{
Name: "invoicewithdescriptionhash",
Version: "v1.0",
Options: []plugin.Option{},
RPCMethods: []plugin.RPCMethod{
invoicewithdescriptionhash.InvoiceWithDescriptionHashMethod,
},
}
p.Run()
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package invoicewithdescriptionhash

import (
"encoding/hex"
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/NYTimes/gziphandler"
assetfs "github.com/elazarl/go-bindata-assetfs"
"github.com/fiatjaf/lightningd-gjson-rpc/plugin"
"github.com/fiatjaf/sparko/invoicewithdescriptionhash"
"github.com/gorilla/mux"
"github.com/gorilla/securecookie"
"github.com/rs/cors"
Expand Down Expand Up @@ -40,7 +41,7 @@ func main() {
},
RPCMethods: []plugin.RPCMethod{
// just a useful helper
InvoiceWithDescriptionHashMethod,
invoicewithdescriptionhash.InvoiceWithDescriptionHashMethod,

// required by spark-wallet
connectFund,
Expand Down

0 comments on commit f607b86

Please sign in to comment.