My Lightning Node setup with c-lightning

As Blockstream announced the release of c-lightning, this may be a good time to launch a mainnet Lightning Network Node!

Zoltán Gálli
Jul 11, 2018 · 3 min read

Prerequisites: I already had a Linux operation system, a Bitcoin full node and Tor up and running.

Setup Tor hidden services

First we open /etc/tor/torrc file and insert some extra line to create a version 2 and a version 3 hidden service:

HiddenServiceDir /var/lib/tor/lightning_service_v2/
HiddenServiceVersion 2
HiddenServicePort 9735 127.0.0.1:9735
HiddenServiceDir /var/lib/tor/lightning_service_v3/
HiddenServiceVersion 3
HiddenServicePort 9735 127.0.0.1:9735

After modifying torrc, Tor service needs to be restarted for the change to take effect: $ systemctl restart tor@default

Tor now generates two new hidden services. We can check their onion addresses:

$ sudo cat /var/lib/tor/lightning_service_v2/hostname 
yqygrtvwihl3exb2.onion
$ sudo cat /var/lib/tor/lightning_service_v3/hostname
ihhsjdncang7ve2rvhuunvy45bxvmh2qwz3vh7mohbouizd36ywnxeid.onion

Lightning daemon configuration

An empty address for bind-addr is needed to listen on all interfaces. So the node is accessible for incoming Tor and clearnet connections simultaneously.

announce-addr can be used multiple times to add more addresses, this way the daemon can announce IPv4, Torv2 and Torv3 addresses.

For default-fee-rate 4000 Satoshi per kwu is a very low value, but currently it is enough.

proxy 127.0.0.1:9050 is for outgoing Tor connection. This way we can connect to other hidden services.

Running the node

Tips & Tricks

Multiple lightning node instance can run on the same machine. If no other help, you may start another instance to check your first setup is operational.

Some explorer site could not see my node info because of the Tor addresses and some issues in the gossip implementation. Explorers show no alias, no color, no URI. To fix this I started my node with only my IPv4 address and waited for a few minutes to see if it appears on explorers. After that I restarted it with Tor and IPv4 addresses.

See Something Say Something: if you encounter any difficulties consider to open an issue at GitHub. If you manage to fix some problem, write about it somewhere public. Next people facing with the same issue will find it and will be grateful for it!

Backup your hsm_secret file! It is the seed for the wallet’s private keys!

Here is my lightning node URI, join me!

03d67f36c4f81789e2fe425028bacc96b199813eae426c517f589a45f1136c1fe5@89.133.16.197:973503d67f36c4f81789e2fe425028bacc96b199813eae426c517f589a45f1136c1fe5@yqygrtvwihl3exb2.onion:973503d67f36c4f81789e2fe425028bacc96b199813eae426c517f589a45f1136c1fe5@ihhsjdncang7ve2rvhuunvy45bxvmh2qwz3vh7mohbouizd36ywnxeid.onion:9735

Resources

Coinmonks

Coinmonks is a non-profit Crypto educational publication. Follow us on Twitter @coinmonks Our other project — https://coincodecap.com

Zoltán Gálli

Written by

Roman Catholic | Husband | Father | Geek | https://zoltan.xyz/ PGP Fingerprint: 116D 19B0 5C58 5B6D

Coinmonks

Coinmonks

Coinmonks is a non-profit Crypto educational publication. Follow us on Twitter @coinmonks Our other project — https://coincodecap.com

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade