2016-02-15 14:49:23 +01:00
[](https://travis-ci.org/ACINQ/eclair)
2015-08-19 13:47:01 +02:00
# eclair
2016-01-21 15:39:56 +01:00
A scala implementation of the Lightning Network. Eclair is french for Lightning.
2016-07-22 16:33:21 +02:00
This software follows the [BOLT specifications ](https://github.com/rustyrussell/lightning-rfc ), therefore it is compatible with Blockstream's [lightning-c ](https://github.com/ElementsProject/lightning ).
2016-01-21 15:39:56 +01:00
## Overview
2016-01-21 15:40:51 +01:00
The general idea is to have an actor per channel, everything being non-blocking.
2016-01-21 15:39:56 +01:00
A "blockchain watcher" is responsible for monitoring the blockchain, and sending events (eg. when the anchor is spent).
2016-01-21 15:40:51 +01:00
## Modules
* lightning-types: scala code generation using protobuf's compiler (wire protocol)
2016-08-26 18:31:12 +02:00
* eclair-node: actual implementation
2016-01-21 15:40:51 +01:00
2016-01-21 15:39:56 +01:00
## Usage
2016-02-16 18:03:40 +01:00
Prerequisites:
- A JRE or JDK depending on wether you want to compile yourself or not (preferably > 1.8)
2016-07-22 16:33:21 +02:00
- A running bitcoin-demo (testnet or regtest)
2016-02-16 18:03:40 +01:00
2016-07-22 16:33:21 +02:00
:warning: **eclair currently runs on segnet only. Do not try and modify it to run on bitcoin mainnet!**
2016-02-17 16:45:24 +01:00
2016-02-16 18:03:40 +01:00
Either run from source:
2016-02-16 17:55:10 +01:00
```
mvn exec:java -Dexec.mainClass=fr.acinq.eclair.Boot
```
2016-02-16 18:03:40 +01:00
Or grab the latest released jar and run:
2016-02-16 17:55:10 +01:00
```
2016-08-26 18:31:12 +02:00
java -jar eclair-core_2.11-*-capsule-fat.jar
2016-02-16 17:55:10 +01:00
```
2016-02-16 18:03:40 +01:00
2016-02-16 17:55:10 +01:00
*See [TESTING.md ](TESTING.md ) for more details on how to use this software.*
2016-02-16 18:03:40 +01:00
Available jvm options (see `application.conf` for full reference):
```
eclair.server.port (default: 45000)
eclair.http.port (default: 8080)
eclair.bitcoind.rpcuser (default: foo)
eclair.bitcoind.rpcpassword (default: bar)
```
2016-02-16 17:55:10 +01:00
## 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
2016-02-17 11:57:24 +01:00
help | | displays available methods
2016-01-21 15:39:56 +01:00
## Status
2016-02-15 16:04:07 +01:00
- [X] Network
2016-01-21 15:39:56 +01:00
- [ ] Routing
2016-02-24 11:48:56 +01:00
- [X] Channel protocol
2016-01-21 15:39:56 +01:00
- [X] HTLC Scripts
2016-01-22 10:21:05 +01:00
- [ ] Unilateral close handling
2016-01-21 15:39:56 +01:00
- [ ] 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