Commit Graph

2041 Commits

Author SHA1 Message Date
Andrey Samokhvalov
d723aada30 goclean: add vendor check; add '-i' flag
Add check that vendor directory is installed and if not we should run
glide install, also if additional flag '-i' is specified than we will
reinstall dependencies.
2017-03-14 21:22:44 -07:00
Olaoluwa Osuntokun
e4e63eb3a3
test: remove many sleeps from integration test by using new topology ntfns
This commit removes a number of sleeps from the set of current
integration tests by replacing them with a synchronous (w/ a timeout)
block until one or many channels are detected as being open within the
network.

As a result, the tests are now more robust, many flakes have been
eliminated, and finally this shaves a few second off of the integration
testing runs.
2017-03-14 20:08:02 -07:00
Olaoluwa Osuntokun
8ed79ae497
routing: fix bug when sending topology ntfns to multiple clients
This commit fixes a bug which was originally introduced when the
topology notifications were added to the channel router. The issue was
that a pointer to the loop-scope range variable was being passed into
the goroutine which dispatches the notification rather than the value
itself. It seems that the memory location is re-used between range
iterations causing the same client to receive _all_ the notifications.

This bug is fixed by passing a copy of the client struct rather than a
pointer to the range variable.

In the process, we also add some additional debug logging messages, and
remove the Curve parameter from any public keys involved in a
notification so the pretty print properly.
2017-03-14 20:07:55 -07:00
Olaoluwa Osuntokun
a179a3adbb
test: modify new network announcement hook to be in node level
This commit modifies the two newly added network announcement hook stop
be at the lightningNode level rather than on the level of the entire
test framework. With this, callers are now able to better utilize the
newly added RPC’s since they can target particular peers and wait for
network messages to be processed rather then depending on a single node
(Alice) for information about the announcements propagated within the
network.
2017-03-14 20:07:52 -07:00
Olaoluwa Osuntokun
5623df6d7e
test: add integration tests for graph topology notifications 2017-03-14 20:07:49 -07:00
Olaoluwa Osuntokun
19f33d4faf
test: add ability to register for LN channel notification to framework
This commit adds the ability for test authors using the integration
testing framework to hook into real-time notifications for
network-level announcements concerning channel openings, closings, and
updates. With this commit we should be able to eliminate a number of
the sleeps within the test framework with synchronous calls (time outs)
to the new methods added in this PR.
2017-03-14 20:07:46 -07:00
Olaoluwa Osuntokun
24a69c1164
rpc: implement new streaming SubscribeChannelGraph RPC call
This commit implements the new server-side streaming RPC call within
the current default implementation of the RPC server. With this, the
new functionality can now be used within the integration tests to
achieve a greater degree of synchronization in the tests. As a result,
we should be able to eliminate many of the sleeps lingering within the
tests.
2017-03-14 20:07:43 -07:00
Olaoluwa Osuntokun
94fa55cca3
lnrpc: add new SubscribeChannelGraph RPC call
This commit adds a new streaming RPC call the exposes the newly added
routing layer TopologyChange notifications within the gRPC service.
2017-03-14 20:07:39 -07:00
Olaoluwa Osuntokun
f6ab1390ed
routing: include the channel point of chan within edge update ntfn
This commit modifies the `ChannelEdgeUpdate` struct to include the
channel point itself within the notifications. Such a change improves
the notificaiton experience for callers as it allows them to filter out
update notifications based on a familiar object within the codebase: a
channel point.
2017-03-14 20:07:33 -07:00
Andrey Samokhvalov
61991a1c89 lnd: fix latest goclean.sh lint warning 2017-03-13 16:30:23 -07:00
Andrey Samokhvalov
730c0b8cb1 tests: exclude integration test from coverage check 2017-03-13 16:30:23 -07:00
Andrey Samokhvalov
ee2379775c lnd: fix golint warning which requires to add additional comments 2017-03-13 16:30:23 -07:00
Andrey Samokhvalov
0074643c10 gitignore: add profile.[cov|tmp] 2017-03-13 16:30:23 -07:00
Andrey Samokhvalov
7fcccff22a lnwallet: add TODO which asks to justifying strange import 2017-03-13 16:30:23 -07:00
Andrey Samokhvalov
deca1926d1 networktest: fix race condition 2017-03-13 16:30:23 -07:00
Andrey Samokhvalov
c30d4a9329 readme: add coverage badge 2017-03-13 16:30:23 -07:00
Andrey Samokhvalov
fd97a4bd19 lnd: partially fix golint warnings 2017-03-13 16:30:23 -07:00
Andrey Samokhvalov
92dec2a902 lnd: fix govet warnings 2017-03-13 16:30:23 -07:00
Andrey Samokhvalov
143a6e01bb lnd: fix unconvert warnings 2017-03-13 16:30:23 -07:00
Andrey Samokhvalov
f2843dd4c9 lnd: fix gofmt warnings 2017-03-13 16:30:23 -07:00
Andrey Samokhvalov
8fb54782e2 lnd: fix gosimple warnings 2017-03-13 16:30:23 -07:00
Andrey Samokhvalov
f5fd4138a0 gotest: add additional check that test ports are not used by other program 2017-03-13 16:30:23 -07:00
Andrey Samokhvalov
1aa4452622 gotest: add gofmt, govet, golint, gosimple, unconvert, race detector, test coverage in travis 2017-03-13 16:30:23 -07:00
Christopher Jämthagen
242c656fd6 lnwallet: use DefaultDustLimit() instead of hard-coded values 2017-03-09 15:32:31 -08:00
Christopher Jämthagen
810d8c286e test: add TestForceClose for lnwallet package 2017-03-09 15:32:31 -08:00
Christopher Jämthagen
ce1fcc0bd6 utxonursery: handle non-existant to-self outputs
If a forceClose happens and the to-self output is below the dust value,
then that output will be non-existant in the commitment transaction.
UtxoNursery now handles that case by checking to see if the accompanying
selfOutPutSignDescriptor is nil. If it is nil, then it will ignore it.
2017-03-09 15:32:31 -08:00
Christopher Jämthagen
a6a503bf28 lnwallet: ForceCloseSummary should check if to-local output exists
If the value of the to-local output is below the dust limit, the
ForceCloseSummary should not include a sign descriptor for this output.

