lightning-power-users / node-launcher

Easiest Bitcoin Lightning desktop app, for Windows, macOS, and Linux
MIT License
358 stars 66 forks source link

add option for Tor Relay #342

Open elkimek opened 5 years ago

elkimek commented 5 years ago

The idea is simple. Tor is very important for the privacy of the internet and it's users and with the growth and adoption of Lightning Network, we need the Tor faster and more responsive. From what I understand the more latency is across the routing path, the less hops happens and the less chance is that the payment will reach its destination if Tor is used.

I think if decent part of LN nodes run Tor Relay too and donate stable and decent bandwidth, it would help Lightning Network and Tor too.

LN is growing and so is it's usage of Tor. If we won't support the Tor network back, it won't end up good if (when) LN adoption happens.

Lets have a simple option to became Tor Relay on Node Launcher.

Best to start here:

https://trac.torproject.org/projects/tor/wiki/TorRelayGuide

or here is nice bootstrap script:

https://github.com/coldhakca/tor-relay-bootstrap

NYX is usefull "front-end" with all setting and monitoring:

https://nyx.torproject.org/

PS.: The most important thing would be an explanation in Node Lancher's UX why is it important and why NL's users should consider to became Tor Relay

freehodl commented 5 years ago

@PierreRochard I love this and I've been looking at how we can make it happen. I recently got my Tor relay set up along side my node and here's what I'm finding.

1) The Tor Relay needs to run as a separate Tor process. I got the error:

Tor is currently configured as a relay and a hidden service. That's not very secure: you should probably run your hidden service in a separate Tor process, at least -- see https://trac.torproject.org/8742

Even though this may just be a bug and not actually dangerous, to be safe I made a new torrc.1 file and used the https://trac.torproject.org/projects/tor/wiki/TorRelayGuide to configure properly then called w/ a bash command

tor -f /etc/tor/torrc.1

That runs as a separate process. I think we could easily add the path to this torrc.1 file to the constants.py for reference and then create a tor_relay_configuration.py file that creates and writes the configuration edits to the new torrc.1 file. So far I'm only running this on Linux but from what I can tell the setup will be more or less the same on Mac and Windows.

2) I think the biggest issue is going to be port forwarding. To run a Tor Relay the user will have to open ports (i.e. 443, 9001) on their router. Maybe we provide links to common router instructions somewhere to help with this?

3) I agree with @elkimek that the most important thing is explaining why it is important and why users should consider running a Tor Relay. However, we can certainly automate some of the configuration and provide them with resources.