Commit Graph

564 Commits

Author SHA1 Message Date
carla
4c48d0361d
lnrpc+lncli: display peer errors in listpeers
This change adds a set of errors to the peer struct returned by list
peers. A latest error boolean is added to allow for more succinct
default lncli responses.
2020-03-17 08:22:50 +02:00
Johan T. Halseth
7d305fdc46
lnrpc: add commitment_type to listchannels 2020-03-13 20:00:48 +01:00
carla
0a5b918db2
routerrpc: add htlcnotifier subscription 2020-03-13 09:47:19 +02:00
carla
aa70d5d02a
routerrpc: add quit channel to signal shutdown 2020-03-13 09:36:39 +02:00
carla
67d4bad73f
rpcserver+routerrpc: add subscribe events to router backend
Add SubscribeHtlcEvents to RouterBackend in preparation for the
addition of a HtlcNotifier stream.
2020-03-13 09:30:16 +02:00
Oliver Gugger
10e247540f
watchtowerrpc: fix typo 2020-03-10 20:19:21 +01:00
Oliver Gugger
1e1b68accf
lnrpc: update README to describe new commands 2020-03-10 20:19:20 +01:00
Oliver Gugger
fdcb30e57f
lnrpc: run clang-format 2020-03-10 20:19:08 +01:00
Conner Fromknecht
7a1013fb9e
make+travis: verify compiled protos on travis 2020-03-10 13:03:01 +01:00
Joost Jager
c0cb05d7b4
lnrpc: expose raw htlc failure
Adds a new rpc field to the payment htlc proto message and populates it
with data that is now stored in the db.
2020-03-09 18:31:41 +01:00
Joost Jager
e6e9e44e6f
routerrpc: extract wire error marshalling
Preparation for marshalling wire errors as part of rpc payment lookups.
2020-03-09 11:43:36 +01:00
Joost Jager
3f5ba35dea
routerrpc: move marshall functions out of conditionally compiled file
These functions will (indirectly) be called by the main rpc server and
can no longer stay conditionally compiled.
2020-03-09 11:43:34 +01:00
Joost Jager
6aab6c0bac
routerrpc+lnrpc: move htlc failure messages
In a later commit, htlc raw failure messages will be exposed through the
main rpc. This is a preparation for that.
2020-03-09 11:43:32 +01:00
Oliver Gugger
9aff896b10
lnrpc+rpcserver+lncli: rename RPC fields to previous JSON name 2020-03-07 11:24:13 +01:00
Oliver Gugger
3a5348ea8b
wtclientrpc: format wtclient.proto and remove json_name fields
We now use the jsonpb marshaler to convert the RPC responses to
JSON in lncli and REST. The jsonpb has a setting to use the
original name as defined in the proto file and the explicit
json_name definition is not necessary any more.
The jsonpb setting is called OrigName and needs to be true.
2020-03-07 11:23:09 +01:00
Oliver Gugger
ad0fba548f
watchtowerrpc: format watchtower.proto and remove json_name fields
We now use the jsonpb marshaler to convert the RPC responses to
JSON in lncli and REST. The jsonpb has a setting to use the
original name as defined in the proto file and the explicit
json_name definition is not necessary any more.
The jsonpb setting is called OrigName and needs to be true.
2020-03-07 11:23:09 +01:00
Oliver Gugger
54fede0ae9
walletrpc: format walletkit.proto and remove json_name fields
We now use the jsonpb marshaler to convert the RPC responses to
JSON in lncli and REST. The jsonpb has a setting to use the
original name as defined in the proto file and the explicit
json_name definition is not necessary any more.
The jsonpb setting is called OrigName and needs to be true.
2020-03-07 11:23:08 +01:00
Oliver Gugger
5a35ffa395
signrpc: format signer.proto 2020-03-07 11:23:08 +01:00
Oliver Gugger
1b543f0d50
routerrpc: format router.proto and remove json_name fields
We now use the jsonpb marshaler to convert the RPC responses to
JSON in lncli and REST. The jsonpb has a setting to use the
original name as defined in the proto file and the explicit
json_name definition is not necessary any more.
The jsonpb setting is called OrigName and needs to be true.
2020-03-07 11:23:07 +01:00
Oliver Gugger
5a6fea31d9
invoicesrpc: format invoices.proto and remove json_name fields
We now use the jsonpb marshaler to convert the RPC responses to
JSON in lncli and REST. The jsonpb has a setting to use the
original name as defined in the proto file and the explicit
json_name definition is not necessary any more.
The jsonpb setting is called OrigName and needs to be true.
2020-03-07 11:23:07 +01:00
Oliver Gugger
23f5472cd3
chainrpc: format chainnotifier.proto 2020-03-07 11:23:06 +01:00
Oliver Gugger
bcfe92cee1
autopilotrpc: format autopilot.proto and remove json_name fields
We now use the jsonpb marshaler to convert the RPC responses to
JSON in lncli and REST. The jsonpb has a setting to use the
original name as defined in the proto file and the explicit
json_name definition is not necessary any more.
The jsonpb setting is called OrigName and needs to be true.
2020-03-07 11:23:06 +01:00
Oliver Gugger
b99a457dd0
lnrpc: format rpc.proto and remove json_name fields
We now use the jsonpb marshaler to convert the RPC responses to
JSON in lncli and REST. The jsonpb has a setting to use the
original name as defined in the proto file and the explicit
json_name definition is not necessary any more.
The jsonpb setting is called OrigName and needs to be true.
2020-03-07 11:23:06 +01:00
Conner Fromknecht
11532df5f3
cmd/lncli: add --peer flag to list channels
This commit adds a flag to listchannels that filters by remote pubkey.
2020-03-05 20:44:18 -08:00
Conner Fromknecht
5c9b336a61
lnrpc+rpcserver: expose short chan id on feereport
This commit adds each channel's short chan id to the `feereport` rpc.
Without this, it can be tedious to lookup more info about a particular
channel since most rpcs only accept short chan ids and not channel
points. For instance, now one can take a channel id from `feereport` and
look it up directly via `getchaninfo` to examine the policy in more
detail.
2020-03-04 15:37:17 -08:00
carla
b55470e9a9
lnrpc: add open and close initiator to close summary
Add an initiator enum which allows up to display an unknown value for
channels that are not in the historical chan bucket, rather than having
and ambiguous false value also representing no-value. A both option is
added to cover the case where both parties initiated a close on chain.
2020-02-21 13:53:45 +02:00
Yaacov Akiba Slama
90008386d8 Copy InputIndex into the underlying SignDescriptor struct
When the InputIndex is not 0, the index is not currently copied into the
underlying SignDescriptor structure and the siganture generated is not
valid.
2020-02-09 10:55:50 +02:00
Johan T. Halseth
b39e21f6dd
Merge pull request #3926 from C-Otto/master
Fix typos
2020-01-31 11:34:34 +01:00
Hampus Sjöberg
227e66c469 rpc: Add PendingOpenChannel to SubscribeChannelEvents
This commit adds PendingOpenChannel to SubscribeChannelEvents stream in
the gRPC API.
This is useful for keeping track of channel openings that Autopilot does.
It can also be used for the non-initator side of a channel opening to keep
track of channel openings.
2020-01-24 13:48:18 +01:00
Joost Jager
ae9c6faebf
Merge pull request #3809 from joostjager/anchor-sweeper
sweep: allow force sweeping of negatively yielding inputs
2020-01-23 11:46:46 +01:00
Carsten Otto
a908a74acb Fix typos 2020-01-17 21:18:20 +00:00
Conner Fromknecht
51dbdd3b38
multi: rename key_send, key-send and key send to keysend 2020-01-16 18:37:16 -08:00
Joost Jager
b0aae13d70
sweep: allow force sweeps 2020-01-15 16:56:44 +01:00
Joost Jager
16832cefa3
sweep: allow updating all sweep parameters
This is a preparation for adding additional parameters besides the fee
preference.
2020-01-15 16:56:40 +01:00
Carla Kirk-Cohen
7d356458e3
Merge pull request #3843 from carlaKC/htlcnotifier-0-switcherrors
[htlcnotifier 1/4]: Introduce Internal Errors
2020-01-15 08:46:38 +02:00
Joost Jager
5de308c4b5
routerrpc: update final cltv delta default
The default was increased for the main sendpayment RPC in commit
d3fa9767a9729756bab9b4a1121344b265410b1a. This commit sets the
same default for QueryRoutes, routerrpc.SendPayment and
router.EstimateRouteFee.
2020-01-14 21:03:24 +01:00
carla
b5a2d75465
htlcswitch+routing: type check on ClearTextError
Update the type check used for checking local payment
failures to check on the ClearTextError interface rather
than on the ForwardingError type. This change prepares
for splitting payment errors up into Link and Forwarding
errors.
2020-01-14 15:07:42 +02:00
carla
102f9b003f
htlcswitch: add ClearTextError interface
This commit adds a ClearTextError interface
which is implemented by non-opaque errors that
we know the underlying wire failure message for.
This interface is implemented by ForwardingErrors,
because we can fully decrypt the onion blob to
obtain the underlying failure reason. This interface
will also be implemented by errors which originate
at our node in following commits, because we know
the failure reason when we fail the htlc.

