OpenBazaar / openbazaar-go

OpenBazaar 2.0 Server Daemon in Go
MIT License
994 stars 283 forks source link

Dual-stack Tor: unable to query any ticker API #1558

Open gavriilos opened 5 years ago

gavriilos commented 5 years ago

I am facing another issue on openbazaar-go 0.13.2 when running in dual-stack mode (Tor and clearnet). My node is unable to query any ticker API. Here are the relevant error messages:

Get https://ticker.openbazaar.org/api: socks connect tcp: dial tcp: missing address Get https://poloniex.com/public?command=returnTicker: socks connect tcp: dial tcp: missing address Get https://api.kraken.com/0/public/Ticker?pair=BCHUSD: socks connect tcp: dial tcp: missing address

The end result is that all products on my store get locked with the following error:

This listing is not purchasable. The item is priced in a currency for which exchange rate data is currently unavailable.

All these errors go away if I delete the line with the onion address from my config under Addresses.Swarm.

placer14 commented 5 years ago

Thanks for the report @gavriilos. Can you share the parameters you start your daemon with along with which position (1st, 2nd, etc) the onion address is in the Swarm list.

gavriilos commented 5 years ago

I start my daemon simply with openbazaar-go start. The onion address is in the last position of my swarm list:

   "Addresses": {
      "Swarm": [
         "/ip4/0.0.0.0/tcp/4001",
         "/ip6/::/tcp/4001",
         "/ip4/0.0.0.0/tcp/9005/ws",
         "/ip6/::/tcp/9005/ws",
         "/onion/mybeautyonionadd:4003"
      ]
placer14 commented 5 years ago

@gavriilos Here's a crazy idea, would you put your onion address at the top, try again, and let us know what happens?

gavriilos commented 5 years ago

I get the same error:

$ openbazaard start OpenBazaar Server v0.13.3 [Press Ctrl+C to exit] Get https://ticker.openbazaar.org/api: socks connect tcp: dial tcp: missing address Get https://poloniex.com/public?command=returnTicker: socks connect tcp: dial tcp: missing address Get https://api.kraken.com/0/public/Ticker?pair=BCHUSD: socks connect tcp: dial tcp: missing address

gavriilos commented 5 years ago

BTW, this is how the Tor related config looks like:

    "Tor-config": {
        "Password": "fakePass",
        "TorControl": "127.0.0.1:9051"
    },

I have confirmed that the password matches the hash on my torrc.

Anyway, having a proper Tor connection should be irrelevant here. As I am running a dual-stack node, all requests to the ticker APIs can use the clearnet. It is not a problem to leak the IP address to the ticker providers, as it is already public in the OB network.