Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Solo6R on September 11, 2024, 03:33:39 AM



Title: Some questions regarding my node setup.
Post by: Solo6R on September 11, 2024, 03:33:39 AM
I've setup a full node and after some reading decided to run it over tor. The problem I'm having is that inbound connections are still over IPv4, whereas the outbound connections are proper tor/onion addresses. I can ofcourse turn off incoming connections with "bind=127.0.0.1" in in my bitcoin.conf file, but that sort of defeats the purpose of running the node to contribute to the network doesn't it? I've tried a slew of configuration settings with bitcoin.conf, and torrc and can't seem to figure this out.

Is it common for folks running their node over tor to accept and connect just to other tor addresses, or do most just connect(outbound) to other tor addresses, but still receive from normal IPv4 addresses?

Bitcoin.conf:
Code:
server=1
proxy=127.0.0.1:9050
onion=127.0.0.1:9050
listen=1
listenonion=1
onlynet=onion
torcontrol=127.0.0.1:9051

torrc:
Code:
Log notice file C:\Tor\tor\tor.log
ControlPort 9051
HiddenServiceDir C:/Tor/tor/hidden_service_directory/
HiddenServicePort 8333 127.0.0.1:8333


Title: Re: Some questions regarding my node setup.
Post by: nc50lc on September 11, 2024, 04:41:33 AM
Using Bitcoin Core?
Set the provided args in the third option in this official documentary for Bitcoin Core client: https://github.com/bitcoin/bitcoin/blob/master/doc/tor.md#3-manually-create-a-bitcoin-core-onion-service (https://github.com/bitcoin/bitcoin/blob/master/doc/tor.md#3-manually-create-a-bitcoin-core-onion-service)
Most importantly, the --externalip that you can get from "C:/Tor/tor/hidden_service_directory/hostname" based from the "HiddenServiceDir" that you've set in your torrc file.


Title: Re: Some questions regarding my node setup.
Post by: Solo6R on September 11, 2024, 05:08:34 AM
Using Bitcoin Core?
Set the provided args in the third option in this official documentary for Bitcoin Core client: https://github.com/bitcoin/bitcoin/blob/master/doc/tor.md#3-manually-create-a-bitcoin-core-onion-service (https://github.com/bitcoin/bitcoin/blob/master/doc/tor.md#3-manually-create-a-bitcoin-core-onion-service)
Most importantly, the --externalip that you can get from "C:/Tor/tor/hidden_service_directory/hostname" based from the "HiddenServiceDir" that you've set in your torrc file.

Yeah I'm using bitcoin core. This didn't seem to solve much. I've specified my onion address via the externalip param and I'm still getting connected to via regular IPv4 addresses. Tried with discover on(1), and off(0). ALL of my outbound connections are to a tor address, but ALL of my inbound connections are regular IPv4 connections. I guess that's fine as long as they're connecting to MY onion address and not MY IPv4 address? How would I know?


Title: Re: Some questions regarding my node setup.
Post by: nc50lc on September 12, 2024, 04:18:43 AM
Yeah I'm using bitcoin core. This didn't seem to solve much. I've specified my onion address via the externalip param and I'm still getting connected to via regular IPv4 addresses. Tried with discover on(1), and off(0).
Have you followed the instructions to add bind=127.0.0.1:8334=onion to your config to prevent clearnet inbound connections?
Because onlynet=onion only works in outbound connections like what you've described.

Don't forget to restart Core to apply the new bitcoin.conf settings.


Title: Re: Some questions regarding my node setup.
Post by: Solo6R on September 12, 2024, 08:05:40 AM
Yeah I'm using bitcoin core. This didn't seem to solve much. I've specified my onion address via the externalip param and I'm still getting connected to via regular IPv4 addresses. Tried with discover on(1), and off(0).
Have you followed the instructions to add bind=127.0.0.1:8334=onion to your config to prevent clearnet inbound connections?
Because onlynet=onion only works in outbound connections like what you've described.

Don't forget to restart Core to apply the new bitcoin.conf settings.

That seems to have done the trick. Thank you. I get a LOT fewer inbound connections now (for obvious reasons), but the ones I get are via the onion network and not an IPv4 connection, which is what I was trying to achieve.