The lnwire interface is un-embedded in the
ForwardingError struct in favour of implementing
this interface. This change is made to protect
against accidental passing of a ForwardingError
to the wire, where the embedded FailureMessage
interface will present as wire failure but
will not serialize properly.
2020-01-14 15:07:41 +02:00
Joost Jager
81bf6e15b3
routing+lnrpc: add missing query routes parameters 2020-01-14 11:21:31 +01:00
Joost Jager
280611ab6e
sweep+walletrpc+lncli: report requested fee preference for pending sweeps
Previously only the fee rate used for the last sweep (the sweep bucket
average) was reported. This commit adds the request fee preference to
the report, which is used to select a bucket and the sweep tx fee rate.
2020-01-09 14:56:08 +01:00
Oliver Gugger
4f98642b5e
signrpc: derive custom shared key
With this commit we add the ability to create a shared DH key by using
a custom node private key instead of the node's identity private key.
If no key locator is specified the node's identity private key will be
used as a fallback.
2020-01-06 14:53:32 +01:00
Olaoluwa Osuntokun
5ade9abe29
Merge pull request #3777 from guggero/shared-key
signrpc: add DeriveSharedKey
2020-01-02 16:02:47 -08:00
Joost Jager
c08865f4ae
lnrpc/invoicesrpc: add is_key_send flag to rpc invoice 2019-12-23 21:51:21 +01:00
Joost Jager
6063dc31fc
lnrpc/invoicesrpc: support empty payment request fields
Prepares for spontaneous key send payments that do not have a payment
request.
2019-12-23 21:51:15 +01:00
Olaoluwa Osuntokun
3eed38d602
lnrpc: add ability to provide chan point shims for funding, new funding modifiers
In this commit, we start to expose some of the new external funding
functionality over the RPC interface.

