-
Notifications
You must be signed in to change notification settings - Fork 137
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
Optional Tor Send/Listen Functionality #226
Conversation
Awesome. That was fast!
|
Sure, the URL parsing expects an http URL in many places, so just left it as is for now, can change it soon
That means documentation, setting up tests, completing it (it's missing some functionality that we don't particularly need) and maintaining it. It's the right thing to do (tm) but going to put it on a low-priority thread (also tm). |
Updated top comment with most recent instructions |
} | ||
|
||
/// output torrc file given a list of hidden service directories | ||
pub fn output_torrc( |
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.
This approach works fine, but it won't work as well for on-the-fly changes, like the user requesting a different receive address. In Grin++, I'm opening a tor control socket(https://github.com/torproject/torspec/blob/master/control-spec.txt) and using the AUTHENTICATE, ADD_ONION, etc APIs to allow that sort of thing to work more seamlessly. Maybe that's not necessary for grin-wallet, especially since we haven't switched to the wallet713-style logged-in CLI, but just wanted to point out that potential limitation.
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.
Discussed in keybase, this is mostly because there are no decent client libs in Rust, and this is much easier to implement for the time being (2 advantages in that it doesn't open any extra ports on the listener side and doesn't require keeping track of a password for the control port). Will keep as is for now and see how we get on.
No longer draft (so tests will run), but not quite ready for review, mostly because we still need to figure out the derivation path. |
Think this is pretty much ready for review/merge into master. Nothing here is necessarily final as the 3.0.0 release is a ways off still, but would be good to get this into master so people can start experimenting with it. |
Made sending via TOR work more implicitly, automatically running the tor listener if tor is available, and added config + commands to turn this off if desired. Send command will figure out if address is a valid onion V3 address, and will attempt to send via TOR if so. Merging once tests pass. |
Test |
* udpate for beta release * initial tor explorations * rustfmt * basic tor tx send working * rustfmt * add tor proxy info to config file * rustfmt * add utilities to output tor hidden service configuration files * output tor config as part of listener startup * rustfmt * fully automate config and startup of tor process * rustfmt * remove unnecessary process kill commands from listener * rustfmt * assume defaults for tor sending config if section doesn't exist in grin-wallet.toml * rustfmt * ignore tor dev test * update default paths output by config, compilation + confirmed working on windows * rustfmt * fix on osx/unix * add timeout to tor connector, remove unwrap in client * allow specifiying tor address without 'http://[].onion' on the command line * fix api test * rustfmt * update address derivation path as per spec * rustfmt * move tor init to separate function * rustfmt * re-ignore tor dev test * listen on tor by default if tor available * rustfmt * test fix * remove explicit send via tor flag, and assume tor if address fits * rustfmt
* udpate for beta release * initial tor explorations * rustfmt * basic tor tx send working * rustfmt * add tor proxy info to config file * rustfmt * add utilities to output tor hidden service configuration files * output tor config as part of listener startup * rustfmt * fully automate config and startup of tor process * rustfmt * remove unnecessary process kill commands from listener * rustfmt * assume defaults for tor sending config if section doesn't exist in grin-wallet.toml * rustfmt * ignore tor dev test * update default paths output by config, compilation + confirmed working on windows * rustfmt * fix on osx/unix * add timeout to tor connector, remove unwrap in client * allow specifiying tor address without 'http://[].onion' on the command line * fix api test * rustfmt * update address derivation path as per spec * rustfmt * move tor init to separate function * rustfmt * re-ignore tor dev test * listen on tor by default if tor available * rustfmt * test fix * remove explicit send via tor flag, and assume tor if address fits * rustfmt
(Updated with current instructions, Oct 4th, 2019) these are the basic instructions to set up and test:
git fetch origin pull/226/head:my_tor_test_branch
git checkout my_tor_test_branch
cargo build
To Listen
tor
at the prompt and check if it starts up). Note: you do not need to run tor manually when sending via the wallet, this is just to ensure the executable can be foundgrin-wallet listen
That should be it, if tor is installed and on the path, your hidden service address should be printed to stdout. If not, listening will fall back to standard HTTP only.
To Send
Install tor on the target machine as above
The usual send command will check whether the provided destination is a tor address, and send via tor if so. For instance:
grin-wallet send -d "http://tuyadexmtd5houbmysg5qqctor43npeqmeibwmrml55spidwudi4egid.onion" 60
This will also work with just the onion address:
grin-wallet send -d "tuyadexmtd5houbmysg5qqctor43npeqmeibwmrml55spidwudi4egid" 60
The following is the default tor configuration section for
grin-wallet.toml
(this will be output for new wallets, notesend_config_dir
is full path). For backwards compatibility reasons, if this section doesn't exist ingrin-wallet.toml
these are the defaults that will be assumed, withsend_config_dir
configured to the top-level wallet directory)TODOs (for this PR, more TOR related work is ahead):