cmd/lncli: implement cli "getting" call
This commit is contained in:
2 files changed
+21
No files matched your search
@@ -331,3 +331,23 @@ func walletBalance(ctx *cli.Context) error {
|
|||||||
printRespJson(resp)
|
printRespJson(resp)
|
||||||
return nil
|
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
|
||||||
|
}
|
||||||
@@ -57,6 +57,7 @@ func main() {
|
|||||||
ListPeersCommand,
|
ListPeersCommand,
|
||||||
WalletBalanceCommand,
|
WalletBalanceCommand,
|
||||||
ShellCommand,
|
ShellCommand,
|
||||||
|
GetInfoCommand,
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := app.Run(os.Args); err != nil {
|
if err := app.Run(os.Args); err != nil {
|
||||||
|
|||||||
Reference in new issue
Block a user