rpc+cli: add general ListAliases function to dump all aliases
This commit is contained in:
11 files changed
+1574
-1084
No files matched your search
@@ -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)
|
||||
|
||||
@@ -414,6 +414,7 @@ func main() {
|
||||
sendCustomCommand,
|
||||
subscribeCustomCommand,
|
||||
fishCompletionCommand,
|
||||
listAliasesCommand,
|
||||
}
|
||||
|
||||
// Add any extra commands determined by build flags.
|
||||
|
||||
Reference in new issue
Block a user