Author

Topic: Lightning Network - Eclair: Installation of a testnet LN-node (Read 322 times)

newbie
Activity: 1
Merit: 0
One has to add, that Eclair is not ready for the mainnet yet. Coins can get lost, when the server is shut down, or the version of Eclair changes. So stay with the testnet.
legendary
Activity: 1778
Merit: 1070

Code:
testnet=1
server=1
rpcuser=
rpcpassword=
txindex=1
zmqpubrawblock=tcp://127.0.0.1:29000
zmqpubrawtx=tcp://127.0.0.1:29000


If i miss the "testnet=1" flag, i'll be running it on the Mainnet ?

This is very likely. Haven't tried that yet.

But beware, bitcoin core will download the complete (!) bitcoin blockchain which has roughly 150GB.   
legendary
Activity: 3584
Merit: 5243
https://merel.mobi => buy facemasks with BTC/LTC

Code:
testnet=1
server=1
rpcuser=
rpcpassword=
txindex=1
zmqpubrawblock=tcp://127.0.0.1:29000
zmqpubrawtx=tcp://127.0.0.1:29000


If i miss the "testnet=1" flag, i'll be running it on the Mainnet ?

What do you mean, it's the first line in bitcoin.conf file posted by curiosity81. Since his post was last edited 2 days ago, and your post is less than 1 day ago, the line should have already been there at the time you were creating your post???
newbie
Activity: 5
Merit: 0

Code:
testnet=1
server=1
rpcuser=
rpcpassword=
txindex=1
zmqpubrawblock=tcp://127.0.0.1:29000
zmqpubrawtx=tcp://127.0.0.1:29000


If i miss the "testnet=1" flag, i'll be running it on the Mainnet ?
legendary
Activity: 3584
Merit: 5243
https://merel.mobi => buy facemasks with BTC/LTC
Guys, get on with it.

 Angry Angry Angry

And do not always think on the money! Bitcoin is worthless without the technology.

Here you find even a simpler method for playing with the LN:

https://github.com/LN-Zap/zap-desktop/releases/tag/v0.1.0-beta

For installation and usage see (in german):

https://bitcointalksearch.org/topic/lightning-netzwerk-zap-nutzung-einer-ln-wallet-im-testnetz-2837939

Is that while Blockchain technology can be replicated without bitcoin purposely, there has to be some kind of token allied with the ledger in order for the system to work.

I have no idear what you're trying to ask/tell us. Maybe it would be a good starting point to read up on the lightning network?
newbie
Activity: 26
Merit: 0
Guys, get on with it.

 Angry Angry Angry

And do not always think on the money! Bitcoin is worthless without the technology.

Here you find even a simpler method for playing with the LN:

https://github.com/LN-Zap/zap-desktop/releases/tag/v0.1.0-beta

For installation and usage see (in german):

https://bitcointalksearch.org/topic/lightning-netzwerk-zap-nutzung-einer-ln-wallet-im-testnetz-2837939

Is that while Blockchain technology can be replicated without bitcoin purposely, there has to be some kind of token allied with the ledger in order for the system to work.
legendary
Activity: 1778
Merit: 1070
I've been running a c-lightning node on the testnet for a while now...
The reason i chose c-lightning over eclair was that i don't really like running java applications on my sever (i find them slower and more resource intensive than compiled c code) and i like to run a headless server.

Can eclair be run as a daemon, or only as a gui application?

I did not tested that yet. But there is a pure node jar:

https://bitcointalksearch.org/topic/lightning-netzwerk-zap-nutzung-einer-ln-wallet-im-testnetz-2837939

I also think there was a kind of cli mode ...
legendary
Activity: 3584
Merit: 5243
https://merel.mobi => buy facemasks with BTC/LTC
I've been running a c-lightning node on the testnet for a while now...
The reason i chose c-lightning over eclair was that i don't really like running java applications on my sever (i find them slower and more resource intensive than compiled c code) and i like to run a headless server.

Can eclair be run as a daemon, or only as a gui application?
legendary
Activity: 1778
Merit: 1070
Guys, get on with it.

 Angry Angry Angry

