Skip to content

Commit

Permalink
feat: added ability to specify hostname and port (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
ardevd authored Jan 10, 2024
1 parent 91c1a82 commit 28443cb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmd/flash/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func main() {
adminMacaroon := flag.String("m", "", "Admin Macaroon")
authFile := flag.String("a", "", "Authentication file")
encKey := flag.String("k", "", "Encryption key")
rpcServerAddress := flag.String("h", "", "RPC hostname:port")
flag.Parse()

if *tlsCertFile != "" && *adminMacaroon != "" {
Expand All @@ -31,6 +32,10 @@ func main() {
return
}

if *rpcServerAddress == "" {
log.Fatal("No RPC hostname specified.")
}

var tlsData []byte
var macData []byte
if *authFile != "" && *encKey != "" {
Expand All @@ -39,12 +44,9 @@ func main() {
logger.Fatal("Auth file and encryption key required for node connection, alternatively generate them first with -a and -c")
}

// Replace these variables with your actual RPC credentials and endpoint.
rpcServerAddress := "localhost:8888"

// Create a new gRPC client using the provided credentials.
config := lndclient.LndServicesConfig{
LndAddress: rpcServerAddress,
LndAddress: *rpcServerAddress,
Network: lndclient.NetworkMainnet,
CustomMacaroonHex: hex.EncodeToString(macData),
TLSData: string(tlsData),
Expand Down

0 comments on commit 28443cb

Please sign in to comment.