1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-02-24 14:50:46 +01:00
Commit graph

1459 commits

Author SHA1 Message Date
Andrea
0078d62e27
Update README for the new docs and the new api, move old doc in a separate readme. 2019-03-26 12:56:37 +01:00
dpad85
9c9afe4799
Fixed eclair cli error parsing, added commands to eclair cli completion 2019-03-25 18:39:17 +01:00
Andrea
caa056eaf3
Merge remote-tracking branch 'origin/api_revamp' into api_revamp 2019-03-25 11:41:56 +01:00
Andrea
2f37cdc5e3
Formatting 2019-03-25 11:41:48 +01:00
dpad85
f3715fd90e
Removed help, we will instead point to an online documentation 2019-03-25 11:39:12 +01:00
Andrea
e663dbcc63
Use a mock Eclair in ApiServiceSpec 2019-03-25 11:36:01 +01:00
dpad85
00b357ab58
Wip improving the help message in eclair-cli 2019-03-22 18:39:24 +01:00
Andrea
9ca19bccde
Rename EclairApiImpl to EclairImpl 2019-03-22 18:08:40 +01:00
Andrea
e07e9f6d46
Rename named parameters for better readability 2019-03-22 17:35:34 +01:00
Andrea
6d5a25ca29
Encapsule errors in a JSON response 2019-03-22 17:19:53 +01:00
Andrea
d6f2434349
Support -h in eclair-cli 2019-03-22 16:48:45 +01:00
Andrea
4787f0a497
Remove 'help' method 2019-03-22 16:40:07 +01:00
Andrea
7bf1cd8dfa
Merge branch 'master' into api_revamp 2019-03-22 16:36:02 +01:00
Andrea
7f631045e9
Include help response in eclair-cli 2019-03-22 16:34:17 +01:00
Andrea
6441590b2c
Merge remote-tracking branch 'origin/api_revamp' into api_revamp 2019-03-22 15:55:41 +01:00
Andrea
1e15c92e7b
Set blockHeight during test for getinfo 2019-03-22 15:55:27 +01:00
dpad85
27c2c83c2c
Updated eclair-cli to work with the revamped API
File is a bit longer, but with simpler logic since parameters are now
named, and order does not matter anymore.

Command and its parameters are transformed into endpoint + url encoded
body (param1=xxx&param2=yyy...).

Removed verbose option and added a -c option which prints colored JSON
(off by default).

Help message does not rely on API /help endpoint anymore and contains a
list of all the available commands.
2019-03-22 15:38:53 +01:00
Andrea
26cc39e467
Standardize method names (all lowercase) 2019-03-22 14:46:59 +01:00
Andrea
3bf00fb5b2
Rename EclairApi into Eclair and move it to root package 2019-03-22 14:39:05 +01:00
Fabrice Drouin
32d8a08ad1 Improve unit tests (#908)
* Bitcoin tests: generate 150 blocks instead of 500

We don't need to generate 432 blocks to activate segwit but we still need to have
spendable coins and coinbase maturity is 100 blocks even on regtest.

* Electrum client: test against mainnet Electrum servers

Previous test against testnet servers was flaky because testnet Electrum
servers are unrelable. Here we test against our own server on mainnet (and
2 servers from our list for the pool test).
2019-03-22 13:26:55 +01:00
Andrea
8567979a85
Remove getInfo parameter from EclairApi, remove 'port' from GetInfoResponse 2019-03-22 11:30:44 +01:00
Andrea
709298998b
Remove MetaService in favor of a shorter syntax 2019-03-22 11:06:24 +01:00
Andrea
f07741cfbf
Renaming Service -> OldService, NewService -> Service 2019-03-22 10:17:35 +01:00
araspitzu
1c9ac1d62d Ensure the cost function in path-finding is monotonic (#904)
Make sure the cost function in path-finding is monotonic
2019-03-20 10:43:48 +01:00
Fabrice Drouin
4aa7a1ca9f Upgrade to bitcoin 0.17.1 (#826)
Bitcoin Core 0.18 is about to enter RC cycle and should be release soon (initial target was April). It is not compatible with 0.16 (some of the RPC calls that we use have been removed. They're still available in 0.17 but tagged as deprecated). 

With this PR, eclair will be compatible with 0.17 and the upcoming 0.18, but not with 0.16 any more so it will be a breaking change for some of our users. Supporting the last 2 versions is the right option and we should be ready before 0.18 is actually released (its initial target was April).
2019-03-19 14:57:03 +01:00
Andrea
bd02e8ccfe
Add comment to MetaService 2019-03-19 13:17:16 +01:00
Andrea
3e285d131b
Merge branch 'master' into api_revamp 2019-03-19 11:41:05 +01:00
Andrea
db15e2bb01
Revert "Merge remote-tracking branch 'origin/use-bitcoin-0.17.1' into api_revamp"
This reverts commit b52ba9c05e, reversing
changes made to 837ac03dd9.
2019-03-19 11:40:10 +01:00
Pierre-Marie Padiou
cc3395a5bb
Better logic for sending channel_updates (#888)
* don't spam with channel_updates at startup

Previous logic was very simple but naive:
- every time a channel_update changed we would send it out
- we would always make a new channel_update with the disabled flag set
at startup.

In case our node was simply restarted, this resulted in us re-sending a
channel_update with the disabled flag set, then a second one with the
disabled flag unset a few seconds later, for each public channel.

On top of that, this opened way to a bug: if reconnection is very fast,
then the two successive channel_update will have the same timestamp,
causing the router to not send the second one, which means that the
channel would be considered disabled by the network, and excluded from
payments.

The new logic is as follows:
- when we do NORMAL->NORMAL or NORMAL->OFFLINE or OFFLINE->NORMAL, we
send out the new channel_update if it has changed
- in all other case (e.g. WAIT_FOR_INIT_INTERNAL->OFFLINE) we do nothing

As a side effect, if we were connected to a peer, then we shut down
eclair, then the peer goes down, then we restart eclair: we will make a
new channel_update with the disabled flag set but we won't broadcast it.
If someone tries to make a payment to that node, we will return the
new channel_update with disabled flag set (and maybe the payer will then
broadcast that channel_update). So even in that corner case we are good.

* quick reconnection: bump channel_update timestamp

In case of a disconnection-reconnection, we first generate a
channel_update with disabled bit set, then after we reconnect we
generate a second channel_update with disabled bit not set.

If this happens very quickly, then both channel_updates will have the
same timestamp, and the second one will get ignored by the network.

A simple fix is to bump the second timestamp in this case.

* set channel_update refresh timer at reconnection

We only care about this timer when connected anyway. We also cancel it
when disconnecting.

This has several advantages:
- having a static task resulted in unnecessary refresh if the channel
got disconnected/reconnected in between 2 weeks
- better repartition of the channel_update refresh over time because at
startup all channels were generated at the same time causing all refresh
tasks to be synchronized
- less overhead for the scheduler (because we cancel refresh task for
offline channels (minor, but still)
2019-03-18 14:39:29 +01:00
Andrea
56f910cf5b
Formatting commands in eclair-cli 2019-03-18 10:03:08 +01:00
Andrea
961bf3c1dd
Remove custom rejections 2019-03-15 18:23:09 +01:00
Andrea
1e79bd18a7
Timeout response not a json 2019-03-15 18:22:21 +01:00
Andrea
6ab9e03be8
Formatting 2019-03-15 18:20:47 +01:00
Andrea
f2cea92dbc
Use minFinalCltvExpiry from the invoice when sending a payment 2019-03-15 18:20:16 +01:00
Andrea
2ebec3b053
Separate findRoute and send API to remove ambiguity (and improve error responses) 2019-03-15 18:09:25 +01:00
Andrea
9ecda96b4c
Remove default case for non matched routes 2019-03-15 17:47:54 +01:00
Andrea
6884725934
Rework getInfo parameter passing, update the mock for it 2019-03-15 17:09:11 +01:00
Andrea
e8069d5719
Fix usage of the deprecation config key (use-old-api) 2019-03-15 17:05:53 +01:00
Andrea
8268e70c35
Rename config key and make new API enabled by default 2019-03-15 14:25:27 +01:00
Andrea
1fe65f4231
Move out /help from EclairApi 2019-03-15 14:23:14 +01:00
Andrea
7b6c020fe1
Add ByteVector32 Serializer to JsonSupport scope 2019-03-15 14:17:45 +01:00
Andrea
72cf2e87b5
Re-enable output processing with JQ in eclair-cli 2019-03-15 14:04:21 +01:00
Andrea
8c3d7d843a
Fix ClassCastException when mapping the channels responses to ByteVector instead of ByteVector32 2019-03-15 13:56:07 +01:00
Fabrice Drouin
5519d0aa6a Minor fixes (dependencies, unit tests) (#901)
Use bitcoin-lib v0.10 which has finally been synced to maven central.
Fix transactions unit test (the check in the test was using the whole locktime and not
the last 24 bits).
2019-03-15 12:54:33 +01:00
Andrea
53ec015e02
Separate Service and EclairApiImpl 2019-03-15 12:27:33 +01:00
Andrea
ec10feb40a
Do not return Route(s) from the implementation of API methods, add test for /connect 2019-03-15 11:29:55 +01:00
Andrea
5ff5042f2d
Add mock file for /help 2019-03-14 18:35:05 +01:00
Andrea
b52ba9c05e
Merge remote-tracking branch 'origin/use-bitcoin-0.17.1' into api_revamp 2019-03-14 18:34:37 +01:00
Andrea
837ac03dd9
Accept shortChannelId in /close, finish porting the test from the previous APIs 2019-03-14 18:34:18 +01:00
Andrea
305219d929
Finish merging master 2019-03-14 16:19:19 +01:00