First, we add a new `funding_shim` field to the regular `OpenChannel`
method. This can be used by a caller to express that certain parameters
of the funding flow have already been negotiated outside the protocol,
and should be used instead. For example, a shim can be provided to use a
particular key for the commitment key (ideally cold) rather than use one
this is generated by the wallet as normal, or signal that signing will
be carried out in an interactive manner (PSBT based).

Next, we add a brand new method: `FundingStateStep`. FundingStateStep is
an advanced funding related call that allows the caller to either
execute some preparatory steps for a funding workflow, or manually
progress a funding workflow. The primary way a funding flow is
identified is via its pending channel ID. As an example, this method can
be used to specify that we're expecting a funding flow for a particular
pending channel ID, for which we need to use specific parameters.
Alternatively, this can be used to interactively drive PSBT signing for
funding for partially complete funding transactions.

The new transition methods (funding state machine modifiers) in this
commit allow a party to register a funding intent that should be used
for a specified incoming pending channel ID. The "responder" to the
external channel flow should use this to prep lnd to be able to handle
the channel flow properly.
2019-12-20 19:09:38 -08:00
Conner Fromknecht
72a49d486a
Merge pull request #3647 from cfromknecht/hex-jsonpb
build+lncli: default to hex encoding for byte slices
2019-12-20 18:23:52 -08:00
carla
b6f546503a
routerrpc: add MppTimeout code to failures 2019-12-20 13:02:19 +02:00
Conner Fromknecht
153cd58c97
lnrpc+lncli: reorder getinfo and use printRespJSON 2019-12-20 01:05:27 -08:00
Oliver Gugger
33e8077181
signrpc: add DeriveSharedKey 2019-12-20 09:25:52 +01:00
Conner Fromknecht
e6db31f267
routerrpc: allow dest_features graph fallback 2019-12-19 16:28:57 -08:00
Joost Jager
5ea63158e0
Merge pull request #3838 from bhandras/i1404
channeldb+invoices: fix what pending invoice means in ChannelDB
2019-12-19 21:02:57 +01:00
Andras Banki-Horvath
fa14ff67ad channeldb+invoices: fix what pending invoice means in ChannelDB
This commits builds on top of PR #3694 to further clarify invoice
state by defining pending invoices as the ones which are not
settled or canceled. Automatic cancellation of expired invoices
makes this possbile. While this change only directly affects
ChannelDB, users of the listinvoices RPC will receive actual
pending invoices when pending_only flag is set.
2019-12-19 17:44:32 +01:00
Conner Fromknecht
35dd5f354d
routerrpc: parse dest_features bits for manual SendPayment 2019-12-18 23:57:38 -08:00
Conner Fromknecht
457fda6095
routerrpc: add dest_features to SendPaymentRequest 2019-12-18 23:57:23 -08:00
Conner Fromknecht
f868bc128b
rpcserver+routerrpc: thread features + payment addr to SendPayment 2019-12-18 23:56:59 -08:00
Wilmer Paulino
7f3771e74f
Merge pull request #3796 from carlaKC/3786-setupfrontshutdown
Add Upfront Shutdown Address to OpenChannelRequest
2019-12-18 11:28:29 -08:00
Joost Jager
7ecbe22531
Merge pull request #3814 from joostjager/sweeper-add-utxo
sweep: add wallet inputs to reach dust limit
2019-12-18 09:53:04 +01:00
carla
eb3a2e63f2
lnrpc: display local upfront shutdown 2019-12-17 23:21:30 +02:00
carla
6eab2a06dd
lnrpc+lncli: add feature bits to GetInfo 2019-12-17 23:21:14 +02:00
carla
a2f029caca
lnrpc: add upfront shutdown address to open channel request 2019-12-17 23:18:25 +02:00
carla
3c28507062
lnrpc: Add subscribe peer events rpc 2019-12-17 21:26:55 +02:00
Joost Jager
77fde0f201
Merge pull request #3840 from joostjager/queryroutes-padding-comment
lnrpc: clarify block padding requirement for QueryRoutes
2019-12-16 15:48:08 +01:00
Joost Jager
9ae02796fa
lnrpc: clarify block padding requirement for QueryRoutes 2019-12-16 13:38:01 +01:00
Conner Fromknecht
b2d276feb8
lnrpc: update all feature vectors to maps 2019-12-14 07:05:21 -08:00
Conner Fromknecht
990bdd6b64
lnrpc: display remote peer features via rpc 2019-12-14 07:05:07 -08:00
Conner Fromknecht
db0029d03d
lnrpc: add node features to LightningNode and NodeInfo 2019-12-14 07:04:51 -08:00
Joost Jager
38adfd7ecc
sweep: create sweep parameters struct
Prepares for adding more input-specific sweep parameters.
2019-12-13 12:02:42 +01:00
Conner Fromknecht
d5d38c6e01
signrpc: fix uncommitted changes from proto 2019-12-12 17:20:33 -08:00
Joost Jager
d16476e477
routerrpc+record: move custom set validation 2019-12-12 17:49:34 +01:00
Joost Jager
75b94dec2b
Merge pull request #3819 from joostjager/fix-custom-record-payment
multi: fix custom record payment
2019-12-12 14:33:05 +01:00
Conner Fromknecht
aba49c9a5a
rpcserver: populate features on lnrpc invoices
In the process, we also move the feature serialization into the
invoicesrpc package, so that it can be shared between the invoicesrpc
and main rpcserver.
2019-12-12 00:12:51 -08:00
Conner Fromknecht
7446495b6d
lnrpc: add features field to invoices 2019-12-12 00:08:18 -08:00
Olaoluwa Osuntokun
338175534e
Merge pull request #3812 from guggero/sign-custom
signrpc: sign and verify messages with custom key
2019-12-11 18:51:55 -08:00
Joost Jager
c37289cd94
routing: pass custom records into pathfinding 2019-12-12 00:15:00 +01:00
Joost Jager
d02de70d20
multi: do not use tlv.Record outside wire format handling
This commit prepares for more manipulation of custom records. A list of
tlv.Record types is more difficult to use than the more basic
map[uint64][]byte.

