From 375bc6950c649678621e920d3c09aee5294aa101 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Wed, 15 Nov 2023 21:20:29 -0600 Subject: [PATCH] cmd/lncli: add new getdebuginfo command --- cmd/lncli/cmd_debug.go | 29 +++++++++++++++++++++++++++++ cmd/lncli/main.go | 1 + 2 files changed, 30 insertions(+) create mode 100644 cmd/lncli/cmd_debug.go diff --git a/cmd/lncli/cmd_debug.go b/cmd/lncli/cmd_debug.go new file mode 100644 index 000000000..c114dc9c0 --- /dev/null +++ b/cmd/lncli/cmd_debug.go @@ -0,0 +1,29 @@ +package main + +import ( + "github.com/lightningnetwork/lnd/lnrpc" + "github.com/urfave/cli" +) + +var getDebugInfoCommand = cli.Command{ + Name: "getdebuginfo", + Category: "Debug", + Usage: "Returns debug information related to the active daemon.", + Action: actionDecorator(getDebugInfo), +} + +func getDebugInfo(ctx *cli.Context) error { + ctxc := getContext() + client, cleanUp := getClient(ctx) + defer cleanUp() + + req := &lnrpc.GetDebugInfoRequest{} + resp, err := client.GetDebugInfo(ctxc, req) + if err != nil { + return err + } + + printRespJSON(resp) + + return nil +} diff --git a/cmd/lncli/main.go b/cmd/lncli/main.go index 8aeb904e8..801cb7562 100644 --- a/cmd/lncli/main.go +++ b/cmd/lncli/main.go @@ -459,6 +459,7 @@ func main() { walletBalanceCommand, channelBalanceCommand, getInfoCommand, + getDebugInfoCommand, getRecoveryInfoCommand, pendingChannelsCommand, sendPaymentCommand,