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!
Prerequisites: I already had a Linux operation system, a Bitcoin full node and Tor up and running.
Setup Tor hidden services
Running a Tor hidden service in itself is not complicated and not illegal in most of the countries. Besides it could be a really great help for those who live in an oppressive regime.
First we open
/etc/tor/torrc file and insert some extra line to create a version 2 and a version 3 hidden service:
HiddenServicePort 9735 127.0.0.1:9735HiddenServiceDir /var/lib/tor/lightning_service_v3/
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
$ sudo cat /var/lib/tor/lightning_service_v3/hostname
Lightning daemon configuration
c-lightning implementation can be downloaded from GitHub. The
lightningd daemon has lot of parameters which can be configured from command line or from a config file. This is my
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.
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
Patience, this technology and network is not mature yet! If it does not work first time take another try. And another. And another.
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!
hsm_secret file! It is the seed for the wallet’s private keys!
Here is my lightning node URI, join me!
Thanks to those who are walking in front of me on the road!