Skip to content

Commit

Permalink
cmd/lncli: add new getdebuginfo command
Browse files Browse the repository at this point in the history
  • Loading branch information
guggero committed Jan 9, 2024
1 parent 8a2c3a3 commit 375bc69
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions cmd/lncli/cmd_debug.go
Original file line number Diff line number Diff line change
@@ -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
}
1 change: 1 addition & 0 deletions cmd/lncli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ func main() {
walletBalanceCommand,
channelBalanceCommand,
getInfoCommand,
getDebugInfoCommand,
getRecoveryInfoCommand,
pendingChannelsCommand,
sendPaymentCommand,
Expand Down

0 comments on commit 375bc69

Please sign in to comment.