We also find the proper to-self output by looking for the expected public
key script and not assume that no HTLC outputs exist.
2017-03-09 15:32:31 -08:00
Christopher Jämthagen
52b56b8cf2 lnwallet+test: no dust outputs in commitment transaction + tests
Currently non-HTLC outputs will be accepted in the commitment
transaction as long as it is non-zero. We change this by not allowing
outputs with a value lower than the dust limit. The value of such
an output will go towards transaction fees.
2017-03-09 15:32:31 -08:00
Thomas Preindl
9665bb7e54 lncli: add listchaintxns command 2017-03-08 17:39:38 -08:00
Olaoluwa Osuntokun
e1354dca45
glide: modify btcwallet target to version that auto reconnects
This commit modifies the glide target for btcwallet to pin against a
particular commit that will attempt to auto-reconnect to the btcd node
in the case of a websockets connection drop.
2017-03-08 15:25:51 -08:00
Olaoluwa Osuntokun
1dfda91415
lnrpc: add field denoting if channel peer is online in ListChannels
This commit adds a new field to the ListChannels RPC command which
indicates if the peer is currently online or not. This is useful as
UI’s will be able to use this information to communicate the
availability of each channel to an end user.
2017-03-08 14:46:24 -08:00
Olaoluwa Osuntokun
addab3273f
routing: add a set of test cases for client topology notifications 2017-03-08 14:46:18 -08:00
Olaoluwa Osuntokun
1a78c73f7e
routing: add new notificaiton client for topology changes
This commit adds some new functionality to the channel router: the
ability to dispatch notification to registered clients upon either a
channel being closed, a new node appearing, or an exiting client being
updated or opened for the first time.

