2016-10-18 16:37:32 +02:00

2016-01-21 15:39:56 +01:00
2016-10-18 16:23:31 +02:00
**Eclair** is a scala implementation of the Lightning Network. Eclair is french for Lightning.
2016-01-21 15:39:56 +01:00
2016-11-16 15:14:34 +01:00
:construction: This branch implements the [Lightning Network Specifications ](https://github.com/lightningnetwork/lightning-rfc ), it is a work in progress.
2016-01-21 15:39:56 +01:00
2016-11-16 15:14:34 +01:00
[](https://travis-ci.org/ACINQ/eclair)
2016-10-18 16:23:31 +02:00
---
2016-01-21 15:39:56 +01:00
## Overview
2016-10-18 16:23:31 +02:00
This software creates a node compatible with a Lightning network and provides a GUI to manage the node. A JSON-RPC API is available if you prefer to run it headless.
Available actions:
- Open a channel with another eclair or lightningd instance
- Display opened channels with the node (status, balance, capacity, ...)
- Receive payments from another node
- Send payments to another node

## Installation
2016-01-21 15:39:56 +01:00
2016-10-18 16:23:31 +02:00
The project is under heavy development and no release is available yet. Still you can download the sources, compile the project with Maven (cf §Development) and run it on localhost.
2016-01-21 15:40:51 +01:00
2016-10-18 16:23:31 +02:00
---
2016-02-16 18:03:40 +01:00
2016-10-18 16:23:31 +02:00
## Development
2016-02-16 18:03:40 +01:00
2016-10-18 16:23:31 +02:00
#### Set up the environment
- JDK 1.8+
- [Latest Scala installation ](http://www.scala-lang.org/download/ )
- [Maven ](https://maven.apache.org/download.cgi )
- A segwit version of bitcoin core in testnet or regtest mode
2016-02-17 16:45:24 +01:00
2016-10-18 16:23:31 +02:00
:warning: eclair currently runs on regtest/segnet only. **Do not try and modify it to run on bitcoin mainnet!**
- Make sure that bitcoin-cli is on the path and edit ~/.bitcoin/bitcoin.conf and add:
2016-11-14 17:19:29 +01:00
```
2016-10-18 16:23:31 +02:00
server=1
regtest=1
rpcuser=***
rpcpassword=***
2016-02-16 17:55:10 +01:00
```
2016-10-18 16:23:31 +02:00
#### Run
- Download the sources and build the executable JAR with the following command:
2016-11-14 17:19:29 +01:00
```shell
$ mvn package -DskipTests
2016-02-16 17:55:10 +01:00
```
2016-10-18 16:23:31 +02:00
- Start bitcoind
- Mine enough blocks to activate segwit blocks:
```shell
2016-11-14 17:19:29 +01:00
$ bitcoin-cli generate 500
2016-02-16 17:55:10 +01:00
```
2016-10-18 16:23:31 +02:00
- Navigate to `eclair-node/target` and execute the jar `eclair-node_2.11-0.2-SNAPSHOT-xxxxxx-capsule-fat.jar`
2016-11-14 17:19:29 +01:00
````shell
$ java
-Declair.bitcoind.rpcuser=foo
-Declair.bitcoind.rpcpassword=bar
-jar eclair-node_2.11-0.2-SNAPSHOT-xxxxxx-capsule-fat.jar
```
2016-02-16 18:03:40 +01:00
2016-10-18 16:23:31 +02:00
#### JVM Options
2016-02-16 17:55:10 +01:00
2016-10-18 16:23:31 +02:00
option | default value | description
-----------------------------|---------------------------|---------
eclair.server.port | TCP port | 9735
eclair.http.port | HTTP port | 8080
eclair.bitcoind.rpcuser | Bitcoin Core RPC user | foo
eclair.bitcoind.rpcpassword | Bitcoin Core RPC password | bar
2016-10-18 16:37:32 +02:00
→ see [`application.conf` ](eclair-node/src/main/resources/application.conf ) for full reference.
2016-10-18 16:23:31 +02:00
#### Testing with lightningd
2016-02-16 18:03:40 +01:00
2016-10-18 16:37:32 +02:00
→ Checkout [our guide ](TESTING.md )
## JSON-RPC API
method | params | description
-------------|-------------------------------------|-----------------------------------------------------------
connect | host, port, anchor_amount | opens a channel with another eclair or lightningd instance
list | | lists existing channels
addhtlc | channel_id, amount, rhash, locktime | sends an htlc
fulfillhtlc | channel_id, r | fulfills an htlc
close | channel_id | closes a channel
help | | displays available methods
2016-02-16 17:55:10 +01:00
2016-10-18 16:23:31 +02:00
---
2016-01-21 15:39:56 +01:00
2016-10-18 16:23:31 +02:00
## Project Status
2016-02-15 16:04:07 +01:00
- [X] Network
2016-08-31 16:51:16 +02:00
- [X] Routing (simple IRC prototype)
2016-02-24 11:48:56 +01:00
- [X] Channel protocol
2016-01-21 15:39:56 +01:00
- [X] HTLC Scripts
2016-08-31 16:51:16 +02:00
- [X] Unilateral close handling
- [X] Relaying Payment
2016-02-24 11:44:14 +01:00
- [ ] Fee management
2016-01-21 15:39:56 +01:00
- [X] Blockchain watcher
2016-01-22 10:21:05 +01:00
- [ ] Storing states in a database
2016-01-21 15:39:56 +01:00
2016-07-22 16:33:21 +02:00
## 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
## Other implementations
Name | Language | Compatible
-------------|----------|------------
[Amiko-Pay] | Python | no
[lightning-c]| C | yes
[lnd] | Go | no
[Thunder] | Java | no
[Amiko-Pay]: https://github.com/cornwarecjp/amiko-pay
[lightning-c]: https://github.com/ElementsProject/lightning
[lnd]: https://github.com/LightningNetwork/lnd
[Thunder]: https://github.com/blockchain/thunder