BlockchainCommons/Learning-Bitcoin-from-the-Command-Line

Not able to verify tor setup for RPC

zerotobtc opened this issue · 1 comments

I'm currently in chapter 14.1 Verify your tor setup.

I don't get my head around doing the actual RPC verification via torify and I assume my linode-node is not running properly behind tor.
When I type sudo -u debian-tor tor --verify-config everything is fine and I see the expected result.

However when I try to check the rpc ports in /etc/tor/torrc I can NOT see the hidden service ports described in the docs. There it only says:

############### This section is just for location-hidden services ###

## Once you have configured a hidden service, you can look at the
## contents of the file ".../hidden_service/hostname" for the address
## to tell people.
##
## HiddenServicePort x y:z says to redirect requests on port x to the
## address y:z.

#HiddenServiceDir /var/lib/tor/hidden_service/
#HiddenServicePort 80 127.0.0.1:80

#HiddenServiceDir /var/lib/tor/other_hidden_service/
#HiddenServicePort 80 127.0.0.1:80
#HiddenServicePort 22 127.0.0.1:22

I can see them in the bitcoin.conf file but that doesn't help much... I have an QR-code but I'm not able to connect with my node through it. And I don't have a /var/lib/tor/standup/hostname directory at all.

What I CAN do is verifying my tor-setup for bitcoind running grep "tor:" ~/.bitcoin/testnet3/debug.log.

I assume, something went wrong during the initial install. But can anybody tell me, how to fix it?

PS: Explanations for differences between RPC and bitcoind are also welcome, I think I'm not getting that right either...

I still don't know why the error occurred however I found a workaround.

I simply added the lines

HiddenServiceDir /var/lib/tor/standup/
HiddenServiceVersion 3
HiddenServicePort 1309 127.0.0.1:18332
HiddenServicePort 1309 127.0.0.1:18443
HiddenServicePort 1309 127.0.0.1:8332

in the /etc/tor/torrc file in the hidden service section. Then I restarted tor with systemctl restart tor. Afterwards the /var/lib/tor/standup/hostname file was created and also the torify command went through just fine!