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,