Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
lnd
✓ github.com/lightningnetwork/lnd
Connect to a local LND node and fetch node info via gRPC.
package main
import (
"context"
"fmt"
"github.com/lightningnetwork/lnd/lnrpc"
"google.golang.org/grpc"
)
func main() {
conn, err := grpc.Dial("localhost:10009", grpc.WithInsecure())
if err != nil {
panic(err)
}
defer conn.Close()
client := lnrpc.NewLightningClient(conn)
info, err := client.GetInfo(context.Background(), &lnrpc.GetInfoRequest{})
if err != nil {
panic(err)
}
fmt.Printf("Node: %s\n", info.IdentityPubkey)
}
Upgrade
Version history
0.0.2latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.