With this change, the integration tests will now be able to eliminate
most of the sleep as we gain a new syntonization point into the
propagation of information within the test network. Additionally, this
also paves the way for client side software to dynamically visualize
the channel graph in real-time as nodes+channels are updated.
2017-03-08 14:46:14 -08:00
Olaoluwa Osuntokun
7bdf02bc9e
routing: modify path finding routines use new EdgeInfo/EdgePolicy
This commit modifies the path finding routines to properly use the new
channel edge related API exposed by the database. Additionally, a new
type `ChannelHop` has been introduced which couples an edges routing
policy with the capacity and origin chain of the channel.
2017-03-08 14:25:05 -08:00
Olaoluwa Osuntokun
43f3b6bebe
test: log current edges in testMultiHopPayments on error 2017-03-08 14:22:34 -08:00
Olaoluwa Osuntokun
da09f4dcc4
lnwire: modify newAlias to truncate alias strings if too long 2017-03-08 14:21:57 -08:00
Olaoluwa Osuntokun
f881e0a356
lnwire: fix typo in ChannelUpdateAnnouncement, Mstat -> Msat 2017-03-08 14:20:14 -08:00
Olaoluwa Osuntokun
1e540b0f99
funding: modify channel announcements due to lnwire API change 2017-03-05 22:46:59 -06:00
Olaoluwa Osuntokun
743de45c92
lnwire: rename Expiry to TimeLockDelta within ChannelUpdateAnnouncement
This commit modifies the ChannelUpdateAnnouncement to rename the Expiry
variable instead of TimeLockDelta as that is more descriptive of the
purpose of the attribute itself.
2017-03-05 22:43:57 -06:00
Olaoluwa Osuntokun
dc5eb8de37
rpc: update graph topology related RPC's to recent db API change
This commit updates all the RPC’s that deal with querying for data
stored within the graph to the latest version of the public API for the
graph itself.
2017-03-05 19:28:17 -06:00
Olaoluwa Osuntokun
d8d7dab258
rpc: set PaymentRequest+CreationDate in LookupInvoice respones 2017-03-05 19:26:52 -06:00
Olaoluwa Osuntokun
39e145f037
channeldb: update tests to recent API change (edge struct split) 2017-03-05 19:22:33 -06:00
Olaoluwa Osuntokun
deceae8fe4
channeldb: PruneGraph now returns the channels closed
This commit alters the return value of PrunedGraph to me a bit more
useful: the function now returns all the channels that were closed when
processing the block (slice of spent outpoints). With this information,
callers gain greater visibility into exactly which channels were
closed. This can be used in higher levels to present detailed summaries
of how blocks affect closed channels.
2017-03-05 19:20:57 -06:00
Olaoluwa Osuntokun
2c29a20a8d
channeldb: split ChannelEdge into two structs, info and policy
This commit splits the prior ChannelEdge struct into two distinct
structs: ChannelEdgeInfo and ChannelEdgePolicy. The info structs stores
the _full_ information that was used to advertise the channel, while
the policy struct contains the information that’s needed in order to
use the information for routing purposes.

With this split we can eliminate a number of hacks within the rest of
the codebase that were added as a result of data unavailability if one
or neither edge was present.

Finally a bit of field renaming has taken place (Exipiry ->
TimeLockDelta), etc.
2017-03-05 19:18:34 -06:00
Olaoluwa Osuntokun
8387092409
cmd/lncli: fix bug in openchannel cmd that made --push_amt mandatory
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.
2017-03-05 19:01:01 -06:00
Thomas Preindl
355c88f5a4 lncli: add support for positional arguments for all commands (#120)
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.
2017-03-02 16:23:16 -06:00
Michiel de Jong
2841d8f503 docker: fix small typos in README.md 2017-02-28 19:33:59 -06:00
Michiel de Jong
39cf3a6df5 docs/install: explain what to do if btcd.conf not found 2017-02-28 19:32:28 -06:00
Olaoluwa Osuntokun
e96e83f5eb
docs/grpc: add additional links to node.js tutorial 2017-02-28 18:22:06 -06:00
François
b2aa45db03 docs/grpc: add instructions for writing gRPC clients in node.js
This commit adds a basic set of instructions for installing the necessary
gRPC dependencies to be able to drive `lnd` from node.js. In the future,
this section will be expanded with additional example
scripts/applications.
2017-02-28 18:13:55 -06:00