loop: client calls getInfo rpc

pull/586/head
Slyghtning 11 months ago
parent 043f780198
commit 84bf30301f

@ -0,0 +1,36 @@
package main
import (
"context"
"github.com/lightninglabs/loop/looprpc"
"github.com/urfave/cli"
)
var getInfoCommand = cli.Command{
Name: "getinfo",
Usage: "show general information about the loop daemon",
Description: "Displays general information about the daemon like " +
"current version, connection parameters and basic swap " +
"information.",
Action: getInfo,
}
func getInfo(ctx *cli.Context) error {
client, cleanup, err := getClient(ctx)
if err != nil {
return err
}
defer cleanup()
cfg, err := client.GetInfo(
context.Background(), &looprpc.GetInfoRequest{},
)
if err != nil {
return err
}
printRespJSON(cfg)
return nil
}

@ -153,6 +153,7 @@ func main() {
monitorCommand, quoteCommand, listAuthCommand,
listSwapsCommand, swapInfoCommand, getLiquidityParamsCommand,
setLiquidityRuleCommand, suggestSwapCommand, setParamsCommand,
getInfoCommand,
}
err := app.Run(os.Args)

Loading…
Cancel
Save