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
HiddenServiceDir /var/lib/tor/lightning_service_v3/
HiddenServiceVersion 3
HiddenServicePort 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 
$ sudo cat /var/lib/tor/lightning_service_v3/hostname

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




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

Zoltán Gálli

Written by

Roman Catholic | Husband | Father | Geek | PGP Fingerprint: 116D 19B0 5C58 5B6D



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

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