mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-19 18:48:03 +01:00
rpc+cli: add general ListAliases function to dump all aliases
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user