Skip to content
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

[Feature] Add option to spin up TCP listeners for tor in parallel #25

Merged
merged 5 commits into from
Mar 1, 2019

Conversation

zquestz
Copy link
Member

@zquestz zquestz commented Feb 28, 2019

Now the cashshuffle server can spin up a second TCP listener for tor connections.

The following options have been added.

  -t, --tor                      enable secondary listener for tor connections
      --tor-bind-ip string       IP address to bind to for tor (default "127.0.0.1")
      --tor-port int             tor server port (default 1339)
      --tor-stats-port int       tor stats server port (default 8081)
      --tor-websocket-port int   tor websocket port (default 1340)

Sample output:

tor ✔ $ ./cashshuffle --tor
TorStats Listening on TCP 127.0.0.1:8081 (tls: false)
Shuffle Listening on TCP :1337 (pool size: 5)
TorShuffle Listening via Websockets on 127.0.0.1:1340
TorShuffle Listening on TCP 127.0.0.1:1339 (pool size: 5)
Stats Listening on TCP :8080 (tls: false)
Shuffle Listening via Websockets on :1338

Notice the secondary listener is listening on 127.0.0.1. The ip can be configured, but it is not required to serve tor clients in most setups.

The main feature this brings, is that tor users and normal users share the same pools and can shuffle with each other. This allows for shuffles to happen faster, and connect more users together rather than have different services with different pool sets.

To expose the service you need to edit your torrc file. Here is what you would need to add:

HiddenServiceDir /var/lib/tor/cashshuffle
HiddenServicePort 1339 127.0.0.1:1339
HiddenServicePort 1340 127.0.0.1:1340
HiddenServicePort 8081 127.0.0.1:8081

For more docs on setting up onion services you can check out https://www.torproject.org/docs/tor-onion-service.html.en

To make it more convenient for stats endpoint clients, the server port and web socket port are served correctly based on the interface the request comes in. That way no json schema changes were required and integration with wallet software stays consistent.

@zquestz zquestz changed the title [Feature] Add option to spin up TCP listener for tor in parallel [Feature] Add option to spin up TCP listeners for tor in parallel Feb 28, 2019
@cculianu
Copy link

"I luv u 2 much."

README.md Outdated Show resolved Hide resolved
@emergent-reasons
Copy link
Collaborator

LGTM

@zquestz zquestz merged commit a8fa37b into master Mar 1, 2019
@zquestz zquestz deleted the tor branch March 1, 2019 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants