File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ func main() {
7272 }
7373 app .Commands = append (app .Commands , sessionCommands ... )
7474 app .Commands = append (app .Commands , accountsCommands ... )
75+ app .Commands = append (app .Commands , statusCommands ... )
7576
7677 err := app .Run (os .Args )
7778 if err != nil {
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import (
4+ "context"
5+
6+ "github.com/lightninglabs/lightning-terminal/litrpc"
7+ "github.com/urfave/cli"
8+ )
9+
10+ var statusCommands = []cli.Command {
11+ {
12+ Name : "status" ,
13+ Usage : "info about litd status" ,
14+ Category : "Status" ,
15+ Action : getStatus ,
16+ },
17+ }
18+
19+ func getStatus (ctx * cli.Context ) error {
20+ clientConn , cleanup , err := connectClient (ctx )
21+ if err != nil {
22+ return err
23+ }
24+ defer cleanup ()
25+ client := litrpc .NewStatusClient (clientConn )
26+
27+ ctxb := context .Background ()
28+ resp , err := client .GetSubServerState (
29+ ctxb , & litrpc.GetSubServerStatusReq {},
30+ )
31+ if err != nil {
32+ return err
33+ }
34+
35+ printRespJSON (resp )
36+
37+ return nil
38+ }
You can’t perform that action at this time.
0 commit comments