Since we're now able to create a base LND directory that no longer lives
under the OS specific application data directory, we modify
cleanAndExpandPath to replace the `~` in a path to the current user's
home directory, rather than the user's application data directory.
In this commit, we introduce a new flag `--lnddir` that allows us to
set a different base directory, other than the OS specific application
data directory, for all related lnd files and directories.
In this commit, we add a new closeallchannels command to lncli. This
command allows us to close all existing active and inactive channels
by closing them cooperatively or unilaterally, respectively.
In this commit, we extend the `lncli create` command to allow users to
specify their own side (if they want). In the case that the user
*doesn’t* specify their own seed, we’ll return the entropy generated by
the wallet in a 24-word mnemonic format for easy backup.
With this change, it’s now possible for users to restore an existing lnd
wallet seed.
This commit reworks the macaroon authentication framework to use the
v2 macaroon format and bakery API. It also replaces the code in each
RPC method which calls the macaroon verifier with interceptors which
call the macaroon verifier instead. In addition, the operation
permissions are reworked to fit the new format of "allow" commands
(specifically, entity/operation permissions instead of method
permissions).
Since a ChannelPoint's funding txid can now be get/set as raw bytes or
a string, we first need to check what type it's currently set to before
accessing it.
In this commit we rename the lnrpc.PendingChannelRequest and
lnrpc.PendingChannelResponse to
lnrpc.PendingChannelsRequest/lnrpc.PendingChannelsResponse. We do this
as we strive to ensure that the naming scheme across the RPC interface
is consistent.
Early in the lifetime of the project here were a few files we either
copied entirely, or used as the basis for code within lnd. Before this
PR, this was not recognized by retaining the original copyright. With
this commit, we remedy that by explicitly noting the copyright in the
relevant files.
Fixes#423.
In this commit, we expose the new fee control features to the relevant
commands on the command line. This will allow users to have a greater
degree of control of the fees they pay when: sending coins on chain,
opening a channel, or closing a channel.
This commit adds a decorator that will inspect the
error from an command action, and prints an encrypted
wallet help text if the error has status code Unimplemented.
This is done to help a user that is trying to issue
lncli commands before unlocking the wallet, since
the RPC server won't be active and every call will
return this status code.
lncli create:
This command is used to set up a wallet encryption password for
use with lnd at first time use. It will ask fot the user to
confirm the chosen password, then do a call to the lnd RPC method
CreateWallet with the chosen password.
lncli unlock:
This command is used to unlock the wallet of a running lnd instance.
It calls the RPC method UnlockWallet with the provided password.
Both methods makes use of the terminal.ReadPassword method, to
securely read a password from user input without making it
replayable in the terminal.
In this commit, we extend the help message for `newaddress`
to indicate which address types can be used when directly
funding channels. Additionally, we add some additional text
to the insufficient funding error to detail that we don't have
enough witness outputs.
The new BOLT-11 compliant zpay32 package offers a few new
available options when creating invoices. This commit adds
those options to lncli, such that callers can specify these
when creating payment requests.
This commit adds simple non-blocking stop command to lncli, with an
appropriate proto update and implementation within the rpcserver. When
invoked the interrupt handler routine in signal.go with begin the graceful
shutdown of lnd.
It was noticed by 21E14 on Github that when we fall back to using
golang’s encoding/json lib in special cases when printing the proto
responses in JSON form, the value printed lacked a new-line at the end.
This would cause the output to flow into bash prompts.
This issue has been fixed by simply appending a newline character to
the end of the formatted JSON output.
Fixes#160.
This commit fixes a minor bug that was introduced with the latest PR
that made specifying the —push_amt flag when opening a channel
mandatory. The fix is simple, turn the switch statement into an
if/else, which makes the —push_amt flag optional once again.
This commit updates the command line help for several commands within
cmd/lncli to be more uniform, and also use the proper attributes within
the urfave/cli project. Additionally, in several areas cli.Int was using
used instead of cli.Int64 when parsing satoshis. This oversight has been
rectified by modifying all incorrect occurrences.
Finally, this commit, as its central contribution, adds the ability to mix
and match positional arguments with key-word arguments for several
commands! The following commands can now be used with either only
positional arguments, only key-word arguments, or a mix of both when
applicable:
* openchannel
* closechannel
* sendpayment
* getnodeinfo
* getchaninfo
* newaddress
* sendcoins
* sendmany
* connect
* addinvoice
* lookupinvoice
* queryroute
The set of changes outlined above should make command line tinkering with
`lnd` a bit more streamlined, yet still very flexible.
This commit modifies the behavior for the commands which open and close
channels on the command line. Previsouly a user needed to use the
`—block` flag in order to get information about any possible errors or
the full progress of a request. This commit alters the behavior
slightly to block until the _first_ message or error is returned from
the gRPC stream.
With this change, the command line usage has a better UX as users
instantly get more information without having to peer into the logs.
This commit uses protobuf’s jsonpb library rather than the built-in
json/encoding library to print the JSOn representation of the responses
from gRPC. By using this library, we are now able to properly display
any values from the response which are “non-truthy” (0, false, etc).
This commit removes the prior work around to display a prefix of the
node’s public key as a vertex. It turns out that if you quote the
string, the it will escape all characters enclosed. This allows us the
drop the hacky “Z” prefix that we used before.
This commit adds an ability to render the channel graph as returned by
the ‘displaygraph’ command. The rendering of the graph itself is
carried about the by the ‘dot’ command which eventually calls out to
graphviz.
Currently the graph is always saved to the same file in the local
directory, but in a later commit the location of the file will be made
configurable.
Finally, the attributes sent to the ‘dot’ command used to render the
graph are still a bit in flux. The parameters will likely be tuned once
the channel graph on testnet grows a bit more.
This commit implements the newly added RPC to decode payment requests
passed over the command line or directly via gRPC.
With this tool, users can now examine payment requests they see in the
wild for diagnostic or debugging purposes.