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

Whonix only: Bind/listen on 0.0.0.0 instead of 127.0.0.1 #15

Merged
merged 1 commit into from Feb 6, 2023
Merged

Whonix only: Bind/listen on 0.0.0.0 instead of 127.0.0.1 #15

merged 1 commit into from Feb 6, 2023

Conversation

ghost
Copy link

@ghost ghost commented Feb 6, 2023

Fixes bisq-network/bisq#6149
2nd attempt, previous was #5. Now detects Whonix using their published guidelines and acts accordingly.

This PR is necessary for Whonix users because currently their open offers are unreachable by takers. This causes confusion, support queries, and missed trading opportunities.


Setups which use an external Tor on a different VM (such as Whonix) have a problem that they never get incoming connections. Bisq looks like it is running ok, but peers attempting to connect get rejected. This means that offers cannot be taken, they are shown the error "Maker is offline".

Bisq can be run in two different modes: Native Tor and External. Native is the default configuration, where Bisq spawns its local copy of the Tor binary. In External mode Bisq connects to Tor service. If Tor service is on a different machine, it cannot connect back to 127.0.0.1 on the workstation.

Solution is to bind/listen on 0.0.0.0 when using Whonix WS as suggested by @JeremyRand in bisq-network/bisq#6149.

Ref: https://unix.stackexchange.com/questions/419880/connecting-to-ip-0-0-0-0-succeeds-how-why?answertab=scoredesc#tab-top

Diagram showing the problem of binding to 127.0.0.1:

image

Testing:

Test that Bisq runs ok in Native mode.
Start bisq with the normal command line options. Perform Tests shown below.

Test that Bisq runs ok in External mode.
Setup & run Tor service. Control port should be accessible from the workstation.
Start bisq with the following options included: --torControlPort=9051 --torControlPassword="notrequired"
Perform Tests shown below.

Tests

  • Verify that Bisq starts up and syncs correctly.
  • Verify that Bisq shows the correct offer book.
  • Verify that your open offers can be taken by another client on the network.

While checking this issue, I wrote simple standalone apps DemoTorReceiver / DemoTorSender that send and receive a hello world message using the same libraries that Bisq uses. There's an example run shown in the readme. I found them useful for understanding netlayer, and simplifying / testing the problem.

I have tested this fix on Whonix, and verified that offers are able to be taken.

Copy link

@gabernard gabernard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@gabernard gabernard merged commit 745f3cf into bisq-network:master Feb 6, 2023
@ghost ghost mentioned this pull request Feb 9, 2023
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.

Onion shouldn't listen on 127.0.0.1 if running on Whonix
1 participant