cmd/lncli: implement cli "getting" call

This commit is contained in:
Olaoluwa Osuntokun 2016-07-05 18:58:41 -07:00
parent c5cc96a524
commit 4d7bd2eb5d
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2
2 changed files with 21 additions and 0 deletions

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

@ -57,6 +57,7 @@ func main() {
ListPeersCommand,
WalletBalanceCommand,
ShellCommand,
GetInfoCommand,
}
if err := app.Run(os.Args); err != nil {