File tree 2 files changed +37
-0
lines changed
2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import (
4
+ "context"
5
+
6
+ "github.com/lightninglabs/loop/looprpc"
7
+ "github.com/urfave/cli"
8
+ )
9
+
10
+ var getInfoCommand = cli.Command {
11
+ Name : "getinfo" ,
12
+ Usage : "show general information about the loop daemon" ,
13
+ Description : "Displays general information about the daemon like " +
14
+ "current version, connection parameters and basic swap " +
15
+ "information." ,
16
+ Action : getInfo ,
17
+ }
18
+
19
+ func getInfo (ctx * cli.Context ) error {
20
+ client , cleanup , err := getClient (ctx )
21
+ if err != nil {
22
+ return err
23
+ }
24
+ defer cleanup ()
25
+
26
+ cfg , err := client .GetInfo (
27
+ context .Background (), & looprpc.GetInfoRequest {},
28
+ )
29
+ if err != nil {
30
+ return err
31
+ }
32
+
33
+ printRespJSON (cfg )
34
+
35
+ return nil
36
+ }
Original file line number Diff line number Diff line change @@ -153,6 +153,7 @@ func main() {
153
153
monitorCommand , quoteCommand , listAuthCommand ,
154
154
listSwapsCommand , swapInfoCommand , getLiquidityParamsCommand ,
155
155
setLiquidityRuleCommand , suggestSwapCommand , setParamsCommand ,
156
+ getInfoCommand ,
156
157
}
157
158
158
159
err := app .Run (os .Args )
You can’t perform that action at this time.
0 commit comments