use cln plugin wrapper in interceptor

This commit is contained in:
Jesse de Wit
2022-12-23 18:22:59 +01:00
parent 36c7f5f616
commit 5922b7e73d
5 changed files with 265 additions and 101 deletions

View File

@@ -4,6 +4,7 @@ import (
"encoding/hex"
"fmt"
"log"
"os"
"github.com/breez/lspd/basetypes"
"github.com/btcsuite/btcd/chaincfg/chainhash"
@@ -23,7 +24,9 @@ var (
CLOSED_STATUSES = []string{"CLOSED"}
)
func NewClnClient(rpcFile string, lightningDir string) *ClnClient {
func NewClnClient() *ClnClient {
rpcFile := os.Getenv("CLN_SOCKET_NAME")
lightningDir := os.Getenv("CLN_SOCKET_DIR")
client := glightning.NewLightning()
client.SetTimeout(60)
client.StartUp(rpcFile, lightningDir)