cculianu / Fulcrum

A fast & nimble SPV Server for BCH, BTC, and LTC
Other
343 stars 77 forks source link

Can't use hostname in tor_proxy #71

Closed Mave95 closed 3 years ago

Mave95 commented 3 years ago

It's not possible to define tor_proxy with a hostname instead of an IP. This is especially needed for Docker, when you define a tor service and don't know it's IP.

cculianu commented 3 years ago

Ah. Ha -- it never occurred to me somebody would need that. Ok, yeah I can fix that.

PS: Can't you just do 127.0.0.1 for the tor proxy? Presumably it's always running on localhost? Or not always with a docket setup?

Mave95 commented 3 years ago

Each container has it's own IP. When using 127.0.0.1 you would have to run tor in the same container or use "--network host" for both the tor and Fulcrum container.

cculianu commented 3 years ago

Gotcha -- @EchterAgo had a similar issue with another of the params and I ended up adding hostname support there. Will add this now -- hopefully it won't be too much code change. Looking at it now.

cculianu commented 3 years ago

Hi, I just pushed commit 098dc1d which addresses this. tor_proxy can now be a hostname and it does a lookup once at app init and then caches the resulting IP address. It should work now as you expect. Do you run/build from source? Would appreciate feedback if this resolves the issue for you. In my testing it works perfectly.

Let me know -- I am closing this issue now but feel free to re-open if it's not actually solved.

Mave95 commented 3 years ago

Works as expected. Thanks.