haveno-dex / haveno

Decentralized P2P exchange platform built on Monero and Tor
https://haveno.exchange
GNU Affero General Public License v3.0
929 stars 96 forks source link

Add a button to switch tor circuits. #947

Open shortwavesurfer2009 opened 1 month ago

shortwavesurfer2009 commented 1 month ago

Currently, if things are taking a long time to load or timeouts are occurring, you have to completely shut down the application and restart it in order to get a new tor circuit. This seems really inefficient when there could just be a button somewhere in the user interface to do so.

Edit: Add an information dialog to the effect that it can take X time to re-establish the connection where the user must press an OK or cancel button.

boldsuck commented 1 month ago

A hacky workaround I use: Haveno torrc ControlPort auto cannot be overwritten¹, so the default is random. Find Haveno Tor control port ~$ ss -tulpn start Nyx ~$ nyx -i <Port> press 'n' for a new identity.

¹You can by modifying a file inside the main jar file of Haveno, desktop-version-number-SNAPSHOT-all.jar

preland commented 1 month ago

This would be smart; adding a way to view the tor log would also help*. That way, you wouldn’t have to guess on having to switch tunnels and put too much stress on the network.

*: despite me being the (main) guy that currently does the tor stuff for Haveno, I have absolutely no clue if this is even possible with the current implementation

boldsuck commented 1 month ago

Tor-nyx formerly known as tor-arm shows the log, connections and more. Nyx is available for Mac OS, Linux, and BSD.

We can add torrc entries to modify Haveno's torrc and I have the tor logs written like this. I added in ~/.local/share/Haveno-reto/haveno.properties the configuration line: torrcOptions=%include /home/user/.local/share/Haveno-reto/torrc.local

I can then insert all the desired torrc configs into the locale torrc. Note that torrc-entries, which are critical to Haveno's correct operation, cannot be overwritten.

## Send all messages of level 'notice' or higher to ~/.local/share/Haveno-reto/xmr_mainnet/tor/notices.log
Log notice file /home/user/.local/share/Haveno-reto/xmr_mainnet/tor/notices.log

My example torrc.local I use a list of fast and stable Tor nodes for Haveno, Bisq, etc.