8f5d78c875
This commit swaps out golang/protobuf/jsonpb for a custom variant that by default prints byte slices as hex, which is more useful for our setting. Some existing wrapper structs are removed as they can now be printed directly with the new jsonpb. !!! NOTE !!! This commit introduces a breaking change to lncli listinvoices since payment hashes and preimages will now be printed in hex instead of base64.
37 lines
698 B
Go
37 lines
698 B
Go
// +build routerrpc
|
|
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/lightningnetwork/lnd/lnrpc/routerrpc"
|
|
|
|
"github.com/urfave/cli"
|
|
)
|
|
|
|
var queryMissionControlCommand = cli.Command{
|
|
Name: "querymc",
|
|
Category: "Payments",
|
|
Usage: "Query the internal mission control state.",
|
|
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
|
|
}
|