shermand100 / PiNodeXMR

Monero Node for Single Board Computers with Web Interface and additional tools pre-configured. Self Installing.
GNU General Public License v3.0
219 stars 41 forks source link

rpc onion address not reachable over tor #49

Closed nkinnan closed 2 years ago

nkinnan commented 2 years ago

I hate to keep bothering you, but I'm hitting another issue.

The node is running successfully in "TOR: Private Bridging Node" mode. It is current on the blockchain and has about 400 clearnet and about 100 onion addresses in the whitelist. It's actively connected to 32 clearnet and 8 onion nodes. Everything looks good there (though I haven't tried to broadcast a transaction yet), but the .onion address generated for my node does not appear to be reachable over tor.

Using the monero gui wallet, I have connected to xmr nodes with onion addresses and successfully synced a wallet in the past, but configuring it with the onion address from the pinodexmr config page it just says "connecting" indefinitely. I hit a hidden site to ensure I was connected to tor of course.

Configuring the wallet to use the local 192.168.x.x address goes immediately to disconnected but I believe that's just because Tails won't allow the wallet to communicate outside the tor network.

As a debug step, I've tried connecting manually to the rpc port and succeeded with the local address but not with the onion address:

curl -u [rpc un]:[rpc pw] --digest -X POST http://192.168.[x].[x]:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json'

This spits out the status JSON blob as expected. Connecting to this address with the "unsafe" browser in Tails pops a login dialog and then "invalid request" json response as expected.

curl --socks5-hostname 127.0.0.1:9050 -u [rpc un]:[rpc pw] --digest -X POST http://[onion address from config page].onion:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json'

This appears to connect to the tor socks proxy, then timeout attempting to resolve the onion address "Can't complete SOCKS5 connection to 0.0.0.0:0". Connecting to the onion address with the safe/tor browser in Tails just times out without any response, and of course the wallet just says "connecting" indefinitely as previously described.

Any idea how to debug this? Node has been running overnight and had plenty of time to reach its fingers out into the tor network.

shermand100 commented 2 years ago

Hi again. So that (for people not using tails) this device can be reached over both IPv4 and onion (within your local network) the tor hiddenservice redirect is bound to your local address at the point when tor was installed. If this has changed since install this could be your issue.

The installer sets this rule to line 73 of /etc/tor/torrc

Can you check that IP is correct on that line and amend if necessary. If you do need to amend then a restart of the tor service will be needed after changes.

nkinnan commented 2 years ago

That did it, thank you! I remember reading something about this config line in the faq, now that you've mentioned it, but didn't think to check. I'll set a static dhcp address for the node's mac now of course. Thanks again :)

shermand100 commented 2 years ago

No problem, again sorry because it's slightly my bad, this project isn't too "smart". Once you're set-up like it sounds like you are now it'll probably be fine for years, it just doesn't like odd changes outside of it's own control. Things are slowly improving though :)