Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
6484157
Update list of commands in eclair-cli help (#1091)
araspitzu Jul 29, 2019
b9698f2
Documentation update (#1092)
t-bast Jul 31, 2019
4929feb
Typed amounts (#1088)
araspitzu Aug 7, 2019
290ac3d
Route computation: fix fee check (#1101)
sstone Aug 20, 2019
a406d2f
Publish transactions during transitions (#1089)
pm47 Aug 26, 2019
0b18abf
Typed cltv expiry (#1104)
t-bast Aug 26, 2019
2f42538
Extended queries optional (#899)
pm47 Aug 28, 2019
8f7a415
Rework router data structures (#902)
pm47 Aug 28, 2019
46e4873
Add more numeric utilities to MilliSatoshi (#1103)
t-bast Aug 29, 2019
8d1354a
Use unsigned comparison for 'maxHtlcValueInFlightMsat' (#1105)
araspitzu Aug 29, 2019
d67ba48
Add a sync whitelist (#954)
pm47 Aug 29, 2019
74af030
Move http APIs to subproject eclair-node (#1102)
araspitzu Aug 30, 2019
9507ba9
Fix regression in `Commitments.availableForSend` (#1107)
pm47 Aug 30, 2019
2ec9e47
Bolt4: remove final_expiry_too_soon error message (#1106)
t-bast Sep 2, 2019
abe7470
Fix build (#1115)
t-bast Sep 2, 2019
71da677
Fix maven mirror (#1120)
t-bast Sep 3, 2019
5607b81
Use Long to back the UInt64 type (#1109)
araspitzu Sep 4, 2019
c28be0f
Implement Bolt 11 invoice feature bits (#1121)
t-bast Sep 4, 2019
730d4d2
Update docker build (#1123)
araspitzu Sep 4, 2019
e73e672
Reject expired invoices before payment flow starts (#1117)
t-bast Sep 4, 2019
4bea855
Made sync params configurable (#1124)
pm47 Sep 5, 2019
0bc77f2
Activate support for variable-length onion (#1087)
t-bast Sep 5, 2019
77e472e
Add Semaphore CI (#1125)
pm47 Sep 5, 2019
7a50610
Router computes network stats (#1116)
t-bast Sep 6, 2019
ff0b4c8
Add monitoring with Kamon (disabled by default) (#1126)
pm47 Sep 6, 2019
0e70454
Check funds in millisatoshi when sending/receiving an HTLC (#1128)
pm47 Sep 6, 2019
26e4432
Don't hardcode the channel version (#1129)
pm47 Sep 6, 2019
2fbf46a
Removed Globals class (#1127)
pm47 Sep 11, 2019
8da509b
Make tests run in parallel (#1112)
pm47 Sep 11, 2019
2277b88
Add codecov integration to semaphore CI (#1134)
araspitzu Sep 12, 2019
8ee53bc
Drop support for Java 8 (#1135)
pm47 Sep 16, 2019
bac0829
Sphinx: accept invalid downstream errors (#1137)
t-bast Sep 18, 2019
e0461ae
Update string to match on bitcoind while it's indexing (#1138)
araspitzu Sep 18, 2019
14ba708
Merge branch 'master' into android-update
sstone Sep 19, 2019
f5ac0a4
Fix network db test
sstone Sep 19, 2019
4963d88
Peer: disable kamon
sstone Sep 19, 2019
401c996
Payment lifecycle refactoring (#1130)
t-bast Sep 20, 2019
b5461b8
Improve error handling when we couldn't find all the channels for a s…
araspitzu Sep 20, 2019
abf3907
Handle fees increases when channel is OFFLINE (#1080)
araspitzu Sep 20, 2019
ea77342
Derive channel keys from the channel funding pubkey (#1097)
sstone Sep 23, 2019
88880c3
Check if remote funder can handle an updated commit fee when sending …
Sep 23, 2019
e11e3e0
Fix and expand channel keypath (#1147)
sstone Sep 25, 2019
32103df
Use the same chain hash reference in all channel updates
sstone Sep 30, 2019
d9b993e
Merge branch 'master' into android-update
sstone Sep 30, 2019
24d1188
Commitments: take HTLC fee into account (#1152)
t-bast Sep 30, 2019
a7112e4
Android: add a spray-based API to eclair-node
sstone Sep 30, 2019
7458383
HTTP API: add type hints for payment status (#1150)
t-bast Oct 1, 2019
a6e7d9f
Use "mock" Kamon library
sstone Oct 1, 2019
332216b
Electrum: improve coin selection (fixes #1146) (#1149)
sstone Oct 2, 2019
320af43
Extend funding key path to 256 bits (#1154)
sstone Oct 2, 2019
37cc526
Use bitcoin 0.18.1 in the test (#1148)
araspitzu Oct 3, 2019
c968d06
Upgrade new unit tests to bitcoin 0.18.1 API (#1157)
sstone Oct 3, 2019
91a4aa8
Merge branch 'master' into android-update
sstone Oct 3, 2019
80a27cc
Update netty dependency to 4.1.32 (#1160)
pm47 Oct 3, 2019
c1e0adc
Add execution time limit (#1161)
t-bast Oct 3, 2019
280696b
Use option deserializers for optional form params
araspitzu Oct 4, 2019
0ed6f93
Android: wipe channels table during db migration
sstone Oct 4, 2019
0d4056f
Merge remote-tracking branch 'origin/android-update-api-optional-para…
sstone Oct 7, 2019
4300e7b
Activate extended channel range queries (#1165)
sstone Oct 7, 2019
c14de85
Merge branch 'master' into android-update
sstone Oct 7, 2019
a6b33cb
Use guava to compute CRC32C checksums (#1166)
sstone Oct 7, 2019
fb4b648
Merge branch 'master' into android-update
sstone Oct 7, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
coverage:
ci:
- pm47.semaphoreci.com
status:
project: off
patch: off
Expand Down
29 changes: 29 additions & 0 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: v1.0
name: Build & Test
agent:
machine:
type: e1-standard-4
os_image: ubuntu1804
execution_time_limit:
minutes: 15

blocks:
- name: Build & Test
task:
secrets:
# This needs to have the same name as the secret entry configured on semaphore dashboard.
- name: Codecov upload token
env_vars:
# Set maven to use a local directory. This is required for
# the cache util. It must be set in all blocks.
- name: MAVEN_OPTS
value: "-Dmaven.repo.local=.m2"
jobs:
- name: Build & Test
commands:
- sem-version java 11
- checkout
- cache restore maven
- mvn scoverage:report
- bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN
- cache store maven .m2
10 changes: 4 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ scala:
env:
- export LD_LIBRARY_PATH=/usr/local/lib
before_install:
- wget http://apache.crihan.fr/dist/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.zip
- unzip -qq apache-maven-3.6.0-bin.zip
- export M2_HOME=$PWD/apache-maven-3.6.0
- wget https://apache.osuosl.org/maven/maven-3/3.6.2/binaries/apache-maven-3.6.2-bin.zip
- unzip -qq apache-maven-3.6.2-bin.zip
- export M2_HOME=$PWD/apache-maven-3.6.2
- export PATH=$M2_HOME/bin:$PATH
script:
- mvn scoverage:report
Expand All @@ -22,6 +22,4 @@ jdk:
- openjdk11
notifications:
email:
- ops@acinq.fr
after_success:
- bash <(curl -s https://codecov.io/bash)
- ops@acinq.fr
52 changes: 34 additions & 18 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,55 @@
# Building Eclair

## Requirements
- [OpenJDK 11](https://jdk.java.net/11/).

- [OpenJDK 11](https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=hotspot).
- [Maven](https://maven.apache.org/download.cgi) 3.6.0 or newer
- [Docker](https://www.docker.com/) 18.03 or newer (optional) if you want to run all tests

:warning: You can also use [Oracle JDK 1.8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) to build and run eclair, but we recommend you use Open JDK11.

## Build
To build the project, simply run:

To build the project and run the tests, simply run:

```shell
$ mvn install
mvn install
```

#### Other build options
### Other build options

To skip all tests, run:

```shell
$ mvn install -DskipTests
mvn install -DskipTests
```
To only build the `eclair-node` module

To only build the `eclair-node` module, run:

```shell
mvn install -pl eclair-node -am -DskipTests
```

To run the tests, run:

```shell
mvn test
```

To run tests for a specific class, run:

```shell
$ mvn install -pl eclair-node -am -DskipTests
mvn test -Dsuites=*<TestClassName>
```

# Building the API documentation
## Build the API documentation

## Slate
### Slate

The API doc is generated via slate and hosted on github pages. To make a change and update the doc follow the steps:

1. git checkout slate-doc
2. Install your local dependencies for slate, more info [here](https://github.com/lord/slate#getting-started-with-slate)
3. Edit `source/index.html.md` and save your changes.
4. Commit all the changes to git, before deploying the repo should be clean.
5. Push your commit to remote.
6. Run `./deploy.sh`
7. Wait a few minutes and the doc should be updated at https://acinq.github.io/eclair
1. `git checkout slate-doc`
2. Install your local dependencies for slate, more info [here](https://github.com/lord/slate#getting-started-with-slate)
3. Edit `source/index.html.md` and save your changes.
4. Commit all the changes to git, before deploying the repo should be clean.
5. Push your commit to remote.
6. Run `./deploy.sh`
7. Wait a few minutes and the doc should be updated at [https://acinq.github.io/eclair](https://acinq.github.io/eclair)
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
FROM openjdk:8u171-jdk-alpine as BUILD
FROM adoptopenjdk/openjdk11:jdk-11.0.3_7-alpine as BUILD

# Setup maven, we don't use https://hub.docker.com/_/maven/ as it declare .m2 as volume, we loose all mvn cache
# We can alternatively do as proposed by https://github.com/carlossg/docker-maven#packaging-a-local-repository-with-the-image
# this was meant to make the image smaller, but we use multi-stage build so we don't care

RUN apk add --no-cache curl tar bash

ARG MAVEN_VERSION=3.6.0
ARG MAVEN_VERSION=3.6.2
ARG USER_HOME_DIR="/root"
ARG SHA=6a1b346af36a1f1a491c1c1a141667c5de69b42e6611d3687df26868bc0f4637
ARG SHA=3fbc92d1961482d6fbd57fbf3dd6d27a4de70778528ee3fb44aa7d27eb32dfdc
ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries

RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
Expand Down Expand Up @@ -42,7 +41,7 @@ RUN mvn package -pl eclair-node -am -DskipTests -Dgit.commit.id=notag -Dgit.comm
# It might be good idea to run the tests here, so that the docker build fail if the code is bugged

# We currently use a debian image for runtime because of some jni-related issue with sqlite
FROM openjdk:8u181-jre-slim
FROM openjdk:11.0.4-jre-slim
WORKDIR /app

# install jq for eclair-cli
Expand Down
79 changes: 50 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@
**Eclair** (French for Lightning) is a Scala implementation of the Lightning Network. It can run with or without a GUI, and a JSON API is also available.

This software follows the [Lightning Network Specifications (BOLTs)](https://github.com/lightningnetwork/lightning-rfc). Other implementations include [c-lightning](https://github.com/ElementsProject/lightning) and [lnd](https://github.com/LightningNetwork/lnd).

---

:construction: Both the BOLTs and Eclair itself are still a work in progress. Expect things to break/change!

:rotating_light: If you run Eclair on mainnet (which is the default setting):
- Keep in mind that it is beta-quality software and **don't put too much money** in it
- Eclair's JSON API should **NOT** be accessible from the outside world (similarly to Bitcoin Core API)


---

:construction: Both the BOLTs and Eclair itself are still a work in progress. Expect things to break/change!

:rotating_light: If you run Eclair on mainnet (which is the default setting):

* Keep in mind that it is beta-quality software and **don't put too much money** in it
* Eclair's JSON API should **NOT** be accessible from the outside world (similarly to Bitcoin Core API)

---

## Lightning Network Specification Compliance

Please see the latest [release note](https://github.com/ACINQ/eclair/releases) for detailed information on BOLT compliance.

## Overview
Expand All @@ -32,18 +34,26 @@ Eclair offers a feature rich HTTP API that enables application developers to eas

For more information please visit the [API documentation website](https://acinq.github.io/eclair).

## Documentation

Please visit our [wiki](https://github.com/acinq/eclair/wiki) to find detailed instructions on how to configure your
node, connect to other nodes, open channels, send and receive payments and more advanced scenario.

You will find detailed guides and frequently asked questions there.

## Installation

### Configuring Bitcoin Core

:warning: Eclair requires Bitcoin Core 0.17.1 or higher. If you are upgrading an existing wallet, you need to create a new address and send all your funds to that address.

Eclair needs a _synchronized_, _segwit-ready_, **_zeromq-enabled_**, _wallet-enabled_, _non-pruning_, _tx-indexing_ [Bitcoin Core](https://github.com/bitcoin/bitcoin) node.
Eclair needs a _synchronized_, _segwit-ready_, **_zeromq-enabled_**, _wallet-enabled_, _non-pruning_, _tx-indexing_ [Bitcoin Core](https://github.com/bitcoin/bitcoin) node.
Eclair will use any BTC it finds in the Bitcoin Core wallet to fund any channels you choose to open. Eclair will return BTC from closed channels to this wallet.
You can configure your Bitcoin Node to use either `p2sh-segwit` addresses or `bech32` addresses, Eclair is compatible with both modes.

Run bitcoind with the following minimal `bitcoin.conf`:
```

```conf
server=1
rpcuser=foo
rpcpassword=bar
Expand All @@ -55,17 +65,22 @@ zmqpubrawtx=tcp://127.0.0.1:29000
### Installing Eclair

Eclair is developed in [Scala](https://www.scala-lang.org/), a powerful functional language that runs on the JVM, and is packaged as a JAR (Java Archive) file. We provide 2 different packages, which internally use the same core libraries:

* eclair-node, which is a headless application that you can run on servers and desktops, and control from the command line
* eclair-node-gui, which also includes a JavaFX GUI

To run Eclair, you first need to install Java, we recommend that you use [OpenJDK 11](https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=hotspot). Eclair will also run on Oracle JDK 1.8, Oracle JDK 11, and other versions of OpenJDK but we don't recommend using them.
To run Eclair, you first need to install Java, we recommend that you use [OpenJDK 11](https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=hotspot). Other runtimes also work but we don't recommend using them.

Then download our latest [release](https://github.com/ACINQ/eclair/releases) and depending on whether or not you want a GUI run the following command:

* with GUI:

```shell
java -jar eclair-node-gui-<version>-<commit_id>.jar
```

* without GUI:

```shell
java -jar eclair-node-<version>-<commit_id>.jar
```
Expand All @@ -78,7 +93,7 @@ Eclair reads its configuration file, and write its logs, to `~/.eclair` by defau

To change your node's configuration, create a file named `eclair.conf` in `~/.eclair`. Here's an example configuration file:

```
```conf
eclair.node-alias=eclair
eclair.node-color=49daaa
```
Expand Down Expand Up @@ -111,10 +126,11 @@ Some advanced parameters can be changed with java environment variables. Most us
name | description | default value
----------------------|--------------------------------------------|--------------
eclair.datadir | Path to the data directory | ~/.eclair
eclair.headless | Run eclair without a GUI |
eclair.headless | Run eclair without a GUI |
eclair.printToConsole | Log to stdout (in addition to eclair.log) |

For example, to specify a different data directory you would run the following command:

```shell
java -Declair.datadir=/tmp/node1 -jar eclair-node-gui-<version>-<commit_id>.jar
```
Expand All @@ -130,41 +146,44 @@ java -Dlogback.configurationFile=/path/to/logback-custom.xml -jar eclair-node-gu
#### Backup

The files that you need to backup are located in your data directory. You must backup:
- your seed (`seed.dat`)
- your channel database (`eclair.sqlite.bak` under directory `mainnet`, `testnet` or `regtest` depending on which chain you're running on)

* your seed (`seed.dat`)
* your channel database (`eclair.sqlite.bak` under directory `mainnet`, `testnet` or `regtest` depending on which chain you're running on)

Your seed never changes once it has been created, but your channels will change whenever you receive or send payments. Eclair will
create and maintain a snapshot of its database, named `eclair.sqlite.bak`, in your data directory, and update it when needed. This file is
create and maintain a snapshot of its database, named `eclair.sqlite.bak`, in your data directory, and update it when needed. This file is
always consistent and safe to use even when Eclair is running, and this is what you should backup regularly.

For example you could configure a `cron` task for your backup job. Or you could configure an optional notification script to be called by eclair once a new database snapshot has been created, using the following option:
```

```conf
eclair.backup-notify-script = "/absolute/path/to/script.sh"
```

Make sure that your script is executable and uses an absolute path name for `eclair.sqlite.bak`.

Note that depending on your filesystem, in your backup process we recommend first moving `eclair.sqlite.bak` to some temporary file
Note that depending on your filesystem, in your backup process we recommend first moving `eclair.sqlite.bak` to some temporary file
before copying that file to your final backup location.


## Docker

A [Dockerfile](Dockerfile) image is built on each commit on [docker hub](https://hub.docker.com/r/acinq/eclair) for running a dockerized eclair-node.

You can use the `JAVA_OPTS` environment variable to set arguments to `eclair-node`.

```
```shell
docker run -ti --rm -e "JAVA_OPTS=-Xmx512m -Declair.api.binding-ip=0.0.0.0 -Declair.node-alias=node-pm -Declair.printToConsole" acinq/eclair
```

If you want to persist the data directory, you can make the volume to your host with the `-v` argument, as the following example:

```
```shell
docker run -ti --rm -v "/path_on_host:/data" -e "JAVA_OPTS=-Declair.printToConsole" acinq/eclair
```

If you enabled the API you can check the status of eclair using the command line tool:
```

```shell
docker exec <container_name> eclair-cli -p foobar getinfo
```

Expand All @@ -175,6 +194,7 @@ For advanced usage, Eclair supports plugins written in Scala, Java, or any JVM-c
A valid plugin is a jar that contains an implementation of the [Plugin](eclair-node/src/main/scala/fr/acinq/eclair/Plugin.scala) interface.

Here is how to run Eclair with plugins:

```shell
java -jar eclair-node-<version>-<commit_id>.jar <plugin1.jar> <plugin2.jar> <...>
```
Expand All @@ -184,15 +204,15 @@ java -jar eclair-node-<version>-<commit_id>.jar <plugin1.jar> <plugin2.jar> <...
Eclair is configured to run on mainnet by default, but you can still run it on testnet (or regtest): start your Bitcoin Node in
testnet mode (add `testnet=1` in `bitcoin.conf` or start with `-testnet`), and change Eclair's chain parameter and Bitcoin RPC port:

```
```conf
eclair.chain=testnet
eclair.bitcoind.rpcport=18332
```

You may also want to take advantage of the new configuration sections in `bitcoin.conf` to manage parameters that are network specific,
You may also want to take advantage of the new configuration sections in `bitcoin.conf` to manage parameters that are network specific,
so you can easily run your bitcoin node on both mainnet and testnet. For example you could use:

```
```conf
server=1
txindex=1
[main]
Expand All @@ -208,6 +228,7 @@ zmqpubrawtx=tcp://127.0.0.1:29001
```

## Resources
- [1] [The Bitcoin Lightning Network: Scalable Off-Chain Instant Payments](https://lightning.network/lightning-network-paper.pdf) by Joseph Poon and Thaddeus Dryja
- [2] [Reaching The Ground With Lightning](https://github.com/ElementsProject/lightning/raw/master/doc/deployable-lightning.pdf) by Rusty Russell
- [3] [Lightning Network Explorer](https://explorer.acinq.co) - Explore testnet LN nodes you can connect to

* [1] [The Bitcoin Lightning Network: Scalable Off-Chain Instant Payments](https://lightning.network/lightning-network-paper.pdf) by Joseph Poon and Thaddeus Dryja
* [2] [Reaching The Ground With Lightning](https://github.com/ElementsProject/lightning/raw/master/doc/deployable-lightning.pdf) by Rusty Russell
* [3] [Lightning Network Explorer](https://explorer.acinq.co) - Explore testnet LN nodes you can connect to
9 changes: 5 additions & 4 deletions eclair-core/eclair-cli
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ where OPTIONS can be:
-s Some commands can print a trimmed JSON

and COMMAND is one of:
getinfo, connect, open, close, forceclose, updaterelayfee,
getinfo, connect, disconnect, open, close, forceclose, updaterelayfee,
peers, channels, channel, allnodes, allchannels, allupdates
findroute, findroutetonode, parseinvoice, payinvoice, sendtonode,
getsentinfo, createinvoice, getinvoice, listinvoices,
listpendinginvoices, getreceivedinfo, audit, networkfees, channelstats
sendtoroute, getsentinfo, createinvoice, getinvoice, listinvoices,
listpendinginvoices, getreceivedinfo, audit, networkfees,
channelstats, usablebalances

Examples
--------
Expand Down Expand Up @@ -88,7 +89,7 @@ jq_filter='if type=="object" and .error != null then .error else .';

# apply special jq filter if we are in "short" ouput mode -- only for specific commands such as 'channels'
if [ "$short" = true ]; then
jq_channel_filter="{ nodeId, shortChannelId: .data.shortChannelId, channelId, state, balanceSat: (try (.data.commitments.localCommit.spec.toLocalMsat / 1000 | floor) catch null), capacitySat: .data.commitments.commitInput.amountSatoshis, channelPoint: .data.commitments.commitInput.outPoint }";
jq_channel_filter="{ nodeId, shortChannelId: .data.shortChannelId, channelId, state, balanceSat: (try (.data.commitments.localCommit.spec.toLocal / 1000 | floor) catch null), capacitySat: .data.commitments.commitInput.amountSatoshis, channelPoint: .data.commitments.commitInput.outPoint }";
case $api_endpoint in
"channels") jq_filter="$jq_filter | map( $jq_channel_filter )" ;;
"channel") jq_filter="$jq_filter | $jq_channel_filter" ;;
Expand Down
Loading