Bitcoin Forum
November 14, 2024, 08:57:27 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is there any way to verify whether Bitcoin Core is truly running through Tor?  (Read 135 times)
20kevin20 (OP)
Legendary
*
Offline Offline

Activity: 1134
Merit: 1598


View Profile
November 29, 2020, 10:18:25 PM
Merited by hosseinimr93 (1)
 #1

I've installed the Tor bundle before setting up a Bitcoin Core full node on a fresh Linux install and today, upon checking out the Network settings in the wallet, I noticed that it has not automatically checked the SOCKS5 option which, as far as I read, should be automatically done if it detects Tor on my PC.

Hence, I have manually done this (set up the 127.0.0.1:9050 proxy) and restarted the Core. Upon restart, I notice it does sync but it also gets around 10 peers connected. AFAIK, the Core connection through Tor only allows up to 7 (or 8?) peers at a time.

Therefore, I have closed the Core QT and launched bitcoind with the "-proxy=127.0.0.1:9050" option through terminal, and then closed it and re-launched Core QT with the same option. In the end, I get no different results. I created a bitcoin.conf file to force this proxy and no difference.

I tried purging all Tor-related packages and done a clean reinstall. Tried both from the package offered through the Tor official website and building from source - makes no difference. Hence, I'm afraid my Bitcoin Core is actually not running through Tor and I'd like to make sure it actually is. How can I verify?
DaveF
Legendary
*
Offline Offline

Activity: 3654
Merit: 6671


Crypto Swap Exchange


View Profile WWW
November 29, 2020, 10:35:17 PM
 #2

Did you try lsof
It will show all the network connections for whatever PID you want.

Code:
lsof -ai -p "$pid"

I think that will do what you want.

You can give a Google to see if it is what you are looking for.

-Dave

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
20kevin20 (OP)
Legendary
*
Offline Offline

Activity: 1134
Merit: 1598


View Profile
November 29, 2020, 10:49:05 PM
 #3

Did you try lsof
I've only tried netstat and Bitcoin Core does apparently use the 9050 port whenever it's launched (port 9050 is missing from netstat when Core is closed).

I am just not sure whether the wallet using port 9050 means it's working through Tor. Like, if I never had Tor on my PC but still mentioned this proxy in the Core's Network settings, would the wallet sync/connect at all?
DaveF
Legendary
*
Offline Offline

Activity: 3654
Merit: 6671


Crypto Swap Exchange


View Profile WWW
November 29, 2020, 11:38:59 PM
 #4

As far as I know if it's going through 9050 and you have Tor running on 9050 then yes it's all going through Tor.
There are people here who can probably give you more detail and tell you what else to check but that should be all you need to do.
Can't comment on the number of connections, I never heard of a limit on Tor but I never looked either.

-Dave


█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
20kevin20 (OP)
Legendary
*
Offline Offline

Activity: 1134
Merit: 1598


View Profile
November 30, 2020, 10:03:08 PM
 #5

Do you remember where you read it? I never heard Bitcoin Core would connect Tor if Tor is detected.
I looked up the link again, and I think I understood it the wrong way. Here's the source of the information (this is a tutorial for setting up a Tor hidden service on Bitcoin Core, which is a way to anonymously synchronize the wallet as well as anonymously help the network yourself as far as I can tell):

Quote
At this point your node will work over Tor without further configuartion. Bitcoin Core v0.12 and later automatically tries to connect to Tor via the ControlPort if listen=1 is set in bitcoin.conf.



No. To be specific, Bitcoin Core will try to connect to IP:port through SOCKS5 based on your configuration, but will fail. Your debug.log should look like this

Code:
2020-11-30T11:08:50Z connect() to 127.0.0.1:9050 failed after select(): Connection refused (111)
Great, thank you! I owe both of you a merit now. Smiley
ABCbits
Legendary
*
Offline Offline

Activity: 3052
Merit: 8087


Crypto Swap Exchange


View Profile
December 01, 2020, 10:26:26 AM
Merited by 20kevin20 (1)
 #6

Do you remember where you read it? I never heard Bitcoin Core would connect Tor if Tor is detected.
I looked up the link again, and I think I understood it the wrong way. Here's the source of the information (this is a tutorial for setting up a Tor hidden service on Bitcoin Core, which is a way to anonymously synchronize the wallet as well as anonymously help the network yourself as far as I can tell):

Quote
At this point your node will work over Tor without further configuartion. Bitcoin Core v0.12 and later automatically tries to connect to Tor via the ControlPort if listen=1 is set in bitcoin.conf.

It only refers to incoming connection. If you read the guide further, you still need to configure Bitcoin Core to use tor for outgoing connection.
Additionally, take attention when the page last edited (it's 21 December 2018, at 19:02 when i check the article). Few information might be outdated.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
20kevin20 (OP)
Legendary
*
Offline Offline

Activity: 1134
Merit: 1598


View Profile
December 02, 2020, 10:25:03 AM
 #7

So I've taken a closer look at bitcoind since the sync is taking an awfully lot of time, and I find there is an error popping up every ~30-90sec:
Code:
socket send error Broken pipe (32)

Not sure if this is Tor-related (although Socket5 should be the 127.0.0.1:9050 proxy I set up), but there are other errors popping up every now and then as well, such as:
Code:
socket send error Connection reset by peer (104)
Code:
Socket5() connect to <IP_ADDRESS> failed: general failure
Code:
Socket5() connect to <IP_ADDRESS> failed: connection refused

It takes around half a day to sync only one day of blocks from 2018, so something should be wrong. The sync was very fast for the first ~48% of the blocks, but now it takes an eternity. Should I open up a new thread for this issue? Smiley

Edit: could this be due to the "-listen=0" option I've placed in the bitcoin.conf file?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!