1
0
mirror of https://github.com/ACINQ/eclair.git synced 2024-11-20 02:27:32 +01:00
A scala implementation of the Lightning Network.
Go to file
sstone 14da69a612 router: consistency fixes
- use the same signature for main and mainWithLogs
- remove useless fields from Router.State
- start in 'uninitialized' mode and wait for State message (either empty or retrieved from db)
2017-02-28 15:14:03 +01:00
.readme Updated readme screenshot 2017-02-01 19:47:50 +01:00
eclair-node router: consistency fixes 2017-02-28 15:14:03 +01:00
travis removed old protobuf dependency and related module 2017-01-31 16:23:35 +01:00
.gitignore Added 'send' macro in test scenario (#10) 2016-05-31 13:04:09 +02:00
.travis.yml re-enabled travis tests 2017-01-17 19:09:06 +01:00
LICENSE now using sonatype repos for acinq-tools 2016-01-21 15:04:42 +01:00
pom.xml persist channels, peers, and router 2017-02-26 19:30:13 +01:00
README.md added warning about wip status 2016-11-16 15:14:34 +01:00
TESTING.md fixed tests covering OPEN->NORMAL 2016-12-09 17:08:16 +01:00

Eclair Logo

Eclair is a scala implementation of the Lightning Network. Eclair is french for Lightning.

🚧 This branch implements the Lightning Network Specifications, it is a work in progress.

Build Status


Overview

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

Eclair Demo

Installation

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.


Development

Set up the environment

⚠️ 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:
server=1
regtest=1
rpcuser=***
rpcpassword=***

Run

  • Download the sources and build the executable JAR with the following command:
$ mvn package -DskipTests
  • Start bitcoind
  • Mine enough blocks to activate segwit blocks:
$ bitcoin-cli generate 500
  • Navigate to eclair-node/target and execute the jar eclair-node_2.11-0.2-SNAPSHOT-xxxxxx-capsule-fat.jar
$ java 
     -Declair.bitcoind.rpcuser=foo
     -Declair.bitcoind.rpcpassword=bar
     -jar eclair-node_2.11-0.2-SNAPSHOT-xxxxxx-capsule-fat.jar
```

#### JVM Options

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


→ see [`application.conf`](eclair-node/src/main/resources/application.conf) for full reference.

#### Testing with lightningd

→ 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

---

## Project Status
- [X] Network
- [X] Routing (simple IRC prototype)
- [X] Channel protocol
- [X] HTLC Scripts
- [X] Unilateral close handling
- [X] Relaying Payment
- [ ] Fee management
- [X] Blockchain watcher
- [ ] Storing states in a database

## 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