2019-05-10 11:39:16 +03:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/lightningnetwork/lnd/lnrpc/routerrpc"
|
|
|
|
|
|
|
|
"github.com/urfave/cli"
|
|
|
|
)
|
|
|
|
|
|
|
|
var queryMissionControlCommand = cli.Command{
|
|
|
|
Name: "querymc",
|
|
|
|
Category: "Payments",
|
2019-06-19 10:20:58 +03:00
|
|
|
Usage: "Query the internal mission control state.",
|
2019-05-10 11:39:16 +03:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2019-12-20 12:05:08 +03:00
|
|
|
printRespJSON(snapshot)
|
2019-05-10 11:39:16 +03:00
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|