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

Bind/listen on 0.0.0.0 to allow incoming connections #5

Closed
wants to merge 1 commit into from
Closed

Bind/listen on 0.0.0.0 to allow incoming connections #5

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Apr 18, 2022

Fixes bisq-network/bisq#6149

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 as suggested by @JeremyRand in bisq-network/bisq#6149. It is better to listen on 0.0.0.0 for all configurations, rather than having special cases (IMHO).

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.

Copy link

@chimp1984 chimp1984 left a comment

Choose a reason for hiding this comment

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

I would prefer to limit risks by only applying it to the Whonix case and follow recommendation from bisq-network/bisq#6149:
Specifically, Bisq should check for the existence of /usr/share/anon-ws-base-files/workstation, and if that file exists, Bisq should listen on 0.0.0.0, otherwise use 127.0.0.1.

@Emzy
Copy link

Emzy commented Jun 20, 2022

Opening 0.0.0.0 for all Bisq users is a very bad thing. Think of using your notebook with Bisq in a public WIFI.

@ghost ghost closed this Sep 1, 2022
This pull request was closed.
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.

2 participants