mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 09:53:54 +01:00
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)
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user