Hi guys,
following a tutorial for installing eclair (you find the original thread here:
https://bitcointalk.org/index.php?topic=2778084.0).
Additional referencesLightning network megathread:
https://www.reddit.com/r/Bitcoin/comments/7pwna9/lightning_network_megathread/Questions are answered here, provided one owns a github account:
https://gitter.im/ACINQ/eclairCurrent state of lightning network (mainnet):
https://lnmainnet.gaben.win/Graph of developmental state of lightning network (mainnet):
https://p2sh.info/dashboard/db/lightning-network?orgId=1
Requirements- Computer with 64bit cpu, will work analogously on a 32bit system but with different files
- Ubuntu 16.04 LTS (http://de.releases.ubuntu.com/16.04.3/), will certainly also work with other versions
- Computer should be independent, OS newly installed and separated from important data
- You should be experienced working with linux, network and similar
- A fast network connection should be available
- Needs roughly 2 hours since 2 Bitcoin transactions are necessary
- User "curiosity81", needs to be replaced
- Placeholders are "<password>" and need to be replaced correspondingly
Enter the Download-directory (exits in Ubuntu by default):
cd /home/curiosity81/Downloads
Bitcoin Core (before synchronizing)Download bitcoin core (
https://bitcoin.org/en/download):
wget https://bitcoin.org/bin/bitcoin-core-0.15.1/bitcoin-0.15.1-x86_64-linux-gnu.tar.gz
Additionally, download the signature of von van der Laan:
wget https://bitcoin.org/laanwj-releases.asc
Import the key:
gpg --import laanwj-releases.asc
Finally get the hash sums of the files:
wget https://bitcoin.org/bin/bitcoin-core-0.15.1/SHA256SUMS.asc
Verify bitcoin core before unpacking:
gpg --verify SHA256SUMS.asc
sha256sum bitcoin-0.15.1-x86_64-linux-gnu.tar.gz | grep -o 387c2e12c67250892b0814f26a5a38f837ca8ab68c86af517f975a2a2710225b
The hex number is included in SHA256SUM.asc and belongs to the downloaded file. If grep reports something, then everything is ok. Probably, there are more elegant ways to verify.
Unpack bitcoin core:
tar -xzvf bitcoin-0.15.1-x86_64-linux-gnu.tar.gz
And adapt the configuration file:
mkdir /home/curiosity81/.bitcoin
nano /home/curiosity81/.bitcoin/bitcoin.conf
Save the following lines in the configuration file:
testnet=1
server=1
rpcuser=<user>
rpcpassword=<password>
txindex=1
zmqpubrawblock=tcp://127.0.0.1:29000
zmqpubrawtx=tcp://127.0.0.1:29000
The placeholders <user> and <password> have to be replaced correspondingly. Save and exit nano with Strg+X.
Start bitcoin core:
/home/curiosity81/Downloads/bitcoin-0.15.1/bin/bitcoin-qt
Bitcoin core is synchronizing now with the testnet. This takes a while (around 1.5h).
JRE 1.8For eclair, a Java Runtime Environment is necessary. JRE 1.8 from Oracle is recommended. Make sure that you satisfy the license conditions before you install the software.
Visit (firefox)
http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html and choose
jre-8u162-linux-x64.tar.gz
Confirm the License Agreement if it applies to you and start the download. The File is saved in the download directory. Since bitcoin core is likely still synchronizing, open a new terminal and enter the download directory again:
cd /home/curiosity81/Downloads
Verify the hash sum again. Therefore, click on the download page (
http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html), at the top
JRE 8u162 Checksum
on the "Checksum" link and save the 256sha value for the correct file:
dfa25ebd1f90bf74ad7ba2dacb0e08d884594e733c9a522b58256778031341a4
Test the hash:
sha256sum jre-8u162-linux-x64.tar.gz | grep -o dfa25ebd1f90bf74ad7ba2dacb0e08d884594e733c9a522b58256778031341a4
If everything is ok, then unpack the file:
tar -xzfv jre-8u162-linux-x64.tar.gz
And install java (
https://wiki.ubuntuusers.de/Java/Installation/Oracle_Java/Java_8/):
sudo mkdir /opt/Oracle_Java
sudo cp jre1.8.0_162/ /opt/Oracle_Java/ -R
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/Oracle_Java/jre1.8.0_162/bin/java" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/opt/Oracle_Java/jre1.8.0_162/bin/javaws" 1
sudo update-alternatives --set "java" "/opt/Oracle_Java/jre1.8.0_162/bin/java"
sudo update-alternatives --set "javaws" "/opt/Oracle_Java/jre1.8.0_162/bin/javaws"
java -version
If the last command reports the version as follows:
java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)
Then everything was done correctly. Let's go on.
EclairWe are still in the Download-directory in the second terminal. Download eclair (
https://github.com/ACINQ/eclair). We are lazy and do not want to compile anything. So we are happy with the precompiled jar-file (Check:
https://github.com/ACINQ/eclair/releases for newer releases):
wget https://github.com/ACINQ/eclair/releases/download/v0.2-alpha8/eclair-node-gui-0.2-alpha8-8edb2a4.jar
That's it. Unfortunately, there is nothing more to verify.
Important: So that eclair works correctly, bitcoin core must run in parallel! After:
java -jar eclair-node-gui-0.2-alpha8-8edb2a4.jar
Something should happen, even though the program is not configured yet and ends with an error message.
Bitcoin core (after synchronyzing)In the GUI:
Help -> Debug window -> Console
There:
We keep this address, in my case:
mtDmzMz7NvuRjptrLWwbdVBs4j7Y3eXvCV
Then,
addwitnessaddress mtDmzMz7NvuRjptrLWwbdVBs4j7Y3eXvCV
Creates a segwit address, in my case:
2MswDJ1kf9aqiC6twrDyUbLqGmtnjtFG4XX
We also keep this address.
Now we need money for playing. Go to:
https://testnet.manu.backend.hamburg/faucetInsert the segwit address and you will get some testnet BTC. Clearly, this will take 1h until the transaction is confirmed 6 times.
Eclair configurationEnter the Download-directory again:
cd /home/curiosity81/Downloads
If the configuration directory of eclair is not existent, create it:
mkdir /home/curiosity81/.eclair
Then edit eclair.conf:
nano /home/curiosity81/.eclair/eclair.conf
Add the following lines to the file:
eclair.server.port=9735
eclair.node-alias="curiosity81"
eclair.node-color="9716b7"
eclair.bitcoind.rpcuser="<user>"
eclair.bitcoind.rpcpassword="<password>"
eclair.bitcoind.zmq="tcp://127.0.0.1:29000"
eclair.server.public-ips=["xx.xx.xx.xx"]
The placeholders <user> and <password> must be replaced by the corresponding values in the bitcoin.conf. Save and exit nano with Ctrl+X. eclair.server.public-ips can be set to your IP, then your node will be visible at
https://explorer.acinq.co. Only this way other users can connect to your node. But eclair will also work with "xx.xx.xx.xx".
Start eclair again:
java -jar eclair-node-gui-0.2-alpha8-8edb2a4.jar
And tada, the eclair-GUI should open.
Connecting to the Lightning NetzwerkVisit:
https://explorer.acinq.coSelect a node. Either by clicking on the map or in the scroll down menu on the right. After clicking, more information about a node is shown, like alias, publickey or IP. I used the node "pikefloyd" at the beginning. Whose data is as follows (clearly nodes can disappear of their data changes, so be flexible):
Alias: pikefloyd
Publickey: 03c4b20397d476a0d008e61022c96803ada3c11918fff8133db4f7d27273710e03
IP und Port: 81.149.149.156:9735
From this, built the following ID from publickey, IP and port:
03c4b20397d476a0d008e61022c96803ada3c11918fff8133db4f7d27273710e03@81.149.149.156:9735
In the eclair-GUI, choose: Channels -> Open channel ...
There, at "Target Node URI", the ID is inserted. Click on "Simple connection (no channel)" and press "Connect". After a while, the GUI should fill with information to nodes and channels.
Creating payment channelsAs described above, select a node in the LN and copy the ID into the "Target Node URI" field. This time do NOT click on "Simple connection (no channel)"! Additionally, choose a bitcoin amount and insert it into the "Capacity" field. The amount must be less or equal to the amount in your bitcoin core test wallet. Press "Connect". Bitcoin core should report an outgoing transaction + fees. Eclair should show a new payment channel. Now wait 6 confirmations.
Paying with the Lightning NetworkTo pay with LN you need a payment order from someone you own money (
https://medium.com/@btc_coach/lightning-network-in-action-b18a035c955d). So there are no public addresses where you can send your money. This is due to the payment routing through the network (see 9:00 in
https://www.youtube.com/watch?v=wIhAmTqXhZQ)
If someone ows you money go to: Channels -> Receive Payment. There at "Optional amount to receive" insert the corresponding amount and press "Generate". The result must be sent to the person who owes you money.
Here you can by coffee with testnet money:
https://starblocks.acinq.co
Port forwarding and similarAt
https://explorer.acinq.co/#/faq, the last point:
I cannot connect to a node listed in the explorer.
Connection can fail due to one of the following reasons:
The node is currently offline right now (any channels it might have are temporarily unavailable but stay open).
The node does not announce a public IP.
The public IP announced by the node is not accurate.
The node is not reachable (misconfiguration in port forwarding, firewall...).
...
Eclair works without port forwarding. Simple paying in the LN will always work. Even with closed port 9735. However, with closed port 9735 no one can connect to you node even though you can connect to nodes with open port 9735. As a result, keep this port open. If people call other people via telephon, but if no one picks up, then the telephone is useless.