2021-01-19 11:57:16 +03:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/lightningnetwork/lnd/lnrpc/routerrpc"
|
|
|
|
"github.com/urfave/cli"
|
|
|
|
)
|
|
|
|
|
|
|
|
var getCfgCommand = cli.Command{
|
|
|
|
Name: "getmccfg",
|
|
|
|
Usage: "Display mission control's config.",
|
|
|
|
Description: `
|
|
|
|
Returns the config currently being used by mission control.
|
|
|
|
`,
|
|
|
|
Action: actionDecorator(getCfg),
|
|
|
|
}
|
|
|
|
|
|
|
|
func getCfg(ctx *cli.Context) error {
|
2020-07-18 18:46:16 +03:00
|
|
|
ctxc := getContext()
|
2021-01-19 11:57:16 +03:00
|
|
|
conn := getClientConn(ctx, false)
|
|
|
|
defer conn.Close()
|
|
|
|
|
|
|
|
client := routerrpc.NewRouterClient(conn)
|
|
|
|
|
|
|
|
resp, err := client.GetMissionControlConfig(
|
2020-07-18 18:46:16 +03:00
|
|
|
ctxc, &routerrpc.GetMissionControlConfigRequest{},
|
2021-01-19 11:57:16 +03:00
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
printRespJSON(resp)
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|