diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index f72ecadf9..5f1b85146 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -331,3 +331,23 @@ func walletBalance(ctx *cli.Context) error { printRespJson(resp) return nil } + +var GetInfoCommand = cli.Command{ + Name: "getinfo", + Description: "returns basic information related to the active daemon", + Action: getInfo, +} + +func getInfo(ctx *cli.Context) error { + ctxb := context.Background() + client := getClient(ctx) + + req := &lnrpc.GetInfoRequest{} + resp, err := client.GetInfo(ctxb, req) + if err != nil { + return err + } + + printRespJson(resp) + return nil +} diff --git a/cmd/lncli/main.go b/cmd/lncli/main.go index e997cc5de..45917c118 100644 --- a/cmd/lncli/main.go +++ b/cmd/lncli/main.go @@ -57,6 +57,7 @@ func main() { ListPeersCommand, WalletBalanceCommand, ShellCommand, + GetInfoCommand, } if err := app.Run(os.Args); err != nil {