cmd/lncli: implement cli "getting" call
This commit is contained in:
parent
c5cc96a524
commit
4d7bd2eb5d
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user