Merge pull request #1165 from guggero/lncli-categories

lncli: group commands into categories
This commit is contained in:
Olaoluwa Osuntokun 2018-05-03 15:20:50 -07:00 committed by GitHub
commit a4b2765f83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -91,6 +91,7 @@ func actionDecorator(f func(*cli.Context) error) func(*cli.Context) error {
var newAddressCommand = cli.Command{ var newAddressCommand = cli.Command{
Name: "newaddress", Name: "newaddress",
Category: "Wallet",
Usage: "Generates a new address.", Usage: "Generates a new address.",
ArgsUsage: "address-type", ArgsUsage: "address-type",
Description: ` Description: `
@ -133,7 +134,8 @@ func newAddress(ctx *cli.Context) error {
var sendCoinsCommand = cli.Command{ var sendCoinsCommand = cli.Command{
Name: "sendcoins", Name: "sendcoins",
Usage: "Send bitcoin on-chain to an address", Category: "On-chain",
Usage: "Send bitcoin on-chain to an address.",
ArgsUsage: "addr amt", ArgsUsage: "addr amt",
Description: ` Description: `
Send amt coins in satoshis to the BASE58 encoded bitcoin address addr. Send amt coins in satoshis to the BASE58 encoded bitcoin address addr.
@ -231,6 +233,7 @@ func sendCoins(ctx *cli.Context) error {
var sendManyCommand = cli.Command{ var sendManyCommand = cli.Command{
Name: "sendmany", Name: "sendmany",
Category: "On-chain",
Usage: "Send bitcoin on-chain to multiple addresses.", Usage: "Send bitcoin on-chain to multiple addresses.",
ArgsUsage: "send-json-string [--conf_target=N] [--sat_per_byte=P]", ArgsUsage: "send-json-string [--conf_target=N] [--sat_per_byte=P]",
Description: ` Description: `
@ -288,7 +291,8 @@ func sendMany(ctx *cli.Context) error {
var connectCommand = cli.Command{ var connectCommand = cli.Command{
Name: "connect", Name: "connect",
Usage: "Connect to a remote lnd peer", Category: "Peers",
Usage: "Connect to a remote lnd peer.",
ArgsUsage: "<pubkey>@host", ArgsUsage: "<pubkey>@host",
Flags: []cli.Flag{ Flags: []cli.Flag{
cli.BoolFlag{ cli.BoolFlag{
@ -333,7 +337,8 @@ func connectPeer(ctx *cli.Context) error {
var disconnectCommand = cli.Command{ var disconnectCommand = cli.Command{
Name: "disconnect", Name: "disconnect",
Usage: "Disconnect a remote lnd peer identified by public key", Category: "Peers",
Usage: "Disconnect a remote lnd peer identified by public key.",
ArgsUsage: "<pubkey>", ArgsUsage: "<pubkey>",
Flags: []cli.Flag{ Flags: []cli.Flag{
cli.StringFlag{ cli.StringFlag{
@ -376,6 +381,7 @@ func disconnectPeer(ctx *cli.Context) error {
// TODO(roasbeef): change default number of confirmations // TODO(roasbeef): change default number of confirmations
var openChannelCommand = cli.Command{ var openChannelCommand = cli.Command{
Name: "openchannel", Name: "openchannel",
Category: "Channels",
Usage: "Open a channel to a node or an existing peer.", Usage: "Open a channel to a node or an existing peer.",
Description: ` Description: `
Attempt to open a new channel to an existing peer with the key node-key Attempt to open a new channel to an existing peer with the key node-key
@ -611,6 +617,7 @@ func openChannel(ctx *cli.Context) error {
var closeChannelCommand = cli.Command{ var closeChannelCommand = cli.Command{
Name: "closechannel", Name: "closechannel",
Category: "Channels",
Usage: "Close an existing channel.", Usage: "Close an existing channel.",
Description: ` Description: `
Close an existing channel. The channel can be closed either cooperatively, Close an existing channel. The channel can be closed either cooperatively,
@ -789,6 +796,7 @@ func executeChannelClose(client lnrpc.LightningClient, req *lnrpc.CloseChannelRe
var closeAllChannelsCommand = cli.Command{ var closeAllChannelsCommand = cli.Command{
Name: "closeallchannels", Name: "closeallchannels",
Category: "Channels",
Usage: "Close all existing channels.", Usage: "Close all existing channels.",
Description: ` Description: `
Close all existing channels. Close all existing channels.
@ -1000,6 +1008,7 @@ func promptForConfirmation(msg string) bool {
var listPeersCommand = cli.Command{ var listPeersCommand = cli.Command{
Name: "listpeers", Name: "listpeers",
Category: "Peers",
Usage: "List all active, currently connected peers.", Usage: "List all active, currently connected peers.",
Action: actionDecorator(listPeers), Action: actionDecorator(listPeers),
} }
@ -1021,6 +1030,8 @@ func listPeers(ctx *cli.Context) error {
var createCommand = cli.Command{ var createCommand = cli.Command{
Name: "create", Name: "create",
Category: "Startup",
Usage: "Initialize a wallet when starting lnd for the first time.",
Description: ` Description: `
The create command is used to initialize an lnd wallet from scratch for The create command is used to initialize an lnd wallet from scratch for
the very first time. This is interactive command with one required the very first time. This is interactive command with one required
@ -1293,6 +1304,8 @@ mnemonicCheck:
var unlockCommand = cli.Command{ var unlockCommand = cli.Command{
Name: "unlock", Name: "unlock",
Category: "Startup",
Usage: "Unlock an encrypted wallet at startup.",
Description: ` Description: `
The unlock command is used to decrypt lnd's wallet state in order to The unlock command is used to decrypt lnd's wallet state in order to
start up. This command MUST be run after booting up lnd before it's start up. This command MUST be run after booting up lnd before it's
@ -1357,7 +1370,8 @@ func unlock(ctx *cli.Context) error {
var walletBalanceCommand = cli.Command{ var walletBalanceCommand = cli.Command{
Name: "walletbalance", Name: "walletbalance",
Usage: "Compute and display the wallet's current balance", Category: "Wallet",
Usage: "Compute and display the wallet's current balance.",
Action: actionDecorator(walletBalance), Action: actionDecorator(walletBalance),
} }
@ -1378,7 +1392,9 @@ func walletBalance(ctx *cli.Context) error {
var channelBalanceCommand = cli.Command{ var channelBalanceCommand = cli.Command{
Name: "channelbalance", Name: "channelbalance",
Usage: "Returns the sum of the total available channel balance across all open channels", Category: "Channels",
Usage: "Returns the sum of the total available channel balance across " +
"all open channels.",
Action: actionDecorator(channelBalance), Action: actionDecorator(channelBalance),
} }
@ -1399,7 +1415,7 @@ func channelBalance(ctx *cli.Context) error {
var getInfoCommand = cli.Command{ var getInfoCommand = cli.Command{
Name: "getinfo", Name: "getinfo",
Usage: "Returns basic information related to the active daemon", Usage: "Returns basic information related to the active daemon.",
Action: actionDecorator(getInfo), Action: actionDecorator(getInfo),
} }
@ -1420,7 +1436,8 @@ func getInfo(ctx *cli.Context) error {
var pendingChannelsCommand = cli.Command{ var pendingChannelsCommand = cli.Command{
Name: "pendingchannels", Name: "pendingchannels",
Usage: "Display information pertaining to pending channels", Category: "Channels",
Usage: "Display information pertaining to pending channels.",
Action: actionDecorator(pendingChannels), Action: actionDecorator(pendingChannels),
} }
@ -1442,7 +1459,8 @@ func pendingChannels(ctx *cli.Context) error {
var listChannelsCommand = cli.Command{ var listChannelsCommand = cli.Command{
Name: "listchannels", Name: "listchannels",
Usage: "List all open channels", Category: "Channels",
Usage: "List all open channels.",
Flags: []cli.Flag{ Flags: []cli.Flag{
cli.BoolFlag{ cli.BoolFlag{
Name: "active_only", Name: "active_only",
@ -1490,7 +1508,8 @@ func listChannels(ctx *cli.Context) error {
var sendPaymentCommand = cli.Command{ var sendPaymentCommand = cli.Command{
Name: "sendpayment", Name: "sendpayment",
Usage: "Send a payment over lightning", Category: "Payments",
Usage: "Send a payment over lightning.",
Description: ` Description: `
Send a payment over Lightning. One can either specify the full Send a payment over Lightning. One can either specify the full
parameters of the payment, or just use a payment request which encodes parameters of the payment, or just use a payment request which encodes
@ -1672,7 +1691,8 @@ func sendPaymentRequest(ctx *cli.Context, req *lnrpc.SendRequest) error {
var payInvoiceCommand = cli.Command{ var payInvoiceCommand = cli.Command{
Name: "payinvoice", Name: "payinvoice",
Usage: "Pay an invoice over lightning", Category: "Payments",
Usage: "Pay an invoice over lightning.",
ArgsUsage: "pay_req", ArgsUsage: "pay_req",
Flags: []cli.Flag{ Flags: []cli.Flag{
cli.StringFlag{ cli.StringFlag{
@ -1712,6 +1732,7 @@ func payInvoice(ctx *cli.Context) error {
var addInvoiceCommand = cli.Command{ var addInvoiceCommand = cli.Command{
Name: "addinvoice", Name: "addinvoice",
Category: "Payments",
Usage: "Add a new invoice.", Usage: "Add a new invoice.",
Description: ` Description: `
Add a new invoice, expressing intent for a future payment. Add a new invoice, expressing intent for a future payment.
@ -1845,6 +1866,7 @@ func addInvoice(ctx *cli.Context) error {
var lookupInvoiceCommand = cli.Command{ var lookupInvoiceCommand = cli.Command{
Name: "lookupinvoice", Name: "lookupinvoice",
Category: "Payments",
Usage: "Lookup an existing invoice by its payment hash.", Usage: "Lookup an existing invoice by its payment hash.",
ArgsUsage: "rhash", ArgsUsage: "rhash",
Flags: []cli.Flag{ Flags: []cli.Flag{
@ -1895,6 +1917,7 @@ func lookupInvoice(ctx *cli.Context) error {
var listInvoicesCommand = cli.Command{ var listInvoicesCommand = cli.Command{
Name: "listinvoices", Name: "listinvoices",
Category: "Payments",
Usage: "List all invoices currently stored.", Usage: "List all invoices currently stored.",
Flags: []cli.Flag{ Flags: []cli.Flag{
cli.BoolFlag{ cli.BoolFlag{
@ -1931,9 +1954,10 @@ func listInvoices(ctx *cli.Context) error {
var describeGraphCommand = cli.Command{ var describeGraphCommand = cli.Command{
Name: "describegraph", Name: "describegraph",
Category: "Peers",
Description: "Prints a human readable version of the known channel " + Description: "Prints a human readable version of the known channel " +
"graph from the PoV of the node", "graph from the PoV of the node",
Usage: "Describe the network graph", Usage: "Describe the network graph.",
Flags: []cli.Flag{ Flags: []cli.Flag{
cli.BoolFlag{ cli.BoolFlag{
Name: "render", Name: "render",
@ -2126,7 +2150,8 @@ func drawChannelGraph(graph *lnrpc.ChannelGraph) error {
var listPaymentsCommand = cli.Command{ var listPaymentsCommand = cli.Command{
Name: "listpayments", Name: "listpayments",
Usage: "List all outgoing payments", Category: "Payments",
Usage: "List all outgoing payments.",
Action: actionDecorator(listPayments), Action: actionDecorator(listPayments),
} }
@ -2147,7 +2172,8 @@ func listPayments(ctx *cli.Context) error {
var getChanInfoCommand = cli.Command{ var getChanInfoCommand = cli.Command{
Name: "getchaninfo", Name: "getchaninfo",
Usage: "Get the state of a channel", Category: "Channels",
Usage: "Get the state of a channel.",
Description: "Prints out the latest authenticated state for a " + Description: "Prints out the latest authenticated state for a " +
"particular channel", "particular channel",
ArgsUsage: "chan_id", ArgsUsage: "chan_id",
@ -2194,6 +2220,7 @@ func getChanInfo(ctx *cli.Context) error {
var getNodeInfoCommand = cli.Command{ var getNodeInfoCommand = cli.Command{
Name: "getnodeinfo", Name: "getnodeinfo",
Category: "Peers",
Usage: "Get information on a specific node.", Usage: "Get information on a specific node.",
Description: "Prints out the latest authenticated node state for an " + Description: "Prints out the latest authenticated node state for an " +
"advertised node", "advertised node",
@ -2239,6 +2266,7 @@ func getNodeInfo(ctx *cli.Context) error {
var queryRoutesCommand = cli.Command{ var queryRoutesCommand = cli.Command{
Name: "queryroutes", Name: "queryroutes",
Category: "Payments",
Usage: "Query a route to a destination.", Usage: "Query a route to a destination.",
Description: "Queries the channel router for a potential path to the destination that has sufficient flow for the amount including fees", Description: "Queries the channel router for a potential path to the destination that has sufficient flow for the amount including fees",
ArgsUsage: "dest amt", ArgsUsage: "dest amt",
@ -2313,9 +2341,11 @@ func queryRoutes(ctx *cli.Context) error {
var getNetworkInfoCommand = cli.Command{ var getNetworkInfoCommand = cli.Command{
Name: "getnetworkinfo", Name: "getnetworkinfo",
Usage: "Getnetworkinfo", Category: "Channels",
Description: "Returns a set of statistics pertaining to the known channel " + Usage: "Get statistical information about the current " +
"graph", "state of the network.",
Description: "Returns a set of statistics pertaining to the known " +
"channel graph",
Action: actionDecorator(getNetworkInfo), Action: actionDecorator(getNetworkInfo),
} }
@ -2375,6 +2405,7 @@ func debugLevel(ctx *cli.Context) error {
var decodePayReqCommand = cli.Command{ var decodePayReqCommand = cli.Command{
Name: "decodepayreq", Name: "decodepayreq",
Category: "Payments",
Usage: "Decode a payment request.", Usage: "Decode a payment request.",
Description: "Decode the passed payment request revealing the destination, payment hash and value of the payment request", Description: "Decode the passed payment request revealing the destination, payment hash and value of the payment request",
ArgsUsage: "pay_req", ArgsUsage: "pay_req",
@ -2416,6 +2447,7 @@ func decodePayReq(ctx *cli.Context) error {
var listChainTxnsCommand = cli.Command{ var listChainTxnsCommand = cli.Command{
Name: "listchaintxns", Name: "listchaintxns",
Category: "On-chain",
Usage: "List transactions from the wallet.", Usage: "List transactions from the wallet.",
Description: "List all transactions an address of the wallet was involved in.", Description: "List all transactions an address of the wallet was involved in.",
Action: actionDecorator(listChainTxns), Action: actionDecorator(listChainTxns),
@ -2460,7 +2492,8 @@ func stopDaemon(ctx *cli.Context) error {
var signMessageCommand = cli.Command{ var signMessageCommand = cli.Command{
Name: "signmessage", Name: "signmessage",
Usage: "Sign a message with the node's private key", Category: "Wallet",
Usage: "Sign a message with the node's private key.",
ArgsUsage: "msg", ArgsUsage: "msg",
Description: ` Description: `
Sign msg with the resident node's private key. Sign msg with the resident node's private key.
@ -2503,7 +2536,8 @@ func signMessage(ctx *cli.Context) error {
var verifyMessageCommand = cli.Command{ var verifyMessageCommand = cli.Command{
Name: "verifymessage", Name: "verifymessage",
Usage: "Verify a message signed with the signature", Category: "Wallet",
Usage: "Verify a message signed with the signature.",
ArgsUsage: "msg signature", ArgsUsage: "msg signature",
Description: ` Description: `
Verify that the message was signed with a properly-formed signature Verify that the message was signed with a properly-formed signature
@ -2567,7 +2601,8 @@ func verifyMessage(ctx *cli.Context) error {
var feeReportCommand = cli.Command{ var feeReportCommand = cli.Command{
Name: "feereport", Name: "feereport",
Usage: "Display the current fee policies of all active channels", Category: "Channels",
Usage: "Display the current fee policies of all active channels.",
Description: ` Description: `
Returns the current fee policies of all active channels. Returns the current fee policies of all active channels.
Fee policies can be updated using the updatechanpolicy command.`, Fee policies can be updated using the updatechanpolicy command.`,
@ -2591,7 +2626,9 @@ func feeReport(ctx *cli.Context) error {
var updateChannelPolicyCommand = cli.Command{ var updateChannelPolicyCommand = cli.Command{
Name: "updatechanpolicy", Name: "updatechanpolicy",
Usage: "Update the channel policy for all channels, or a single channel", Category: "Channels",
Usage: "Update the channel policy for all channels, or a single " +
"channel.",
ArgsUsage: "base_fee_msat fee_rate time_lock_delta [channel_point]", ArgsUsage: "base_fee_msat fee_rate time_lock_delta [channel_point]",
Description: ` Description: `
Updates the channel policy for all channels, or just a particular channel Updates the channel policy for all channels, or just a particular channel
@ -2740,10 +2777,11 @@ func updateChannelPolicy(ctx *cli.Context) error {
var forwardingHistoryCommand = cli.Command{ var forwardingHistoryCommand = cli.Command{
Name: "fwdinghistory", Name: "fwdinghistory",
Usage: "Query the history of all forwarded htlcs", Category: "Payments",
Usage: "Query the history of all forwarded HTLCs.",
ArgsUsage: "start_time [end_time] [index_offset] [max_events]", ArgsUsage: "start_time [end_time] [index_offset] [max_events]",
Description: ` Description: `
Query the htlc switch's internal forwarding log for all completed Query the HTLC switch's internal forwarding log for all completed
payment circuits (HTLCs) over a particular time range (--start_time and payment circuits (HTLCs) over a particular time range (--start_time and
--end_time). The start and end times are meant to be expressed in --end_time). The start and end times are meant to be expressed in
seconds since the Unix epoch. If a start and end time aren't provided, seconds since the Unix epoch. If a start and end time aren't provided,