And do not always think on the money! Bitcoin is worthless without the technology.

Here you find even a simpler method for playing with the LN:

https://github.com/LN-Zap/zap-desktop/releases/tag/v0.1.0-beta

For installation and usage see (in german):

https://bitcointalksearch.org/topic/lightning-netzwerk-zap-nutzung-einer-ln-wallet-im-testnetz-2837939
legendary
Activity: 1778
Merit: 1070
Hi guys,

following a tutorial for installing eclair (you find the original thread here: https://bitcointalksearch.org/topic/lightning-netzwerk-eclair-aufsetzen-eines-ln-knoten-im-testnetz-2778084).



Additional references

Lightning 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/eclair
Current 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 "" and need to be replaced correspondingly



Enter the Download-directory (exits in Ubuntu by default):

Code:
cd /home/curiosity81/Downloads



Bitcoin Core (before synchronizing)

Download bitcoin core (https://bitcoin.org/en/download):

Code:
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:

Code:
wget https://bitcoin.org/laanwj-releases.asc

Import the key:

Code:
gpg --import laanwj-releases.asc

Finally get the hash sums of the files:

Code:
wget https://bitcoin.org/bin/bitcoin-core-0.15.1/SHA256SUMS.asc

Verify bitcoin core before unpacking:

Code:
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:

Code:
tar -xzvf bitcoin-0.15.1-x86_64-linux-gnu.tar.gz

And adapt the configuration file:

Code:
mkdir /home/curiosity81/.bitcoin
nano /home/curiosity81/.bitcoin/bitcoin.conf

Save the following lines in the configuration file:

Code:
testnet=1
server=1
rpcuser=
rpcpassword=
txindex=1
zmqpubrawblock=tcp://127.0.0.1:29000
zmqpubrawtx=tcp://127.0.0.1:29000

The placeholders and have to be replaced correspondingly. Save and exit nano with Strg+X.

Start bitcoin core:

Code:
/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.8

For 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:

Code:
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:

Code:
sha256sum jre-8u162-linux-x64.tar.gz | grep -o dfa25ebd1f90bf74ad7ba2dacb0e08d884594e733c9a522b58256778031341a4

If everything is ok, then unpack the file:

Code:
tar -xzfv jre-8u162-linux-x64.tar.gz

And install java (https://wiki.ubuntuusers.de/Java/Installation/Oracle_Java/Java_8/):

Code:
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:

Code:
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.



Eclair

We 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):

Code:
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:

Code:
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:

Code:
getnewaddress

We keep this address, in my case:

mtDmzMz7NvuRjptrLWwbdVBs4j7Y3eXvCV

Then,

Code:
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/faucet

Insert the segwit address and you will get some testnet BTC. Clearly, this will take 1h until the transaction is confirmed 6 times.



Eclair configuration

Enter the Download-directory again:

Code:
cd /home/curiosity81/Downloads

If the configuration directory of eclair is not existent, create it:

Code:
mkdir /home/curiosity81/.eclair

Then edit eclair.conf:

Code:
nano /home/curiosity81/.eclair/eclair.conf

Add the following lines to the file:

Code:
eclair.server.port=9735
eclair.node-alias="curiosity81"
eclair.node-color="9716b7"
eclair.bitcoind.rpcuser=""
eclair.bitcoind.rpcpassword=""
eclair.bitcoind.zmq="tcp://127.0.0.1:29000"
eclair.server.public-ips=["xx.xx.xx.xx"]

The placeholders and 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:

Code:
java -jar eclair-node-gui-0.2-alpha8-8edb2a4.jar

And tada, the eclair-GUI should open.



Connecting to the Lightning Netzwerk

Visit:

https://explorer.acinq.co

Select 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):

Code:
Alias:         pikefloyd
Publickey:     03c4b20397d476a0d008e61022c96803ada3c11918fff8133db4f7d27273710e03
IP und Port:   81.149.149.156:9735

From this, built the following ID from publickey, IP and port:

Code:
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 channels

As 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 Network

To 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 similar

At https://explorer.acinq.co/#/faq, the last point:

Quote
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.
Jump to: