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

This commit is contained in:
eugene committed 2022-08-09 14:11:08 -04:00
1 parent 48f270fe20
commit aa576adecc
11 files changed
+1574 -1084

No files matched your search

+25
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)
+1
View File
@@ -414,6 +414,7 @@ func main() {
sendCustomCommand,
subscribeCustomCommand,
fishCompletionCommand,
listAliasesCommand,
}
// Add any extra commands determined by build flags.