-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: use libtor to spawn in-process Tor for base node and console wallet #3641
Conversation
…allet BREAKING CHANGE: old config files *might* not work correctly
Going to need an update for build base node binaries CI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, very cool that tor can be embedded. Changing the address each time will cause connectivity issues that can be hard to debug (nodes not connecting when they are online, not noticing the address has changed)
Breaks the build on windows, looking for a solution |
Just to clarify - the public address remains the same and is loaded from the node identity file, it is just the Tor control port and socks port that are checked for availability in the port range and selected. |
Ok cool, sounds good. Then downgraded to a nit, maybe Warning about port bind test (from experience), the port may stay bound after the test even if it's dropped on linux (unless |
|
||
// check for unused ports to assign | ||
let (socks_port, control_port) = get_available_ports(port_range)?; | ||
instance.socks_port = socks_port; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just remembered, if you set both of these to 0
the OS will assign an open port.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case does the bind return the port number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I see I can use local_addr to get it from the listener. Will do
Agreed sounds good |
Windows compilation issues would either require building via cygwin/mingw/msys2, or maintaining a fork and migrating the tor source to cmake for windows, both of which are undesirable for this feature. Closing this PR and will re-open as an opt-in feature for linux/macos only, unfortunately. |
Description --- Continues from #3641 Optionally use a built-in Tor process for macos/linux only
Description
use_libtor
for[base_node.network]
and[wallet.network]
defaults to true, when set to false allows Tor comms transport to be manually defined as beforeMotivation and Context
Improved user experience - ease of getting started without requiring separate Tor
How Has This Been Tested?
Tested by setting up new base nodes and wallets and running them using libtor, and also tested that they still work using a system level Tor.
TODO: still to be tested on Windows
Breaking change: old config files might no longer work