cmd/lncli: add new getdebuginfo command

This commit is contained in:
Oliver Gugger 2023-11-15 21:20:29 -06:00
parent 8a2c3a3d85
commit 375bc6950c
No known key found for this signature in database
GPG Key ID: 8E4256593F177720
2 changed files with 30 additions and 0 deletions

29
cmd/lncli/cmd_debug.go Normal file
View File

@ -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
}

View File

@ -459,6 +459,7 @@ func main() {
walletBalanceCommand,
channelBalanceCommand,
getInfoCommand,
getDebugInfoCommand,
getRecoveryInfoCommand,
pendingChannelsCommand,
sendPaymentCommand,