Change tor
ℹ
Time: 5 minutes
Tor needs a few modifications so that you can communicate with LND from the outside. This way you can connect a mobile wallet to your Lightning node and use it anywhere.
⚠
Notice. As soon as someone gets hold of your macaroon files, your funds are no longer safe. You can also skip the Tor part and only use Lightning when you are on the same network as your node. Or use DDNS.
Open torrc:
sudo nano /etc/tor/torrcIn the torrc file (we have previously been here), add the following lines after what is already there.
SOCKSPort 9050HiddenServiceDir /var/lib/tor/lightning/restHiddenServiceVersion 3HiddenServicePort 8080 127.0.0.1:8080HiddenServiceDir /var/lib/tor/lightning/rpcHiddenServiceVersion 3HiddenServicePort 10009 127.0.0.1:10009Save the file with the key combination Ctrl + X. Enter Y in response to the prompt to save.
Create directories with:
sudo mkdir /var/lib/tor/lightningsudo mkdir /var/lib/tor/lightning/restsudo mkdir /var/lib/tor/lightning/rpcGive the appropriate permissions with:
sudo chown -R debian-tor:debian-tor /var/lib/tor/lightning/restsudo chown -R debian-tor:debian-tor /var/lib/tor/lightning/rpcsudo chmod 700 /var/lib/tor/lightning/restsudo chmod 700 /var/lib/tor/lightning/rpcTor should now be restarted.
sudo systemctl restart torOnion addresses
You get the onion addresses with:
sudo cat /var/lib/tor/lightning/rest/hostnamesudo cat /var/lib/tor/lightning/rpc/hostname