rpc+cli: add general ListAliases function to dump all aliases

This commit is contained in:
eugene
2022-07-14 13:51:48 -04:00
parent 48f270fe20
commit aa576adecc
11 changed files with 1574 additions and 1084 deletions

View File

@@ -1419,6 +1419,31 @@ var listChannelsCommand = cli.Command{
Action: actionDecorator(listChannels),
}
var listAliasesCommand = cli.Command{
Name: "listaliases",
Category: "Channels",
Usage: "List all aliases.",
Flags: []cli.Flag{},
Action: actionDecorator(listaliases),
}
func listaliases(ctx *cli.Context) error {
ctxc := getContext()
client, cleanUp := getClient(ctx)
defer cleanUp()
req := &lnrpc.ListAliasesRequest{}
resp, err := client.ListAliases(ctxc, req)
if err != nil {
return err
}
printRespJSON(resp)
return nil
}
func listChannels(ctx *cli.Context) error {
ctxc := getContext()
client, cleanUp := getClient(ctx)