From adc11a134bc5834f37d908cff85c01b4b1761f60 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 6 Jun 2022 17:04:30 -0500 Subject: [PATCH] Add separate documentation for Tor configuration Fixes #1277. Adds a separate document tor.md detailing installation and configuration requirements for both Makers and Takers, in particular details how to configure for the serving of an ephemeral onion service. --- docs/PAYJOIN.md | 47 ++----------------- docs/onion-message-channels.md | 6 +-- docs/tor.md | 84 ++++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 49 deletions(-) create mode 100644 docs/tor.md diff --git a/docs/PAYJOIN.md b/docs/PAYJOIN.md index 4119bd4..d601efe 100644 --- a/docs/PAYJOIN.md +++ b/docs/PAYJOIN.md @@ -227,7 +227,7 @@ bump the fee enough to add one input to the transaction, and this should be fine #### Using Joinmarket-wallet-to-Joinmarket-wallet payjoins -This is now deprecated; if you still want to use it, use Joinmarket(-clientserver) version 0.7.0 or lower, and see the corresponding older version of this document. +This can be done with the same [BIP78](https://github.com/bitcoin/bips/blob/master/bip-0078.mediawiki) workflow described above; the "old style" internal Joinmarket payjoins from 2019 are now deprecated. @@ -329,50 +329,9 @@ it means of course the other case. Double check with your counterparty, somethin -#### Configuring Tor to setup a hidden service +#### Configuring Tor to setup an onion service -(These steps were prepared using Ubuntu; you may have to adjust for your distro). - -First, ensure you have Tor installed: - -``` -sudo apt install tor -``` - -Don't start the tor daemon yet though, since we need to do some setup. Edit Tor's config file with sudo: - -``` -sudo vim /etc/tor/torrc -``` - -and uncomment these two lines to enable hidden service startup: - -``` -ControlPort 9051 -CookieAuthentication 1 -``` - -However if you proceed at this point to try to run `receive-payjoin.py` as outlined above, you will almost certainly get an error like this: - -``` -Permission denied: '/var/run/tor/control.authcookie' -``` - -... because reading this file requires being a member of the group `debian-tor`. So add your user to this group: - -``` -sudo usermod -a -G debian-tor yourusername -``` - -... and then you must *restart the computer/server* for that change to take effect (check it with `groups yourusername`). - -Finally, after system restart, ensure Tor is started (it may be automatically, but anyway): - -``` -sudo service tor start -``` - - Once this is done, you should be able to run the BIP 78 receiver script, or [JoinmarketQt](#using-qt) and a hidden service will be automatically created for you from now on. +Read about how to do this [here](./tor.md). diff --git a/docs/onion-message-channels.md b/docs/onion-message-channels.md index 81f051b..ac6c14d 100644 --- a/docs/onion-message-channels.md +++ b/docs/onion-message-channels.md @@ -24,11 +24,7 @@ albeit it was and remains E2E encrypted data, in either case) ### Tor -As of Joinmarket 0.9.6, which introduces this feature, **Tor is now a requirement to run Joinmarket** (except in testing, which will not be explained here). - -(Technically, we could argue that this is not a new requirement - because the use of Payjoin already required the need to run such onion services, and connecting to IRC used a SOCKS5 proxy (used by almost all users) over Tor to a remote onion service.) - -If you don't currently have a Tor daemon running on your machine you can use the flag `--with-local-tor` appended to your invocation of `./install.sh` as per the installation instructions in the README. +As of Joinmarket 0.9.6, which introduces this feature, **Tor is now a requirement to run Joinmarket** (except in testing, which will not be explained here). See [here](./tor.md) for more information about this). (Note however that taker bots will *not* be required to serve onions; they will only make outbound SOCKS connections, as they currently do on IRC). diff --git a/docs/tor.md b/docs/tor.md new file mode 100644 index 0000000..646f22d --- /dev/null +++ b/docs/tor.md @@ -0,0 +1,84 @@ +### How to use Tor with Joinmarket + +(You've installed using the `install.sh` or similar as per instructions in the README before +reading this). + +This document gives short notes on any necessary configuration steps for using Joinmarket as a Maker or a Taker, in coinjoins. +The requirements for Takers are lesser. + +### Contents + +1. [Checking Tor is installed](#torinstall) + +2. [Using Tor as a Taker](#tortaker) + +3. [Using Tor as a Maker](#tormaker) + + a. [Configuring Tor to setup an onion service](#torconfig) + + + +### Checking Tor is installed + +(Insert sanity check advice for system `tor`.) + +If you don't currently have a Tor daemon running on your machine you can use the flag `--with-local-tor` appended to your invocation of `./install.sh` as per the installation instructions in the README. + + + +### Using Tor as a Taker + +Insert basic instructions on checking Tor is functional and SOCKS port. + + + +#### Configuring Tor to setup an onion service + +(These steps were prepared using Ubuntu; you may have to adjust for your distro). + +First, ensure you have Tor installed: + +``` +sudo apt install tor +``` + +Don't start the tor daemon yet though, since we need to do some setup. Edit Tor's config file with sudo: + +``` +sudo vim /etc/tor/torrc +``` + +and uncomment these two lines to enable onion service startup: + +``` +ControlPort 9051 +CookieAuthentication 1 +``` + +However if you proceed at this point to try to start your yieldgenerator with `python yg-privacyenhanced.py wallet.jmdat` or similar, you will almost certainly get an error like this: + +``` +Permission denied: '/var/run/tor/control.authcookie' +``` + +... because reading this file requires being a member of the group `debian-tor`. So add your user to this group: + +``` +sudo usermod -a -G debian-tor yourusername +``` + +... and then you must *restart the computer/server* (or maybe just logout, login) for that change to take effect (check it with `groups yourusername`). + +Finally, after system restart, ensure Tor is started (it may be automatically, but anyway): + +``` +sudo service tor start +``` + +Once this is done, you should be able to start the yieldgenerator successfully.