Furthermore fields and variables are renamed to make them more
consistent.
2019-12-12 00:14:58 +01:00
Joost Jager
8b5bb0ac63
record: move CustomRecordSet 2019-12-12 00:12:19 +01:00
Oliver Gugger
95226771ed
signrpc+rpcserver: add signer macaroon permissions 2019-12-11 22:37:40 +01:00
Oliver Gugger
9a73b9be78
signrpc: sign and verify messages with custom key
To allow signing of messages with any key in the key chain
we add two new methods to the signer RPC. These behave differently
to the methods with the same name in the main RPC as described
in the documentation comment.
2019-12-11 22:37:39 +01:00
Joost Jager
b2f43858c3
invoices: accept mpp payments 2019-12-11 16:14:49 +01:00
Joost Jager
b6eb3a69ba
routing+lnrpc+lncli: allow setting min htlc policy 2019-12-11 00:17:08 +01:00
Conner Fromknecht
1367187454
multi: set invoice feature bits using feature manager 2019-12-10 13:09:52 -08:00
Conner Fromknecht
5defa425e1
lnrpc: add feature bits to PayReq 2019-12-10 13:09:17 -08:00
Oliver Gugger
d47f67d260
signrpc+subserver: add key chain to signer 2019-12-10 09:48:13 +01:00
bluetegu
25caece160
lnrpc: Add optional delivery addresss to close channel
This commit is adapted from @Bluetegu's original
pull request #1462.
2019-12-10 09:12:54 +02:00
Joost Jager
5f4bd136cd
invoices: store custom records in invoice database 2019-12-10 06:54:24 +01:00
Olaoluwa Osuntokun
47235e2f98
lnrpc: add msats to return value of DecodePayReq
In this commit, we add `msats` to the return value of `DecodePayReq` to
ensure we always show full value information as we're moving to do
generally for all RPC calls that deal with off-chain amounts.
2019-12-06 15:48:30 -08:00
Conner Fromknecht
abb7f4fa9e
lnrpc+rpcserver: add payment_addr field to PayReq 2019-12-05 07:59:47 -08:00
Conner Fromknecht
cd27ee7cfc
rpcserver+invoicesrpc: set payment addr on new invoices
This commit modifies Lighting.AddInvoice and InvoicesRPC.AddHoldInvoice
to include the node's supported feature bits on the invoice. For now
this only includes the optional TLV Onion Payload bit.
2019-12-05 07:59:31 -08:00
Olaoluwa Osuntokun
392c1a9a1b
lnrpc/routerrpc: make SendToRoute consistent with other payment RPCs
In this commitment, we make the `SendToRoute` RPC call consistent with
all the other payment RPCs which will properly adhere to the current max
payment sat limit. This is a prep commit for the future wumbo soft cap
that will eventually land in lnd.
2019-12-04 15:10:44 -08:00
Joost Jager
352334d470
lnrpc: re-enable custom records
This commit also renames the rpc field for consistency. As it wasn't
functional and the id doesn't change, this isn't considered a breaking
change.
2019-12-04 13:27:33 +01:00
Joost Jager
0abc054eb0
routerrpc: refactor hop unmarshall code
Remove code duplication in preparation for additional unmarshalling.
2019-12-04 13:27:31 +01:00
Joost Jager
5d4ceca038
tlv: remove unused error return value
This commit also modifies a previous migration. Because the change is so
limited, we don't consider this a significant risk.
2019-12-04 13:27:29 +01:00
Joost Jager
97344af8f3
routing: local balance check 2019-12-04 09:45:07 +01:00
Joost Jager
2d19201ede
lnrpc+routerrpc+lncli: add allow_self_payments safety flag 2019-11-26 10:15:46 +01:00
Olaoluwa Osuntokun
cb2b8b4513
Merge pull request #3693 from cfromknecht/tlv-invoice
migrate to tlv for invoice body
2019-11-25 18:00:52 -06:00
Conner Fromknecht
9287610b83
lnrpc: fix nanonsecond typo 2019-11-22 12:23:35 -08:00
Conner Fromknecht
3b253e05f6
multi: restructure invoice Terms field
This commit restructures an invoice's ContractTerms to better encompass
the restrictions placed on settling. For instance, the final ctlv delta
and invoice expiry are moved from the main invoice body (where
additional metadata is stored). Additionally, it moves the State field
outside of the terms since it is rather metadata about the invoice
instead of any terms offered to the sender in the payment request.
2019-11-22 02:25:02 -08:00
Conner Fromknecht
4c872c438b
channeldb: complete migration 12 for TLV invoices 2019-11-22 02:24:28 -08:00
Conner Fromknecht
76a2dfd8a6
lnrpc: remove receipt field from invoice 2019-11-22 02:23:24 -08:00
Joost Jager
cdf1aa5bc1
routing: track amt ranges in mc 2019-11-22 11:17:28 +01:00