Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds querymc command to lncli to dump mission control state.
- Loading branch information
1 parent
5b53df0
commit ae2bdfd
Showing
4 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// +build routerrpc | ||
|
||
package main | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/lightningnetwork/lnd/lnrpc/routerrpc" | ||
|
||
"github.com/urfave/cli" | ||
) | ||
|
||
var queryMissionControlCommand = cli.Command{ | ||
Name: "querymc", | ||
Category: "Payments", | ||
Action: actionDecorator(queryMissionControl), | ||
} | ||
|
||
func queryMissionControl(ctx *cli.Context) error { | ||
conn := getClientConn(ctx, false) | ||
defer conn.Close() | ||
|
||
client := routerrpc.NewRouterClient(conn) | ||
|
||
req := &routerrpc.QueryMissionControlRequest{} | ||
rpcCtx := context.Background() | ||
snapshot, err := client.QueryMissionControl(rpcCtx, req) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
printRespJSON(snapshot) | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// +build routerrpc | ||
|
||
package main | ||
|
||
import "github.com/urfave/cli" | ||
|
||
// routerCommands will return nil for non-routerrpc builds. | ||
func routerCommands() []cli.Command { | ||
return []cli.Command{queryMissionControlCommand} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// +build !routerrpc | ||
|
||
package main | ||
|
||
import "github.com/urfave/cli" | ||
|
||
// routerCommands will return nil for non-routerrpc builds. | ||
func routerCommands() []cli.Command { | ||
return nil | ||
} |