Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
f3604cf
Document onchain wallet backup. (#2143)
sstone Jan 24, 2022
8758d50
Update cluster documentation [ci skip] (#2122)
sstone Jan 24, 2022
75ef66e
Front: use IMDSv2 to retrieve the instance ip (#2146)
pm47 Jan 25, 2022
57c2cc5
Type `ChannelFlags` instead of using a raw `Byte` (#2148)
pm47 Jan 25, 2022
ffecd62
Move channel parameters to their own conf section (#2149)
pm47 Jan 27, 2022
1f6a7af
Have sqlite also write to jdbc url file (#2153)
pm47 Jan 27, 2022
0333e11
Database migration Sqlite->Postgres (#2156)
pm47 Jan 31, 2022
a804905
Eclair v0.7.0 release (#2158)
t-bast Feb 1, 2022
4451069
Back to Dev (#2159)
t-bast Feb 1, 2022
cc61f12
Fix publish loop when funding tx double-spent (#2162)
t-bast Feb 2, 2022
648f93f
Ignore revoked htlcs after restart (#2161)
t-bast Feb 2, 2022
8a65e35
Don't broadcast commit before funding locked (#2163)
t-bast Feb 2, 2022
4307bad
Refactoring of PaymentRequest (#2144)
thomash-acinq Feb 2, 2022
fa31d81
Improve postman (#2147)
thomash-acinq Feb 2, 2022
553727c
Convert wiki pages in to files in the docs directory and general docs…
remyers Feb 6, 2022
9401592
Typed features (#2164)
thomash-acinq Feb 7, 2022
daddee1
fixup! Convert wiki pages in to files in the docs directory and gener…
remyers Feb 7, 2022
ca71a3c
Update a few dependencies (#2166)
pm47 Feb 8, 2022
66aafd6
Better logging for NegativeProbability exception (#2171)
thomash-acinq Feb 9, 2022
92221e8
Fix path-finding (#2172)
thomash-acinq Feb 9, 2022
53cb50a
Restrict building and publishing docker images to new pushes on maste…
sstone Feb 16, 2022
99aabda
Add txId in logback.xml (#2183)
t-bast Feb 17, 2022
609c206
Ignore IBD in regtest (#2185)
t-bast Feb 17, 2022
b5b2022
Add more PR details to contributing guidelines (#2186)
t-bast Feb 21, 2022
068b139
purge expired invoice at given time interval (#2174)
remyers Feb 21, 2022
8f7c6ed
Refactor `Closing.claimRemoteCommitMainOutput()` (#2191)
pm47 Mar 1, 2022
67fb392
Use direct channel when available (#2192)
thomash-acinq Mar 1, 2022
ab30af8
minFinalExpiryDelta is not optional (#2195)
thomash-acinq Mar 2, 2022
dba73c8
(Minor) Flatten `ChannelDataSpec` tests
pm47 Mar 2, 2022
be78e0c
Separate htlc calculation from local/remote commit (no quicklens) (#2…
pm47 Mar 2, 2022
c4f67e7
Bump postgres-jdbc version (#2198)
pm47 Mar 7, 2022
f3c6c78
Do not fail to relay payments with insufficient fee rate that satisfy…
remyers Mar 8, 2022
8f2c93c
Add delayed fees to release notes (#2204)
thomash-acinq Mar 11, 2022
f14300e
two new min-funding config parameters for public and private channels…
remyers Mar 11, 2022
7b5cefa
Replace `FeatureScope` by type hierarchy (#2207)
pm47 Mar 15, 2022
18ba900
(Minor) Fix timeout in tests (#2208)
pm47 Mar 16, 2022
5af042a
Add messages for when startup fails due to wrong bitcoind wallet(s) l…
remyers Mar 18, 2022
fd84909
Fix TLV tag number in exception (#2212)
thomash-acinq Mar 21, 2022
3e02046
Add logs about local channel graph inclusion (#2184)
t-bast Mar 24, 2022
dbd9e38
Add explicit github permissions to bitcoin core build (#2200)
arjundashrath Mar 25, 2022
6823309
Use `NodeAddress` everywhere instead of `InetAddress` (#2202)
pm47 Mar 25, 2022
0e88440
Make trampoline pay the right fee (#2206)
thomash-acinq Mar 28, 2022
d135224
Refactor channel into separate traits (#2217)
t-bast Mar 28, 2022
2872d87
Fix latest bitcoin build (#2218)
t-bast Mar 29, 2022
9358e5e
Add `channelbalances` API call (#2196)
remyers Mar 29, 2022
6f31ed2
Add release notes for new min-funding settings and invoice purger (#…
remyers Mar 29, 2022
1627682
Remove ipv6 zone identifier test (#2220)
thomash-acinq Mar 31, 2022
7883bf6
Use bitcoin-kmp through bitcoin-lib (#2038)
sstone Apr 5, 2022
36ed788
Update experimental trampoline feature bit (#2219)
t-bast Apr 7, 2022
446a780
Refactor channel transitions (#2228)
t-bast Apr 7, 2022
ddb52d8
Check that channel seed has not been modified (#2226)
sstone Apr 7, 2022
7cf2e20
Remove Phoenix workaround for PaymentSecret dependency (#2230)
t-bast Apr 11, 2022
787c51a
Add a "stop" API method (#2233)
sstone Apr 13, 2022
c7c515a
Add Bolt12 types and codecs (#2145)
thomash-acinq Apr 13, 2022
86145a7
Remove unused PerHopPayloadFormat traits (#2235)
thomash-acinq Apr 13, 2022
9a31dfa
Rename channel funder to initiator (#2236)
t-bast Apr 14, 2022
443266d
Add dual funding codecs and feature bit (#2231)
t-bast Apr 14, 2022
a4ddbc3
Give best capacity score to local channels (#2239)
thomash-acinq Apr 25, 2022
f099409
Disable invoice purger in tests (#2240)
pm47 Apr 25, 2022
56c9e06
Only define decode method in legacy codecs (#2241)
pm47 Apr 28, 2022
6958970
Fix flaky MempoolTxMonitor test (#2249)
t-bast May 3, 2022
74ef082
Use log probability in path-finding (#2257)
thomash-acinq May 10, 2022
ee74f10
Stop compressing with zlib (#2244)
t-bast May 11, 2022
1605c04
Introduce `ChannelRelayParams` in the graph (#2264)
pm47 May 12, 2022
95213bc
Remove unused `LocalChannel` class in the router (#2265)
pm47 May 13, 2022
b691e87
Fix flaky replaceable tx publisher tests (#2262)
t-bast May 13, 2022
10eb9e9
Improve wallet double-spend detection (#2258)
t-bast May 16, 2022
8e2fc7a
Run channel state tests sequentially (#2271)
pm47 May 17, 2022
81571b9
Fix flaky test PeerConnectionSpec (#2277)
thomash-acinq May 18, 2022
bb7703a
Add simple integration test between `Channel` and `Router` (#2270)
pm47 May 19, 2022
03097b0
Add `localChannelReserve` and `remoteChannelReserve` (#2237)
t-bast May 19, 2022
1e8791c
Update dual funding codecs (#2245)
t-bast May 19, 2022
6fa02a0
Use long id instead of short id in `ChannelRelay` (#2221)
pm47 May 19, 2022
d98da6f
Index unannounced channels on `channelId` instead of `shortChannelId`…
pm47 May 19, 2022
44e7127
(Minor) Postgres: use `write` instead of `writePretty` (#2279)
pm47 May 20, 2022
9c7ddcd
Increase closed timeout from 10s to 1min (#2281)
pm47 May 24, 2022
45f19f6
Fix test when run in Intellij (#2288) (#2289)
barrybecker4 May 30, 2022
749d92b
Add option to disable sending remote addr in init (#2285)
t-bast May 31, 2022
088de6f
Don't RBF anchor if commit is confirmed (#2283)
t-bast Jun 1, 2022
ee46c56
Remove dependency between dual funding and anchors (#2297)
t-bast Jun 1, 2022
9610fe3
Define a proper base class for fixture tests (#2286)
pm47 Jun 3, 2022
47c5b95
Drop support for Tor v2 hidden services (#2296)
rorp Jun 6, 2022
ecbec93
Add traits for permanent channel features (#2282)
t-bast Jun 6, 2022
e08353b
Remove close() in db interfaces (#2303)
pm47 Jun 8, 2022
c5620b2
Log routing hint when finding a route (#2242)
thomash-acinq Jun 8, 2022
340b568
(Minor) Test nits (#2306)
pm47 Jun 8, 2022
682e9bf
Fix minimal node fixture flakyness (#2302)
t-bast Jun 8, 2022
4722755
Estimate balances of remote channels (#2272)
thomash-acinq Jun 8, 2022
c4786f3
Store disabled channel update when offline (#2307)
t-bast Jun 8, 2022
3e3f786
Allow disabling bitcoind requests batching (#2301)
evd0kim Jun 13, 2022
e8c9df4
Add more GraphSpec tests (#2292) (#2293)
barrybecker4 Jun 13, 2022
e5f5cd1
Add support for zero-conf and scid-alias (#2224)
pm47 Jun 15, 2022
f47c7c3
Don't block when generating shutdown script (#2284)
t-bast Jun 15, 2022
bfba9e4
(Minor) Include the discriminator in all channel codecs (#2317)
pm47 Jun 16, 2022
7630c51
(Minor) Fix flaky `ZeroConfAliasIntegrationSpec` (#2319)
pm47 Jun 16, 2022
6882bc9
Clean up scid parsing from coordinates string (#2320)
t-bast Jun 16, 2022
fc30eab
Remove `channelId` from `PublicChannel` (#2324)
t-bast Jun 16, 2022
26741fa
Reuse postgres instance in tests (#2313)
pm47 Jun 16, 2022
6b2e415
Expose scraping endpoint for prometheus metrics (#2321)
GoutamVerma Jun 16, 2022
70de271
Make actors signal when they are ready (#2322)
pm47 Jun 23, 2022
0c84063
add arm64v8 Dockerfile (#2304)
chrisguida Jun 23, 2022
af79f44
Move arm64 docker file to contrib and udpate README.md (#2327)
sstone Jun 23, 2022
08d2ad4
Random values for `generateLocalAlias()` (#2337)
pm47 Jun 29, 2022
c9810d5
Resume reading after processing unknown messages (#2332)
pm47 Jun 29, 2022
e880b62
Refactor routing hints to prepare for payments to blinded routes (#2315)
thomash-acinq Jun 29, 2022
8af14ac
Backport from feature branches (#2326)
pm47 Jun 29, 2022
6011c86
Additive per-node feature override (#2328)
t-bast Jul 1, 2022
a1f7c1e
Return local channel alias in payment failures (#2323)
t-bast Jul 1, 2022
2790b2f
Activate 0-conf based on per-peer feature override (#2329)
t-bast Jul 1, 2022
2461ef0
Call `resolve()` on configuration (#2339)
pm47 Jul 1, 2022
3b97e44
Allow disabling no-htlc commitment fee-bump (#2246)
t-bast Jul 1, 2022
276340d
Add host metrics grafana dashboard (#2334)
GoutamVerma Jul 1, 2022
3196462
Proper json serializer for `BlockHeight` (#2340)
pm47 Jul 1, 2022
e1dc358
Fix RoutingHeuristics.normalize (#2331)
barrybecker4 Jul 4, 2022
b5aaddb
Add support for paying offers
thomash-acinq Nov 23, 2021
8ef5dfe
Make payment secret optional again
thomash-acinq Apr 15, 2022
0b323f5
Dummy invoice
thomash-acinq Jun 14, 2022
87c98db
Mandatory blinded paths
thomash-acinq Jul 19, 2022
518a5f3
Full keys and more tests
thomash-acinq Jul 20, 2022
906ba58
Fix offer tests
thomash-acinq Jul 21, 2022
d2810ff
Add offers DB
thomash-acinq Jul 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Docker Image CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/latest-bitcoind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
# Run at midnight on Sunday and Wednesday.
- cron: '0 0 * * 0,3'

permissions:
contents: read

jobs:

regression-tests:
Expand All @@ -18,7 +21,7 @@ jobs:
path: bitcoin

- name: Install bitcoind dependencies
run: sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 libssl-dev libevent-dev libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libminiupnpc-dev libzmq3-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler git libsqlite3-dev ccache
run: sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 libevent-dev libboost-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libsqlite3-dev systemtap-sdt-dev
working-directory: ./bitcoin

- name: Autogen bitcoind
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

build:
runs-on: ubuntu-latest
timeout-minutes: 20
timeout-minutes: 30

steps:
- uses: actions/checkout@v2
Expand Down
17 changes: 16 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ You can also use Github issues for [feature requests](https://github.com/acinq/e
- [Lightning Network Whitepaper](https://lightning.network/lightning-network-paper.pdf)
- [Deployable Lightning](https://github.com/ElementsProject/lightning/raw/master/doc/deployable-lightning.pdf)
- [Understanding the Lightning Network](https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791)
- [Lightning Network Specification](https://github.com/lightningnetwork/lightning-rfc)
- [Lightning Network Specification](https://github.com/lightning/bolts)
- [High Level Lightning Network Specification](https://medium.com/@rusty_lightning/the-bitcoin-lightning-spec-part-1-8-a7720fb1b4da)
- [t-bast's in-depth articles about the Lightning Network](https://github.com/t-bast/lightning-docs/)

## Recommended Skillset

Expand Down Expand Up @@ -82,6 +83,12 @@ The reason for this is two fold: it makes it easier for the reviewer to see what
made between versions (since Github doesn't easily show prior versions) and it makes it easier on
the PR author as they can set it to auto-squash the fixup commits on rebase.

When you have addressed a pull request comment, you should respond to it and point the reviewer
to the commit where you fixed it. A simple "This is fixed in <link_to_commit>" is enough. Do not
mark the comment as resolved: let the reviewer verify your commit, they will mark the comment
resolved if they agree with the fix. This makes it easier for reviewers to check that all their
comments have been addressed.

It's recommended to take great care in writing tests and ensuring the entire test suite has a
stable successful outcome; eclair uses continuous integration techniques and having a stable build
helps the reviewers with their job.
Expand Down Expand Up @@ -140,6 +147,14 @@ If your contribution is adding a new dependency, please detail:
Contributions that add new dependencies may take longer to approve because a detailed audit of the
dependency may be required.

### Testing

Your code should be tested. We use ScalaTest as a testing framework.

ScalaTest's approach is to parallelize on test suites rather than individual tests, therefore it is
recommended to keep the execution time of each test suite under one minute and split tests across
multiple smaller suites if needed.

### IntelliJ Tips

If you're using [IntelliJ](https://www.jetbrains.com/idea/), here are some useful commands:
Expand Down
40 changes: 27 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

**Eclair** (French for Lightning) is a Scala implementation of the Lightning Network.

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

---

Expand All @@ -25,6 +25,7 @@ This software follows the [Lightning Network Specifications (BOLTs)](https://git
* [Docker](#docker)
* [Plugins](#plugins)
* [Testnet usage](#testnet-usage)
* [Tools](#tools)
* [Resources](#resources)

---
Expand All @@ -43,10 +44,10 @@ For more information please visit the [API documentation website](https://acinq.

## Documentation

Please visit our [docs](./docs) and [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.
Please visit our [docs](./docs) folder to find detailed instructions on how to [configure](./docs/Configure.md) your
node, connect to other nodes, open channels, send and receive payments, and help with more advanced scenarios.

You will find detailed guides and frequently asked questions there.
You will also find detailed [guides](./docs/Guides.md) and [frequently asked questions](./docs/FAQ.md) there.

## Installation

Expand Down Expand Up @@ -95,7 +96,7 @@ Then download our latest [release](https://github.com/ACINQ/eclair/releases), un
eclair-node-<version>-<commit_id>/bin/eclair-node.sh
```

You can then control your node via the [eclair-cli](https://github.com/ACINQ/eclair/wiki/Usage) or the [API](https://github.com/ACINQ/eclair/wiki/API).
You can then control your node via [eclair-cli](./docs/Usage.md) or the [API](./docs/API.md).

:warning: Be careful when following tutorials/guides that may be outdated or incomplete. You must thoroughly read the official eclair documentation before running your own node.

Expand Down Expand Up @@ -168,15 +169,22 @@ eclair-node-<version>-<commit_id>/bin/eclair-node.sh -Declair.datadir=/tmp/node1

### Logging

Eclair uses [`logback`](https://logback.qos.ch) for logging. To use a different configuration, and override the internal logback.xml, run:
Eclair uses [`logback`](https://logback.qos.ch) for logging. To use a [different configuration](./docs/Logging.md), and override the internal logback.xml, run:

```shell
eclair-node-<version>-<commit_id>/bin/eclair-node.sh -Dlogback.configurationFile=/path/to/logback-custom.xml
```

### Backup

The files that you need to backup are located in your data directory. You must backup:
You need to backup:
- your Bitcoin Core wallet
- your Eclair channels

For Bitcoin Core, you need to backup the wallet file for the wallet that Eclair is using. You only need to do this once, when the wallet is
created. See [Managing Wallets](https://github.com/bitcoin/bitcoin/blob/master/doc/managing-wallets.md) in the Bitcoin Core documentation for more information.

For Eclair, the files that you need to backup are located in your data directory. You must backup:

* your seeds (`node_seed.dat` and `channel_seed.dat`)
* your channel database (`eclair.sqlite.bak` under directory `mainnet`, `testnet` or `regtest` depending on which chain you're running on)
Expand All @@ -198,7 +206,8 @@ 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.
A [Dockerfile](Dockerfile) x86_64 image is built on each commit on [docker hub](https://hub.docker.com/r/acinq/eclair) for running a dockerized eclair-node.
For arm64 platforms you can use an [arm64 Dockerfile](contrib/arm64v8.Dockerfile) to build your own arm64 container.

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

Expand All @@ -212,7 +221,7 @@ If you want to persist the data directory, you can make the volume to your host
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:
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 @@ -232,14 +241,14 @@ eclair-node-<version>-<commit_id>/bin/eclair-node.sh <plugin1.jar> <plugin2.jar>

### Non-exhaustive plugins list

Here are some plugins created by the eclair community.
Here are some plugins created by the Eclair community.
If you need support for these plugins, head over to their respective github repository.

* [Telegram Bot for eclair alerts](https://github.com/engenegr/eclair-alarmbot-plugin)
* [Telegram Bot for Eclair alerts](https://github.com/engenegr/eclair-alarmbot-plugin)

## Testnet usage

Eclair is configured to run on mainnet by default, but you can still run it on testnet (or regtest): start your Bitcoin Node in
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
Expand All @@ -248,7 +257,7 @@ 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,
so you can easily run your bitcoin node on both mainnet and testnet. For example you could use:
so you can easily run your Bitcoin node on both mainnet and testnet. For example you could use:

```conf
server=1
Expand All @@ -265,6 +274,11 @@ zmqpubhashblock=tcp://127.0.0.1:29001
zmqpubrawtx=tcp://127.0.0.1:29001
```

## Tools

* [Demo Shop](https://starblocks.acinq.co/) - an example testnet Lightning web shop.
* [Network Explorer](https://explorer.acinq.co/) - a Lightning network visualization tool.

## Resources

* [1] [The Bitcoin Lightning Network: Scalable Off-Chain Instant Payments](https://lightning.network/lightning-network-paper.pdf) by Joseph Poon and Thaddeus Dryja
Expand Down
65 changes: 65 additions & 0 deletions contrib/arm64v8.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
FROM eclipse-temurin:11-jdk-jammy 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 apt update && apt install -y curl tar bash

ARG MAVEN_VERSION=3.6.3
ARG USER_HOME_DIR="/root"
ARG SHA=c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0
ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries

RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
&& echo "${SHA} /tmp/apache-maven.tar.gz" | sha512sum -c - \
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
&& rm -f /tmp/apache-maven.tar.gz \
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn

ENV MAVEN_HOME /usr/share/maven
ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"

# Let's fetch eclair dependencies, so that Docker can cache them
# This way we won't have to fetch dependencies again if only the source code changes
# The easiest way to reliably get dependencies is to build the project with no sources
WORKDIR /usr/src
COPY pom.xml pom.xml
COPY eclair-core/pom.xml eclair-core/pom.xml
COPY eclair-front/pom.xml eclair-front/pom.xml
COPY eclair-node/pom.xml eclair-node/pom.xml
COPY eclair-node/modules/assembly.xml eclair-node/modules/assembly.xml
RUN mkdir -p eclair-core/src/main/scala && touch eclair-core/src/main/scala/empty.scala
# Blank build. We only care about eclair-node, and we use install because eclair-node depends on eclair-core
RUN mvn install -pl eclair-node -am
RUN mvn clean

# Only then do we copy the sources
COPY . .

# And this time we can build in offline mode, specifying 'notag' instead of git commit
RUN mvn package -pl eclair-node -am -DskipTests -Dgit.commit.id=notag -Dgit.commit.id.abbrev=notag -o
# 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:11.0.4-jre-slim
WORKDIR /app

# install jq for eclair-cli
RUN apt-get update && apt-get install -y bash jq curl unzip

# copy and install eclair-cli executable
COPY --from=BUILD /usr/src/eclair-core/eclair-cli .
RUN chmod +x eclair-cli && mv eclair-cli /sbin/eclair-cli

# we only need the eclair-node.zip to run
COPY --from=BUILD /usr/src/eclair-node/target/eclair-node-*.zip ./eclair-node.zip
RUN unzip eclair-node.zip && mv eclair-node-* eclair-node && chmod +x eclair-node/bin/eclair-node.sh

ENV ECLAIR_DATADIR=/data
ENV JAVA_OPTS=

RUN mkdir -p "$ECLAIR_DATADIR"
VOLUME [ "/data" ]

ENTRYPOINT JAVA_OPTS="${JAVA_OPTS}" eclair-node/bin/eclair-node.sh "-Declair.datadir=${ECLAIR_DATADIR}"
43 changes: 43 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# API

Eclair can setup a JSON API on the `eclair.api.port` port set in the [configuration](./Configure.md). You first need to enable it:

```
eclair.api.enabled=true
eclair.api.password=changeit
```

:rotating_light: **Attention:** Eclair's API should NOT be accessible from the outside world (similarly to Bitcoin Core API).

## Payment notification

Eclair accepts websocket connection on `ws://localhost:<port>/ws`, and emits a message containing the payment hash of a payment when receiving a payment.

## API calls

This API exposes all the necessary methods to read the current state of the node, open/close channels and send/receive payments. For the full documentation please visit https://acinq.github.io/eclair

#### Example: open a channel

Your node listens on 8081. You want to open a 140 mBTC channel with `endurance.acinq.co` on Testnet with a 30 mBTC `push`

1/ connect to the node with the URI:

```shell
curl -X POST \
-u :api_password \
-F uri="03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134@endurance.acinq.co:9735" \
http://127.0.0.1:8081/connect
```

2/ Open a channel with this node

```shell
curl -X POST \
-u :api_password \
-F nodeId=03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134 \
-F fundingSatoshis=14000000 \
http://127.0.0.1:8081/open
```

Feeling tired of writing all these `curls`? Good news, a CLI bash file is available. It uses this API to interact with your node. More information about `eclair-cli` is [here](./Usage.md).
10 changes: 5 additions & 5 deletions docs/Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ Here is a high-level view of the hierarchy of some of the main actors in the sys
And a short description of each actor's role:

- Switchboard: creates and deletes peers
- Peer: p2p connection to another lightning node (standard lightning messages described in [Bolt 1](https://github.com/lightningnetwork/lightning-rfc/blob/master/01-messaging.md))
- Channel: channel with another lightning node ([Bolt 2](https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md))
- Peer: p2p connection to another lightning node (standard lightning messages described in [Bolt 1](https://github.com/lightning/bolts/blob/master/01-messaging.md))
- Channel: channel with another lightning node ([Bolt 2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md))
- Register: maps channel IDs to actors (provides a clean boundary between channel and payment components)
- PaymentInitiator: entry point for sending payments
- Relayer: entry point for relaying payments
- PaymentHandler: entry point for receiving payments
- Router: p2p gossip and the network graph ([Bolt 7](https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md))
- Router: p2p gossip and the network graph ([Bolt 7](https://github.com/lightning/bolts/blob/master/07-routing-gossip.md))

Actors have two ways of communicating:

Expand All @@ -128,7 +128,7 @@ Let's dive into a few payment scenarios to show which actors are involved.
When we send a payment:

- we run a path-finding algorithm (`Router`)
- we split the payment into smaller chunks if [MPP](https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md#basic-multi-part-payments) is used (`MultiPartPaymentLifecycle`)
- we split the payment into smaller chunks if [MPP](https://github.com/lightning/bolts/blob/master/04-onion-routing.md#basic-multi-part-payments) is used (`MultiPartPaymentLifecycle`)
- we retry with alternative routes in some failure cases and record failing channels/payments (`PaymentLifecycle`)
- we add HTLCs to some of our channels

Expand Down Expand Up @@ -175,7 +175,7 @@ When we relay a payment:

- htlcs are forwarded by channels to the relayer
- the relayer identifies the type of relay requested and delegates work to a channel relayer or a node relayer
- if a node relayer is used ([trampoline payments](https://github.com/lightningnetwork/lightning-rfc/pull/829)):
- if a node relayer is used ([trampoline payments](https://github.com/lightning/bolts/pull/829)):
- incoming htlcs are validated by a payment handler (similar to the flow to receive payments)
- outgoing htlcs are sent out (similar to the flow to send payments)

Expand Down
Loading