Bitcoin Forum
May 15, 2025, 10:50:12 AM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Need help with bitcoin.conf - Want to contribute to the network through Tor  (Read 191 times)
tr0gi (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 9


View Profile
March 12, 2025, 10:51:35 PM
Last edit: March 12, 2025, 11:52:42 PM by tr0gi
 #1

I recently got my hands on a 5TB external HDD and I just finished moving over the blockchain and my torrents to it, it's quite practical, but I have an important concern.
Essentially, I can't forward port 8333 on my router, and I'm using a VPN anyway, so it'd pretty much be pointless, so I resorted to using a Tor hidden service to allow incoming connections to my node.

I followed the bitcoin.it guide to setup a node over Tor on Linux and got everything working, and then asked some AI to optimize my bitcoin.conf, and ended up with this :
Quote
# Enable Tor hidden service
proxy=127.0.0.1:9050
listen=1
bind=127.0.0.1
debug=tor

# Increase outbound connections (default is 8 )
maxconnections=125
maxuploadtarget=0  # No upload limit

# Additional performance settings
dbcache=1000       # Allocate more memory for the database cache (in MB, adjust based on your RAM)
maxmempool=300     # Maximum memory for the mempool (in MB)

# To be a good network citizen
blocksonly=0       # Set to 1 if you have bandwidth concerns
txindex=1          # Build a transaction index (helpful for the network)

But looking at my peer window in Qt after 30 minutes of my node running, there's only one inbound Onion connection, with some occasionally coming in but disappearing the next second.

I want to know if I can add/remove/change anything in my config to contribute more to the network.
Forsyth Jones
Legendary
*
Offline Offline

Activity: 1540
Merit: 1344


I love Bitcoin


View Profile WWW
March 12, 2025, 11:21:52 PM
 #2

Hi, I'm not on Linux right now, I could show you my bitcoin.conf, which is configured to run over Tor, but it seems to be fine as it is. Usually, incoming connections take a long time to connect to your node, don't worry.

Check out this guide with more complete instructions: https://github.com/bitcoin/bitcoin/blob/master/doc/tor.md

tr0gi (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 9


View Profile
March 13, 2025, 12:03:26 AM
 #3

Alright, I did some more waiting and I now have 3 inbound onion connections. Awesome.
I'll keep the topic open in case any Bitcoin Core savants want to add anything.

I reckon I'm delighted with my current setup, I'm using a Cold Card hardware wallet with Bitcoin Core's PSBT controls, for a fully air-gapped setup, with my own full node routed through Tor, helping the network 24/7.
ABCbits
Legendary
*
Offline Offline

Activity: 3248
Merit: 8725



View Profile
March 13, 2025, 09:16:41 AM
 #4

I followed the bitcoin.it guide to setup a node over Tor on Linux and got everything working, and then asked some AI to optimize my bitcoin.conf, and ended up with this :
Quote
# Enable Tor hidden service
proxy=127.0.0.1:9050
listen=1
bind=127.0.0.1
debug=tor

# Increase outbound connections (default is 8 )
maxconnections=125
maxuploadtarget=0  # No upload limit

# Additional performance settings
dbcache=1000       # Allocate more memory for the database cache (in MB, adjust based on your RAM)
maxmempool=300     # Maximum memory for the mempool (in MB)

# To be a good network citizen
blocksonly=0       # Set to 1 if you have bandwidth concerns
txindex=1          # Build a transaction index (helpful for the network)

There's no problem with this configuration, but
1. maxconnections=125, maxuploadtarget=0, maxmempool=300 and blocksonly=0 actually are the default value used by Bitcoin Core. So adding those have no impact.
2. maxconnections actually only set maximum total connection (both incoming and outgoing), where Bitcoin Core already make up to 10 outbound/outgoing connection by default.
3. AFAIK txindex=1 doesn't help Bitcoin network or other node in any way.

But looking at my peer window in Qt after 30 minutes of my node running, there's only one inbound Onion connection, with some occasionally coming in but disappearing the next second.

I want to know if I can add/remove/change anything in my config to contribute more to the network.

Both Tor and Bitcoin Core already have good default configuration. So if you already receive incoming connection, realistically you only could wait until you receive more incoming connection.

Few member may mention that manually connect to well-connected node (using addnode=NODE_IP_OR_ONION) may help you receive more incoming connection faster. But i don't know whether it actually works.

Forsyth Jones
Legendary
*
Offline Offline

Activity: 1540
Merit: 1344


I love Bitcoin


View Profile WWW
March 14, 2025, 11:56:09 PM
 #5


Few member may mention that manually connect to well-connected node (using addnode=NODE_IP_OR_ONION) may help you receive more incoming connection faster. But i don't know whether it actually works.
When my node takes a long time to receive incoming connections, I add some onion network nodes manually by this command by getting the address from bitnodes, and after a while, I can see that the .onion address has indeed been added to the connections list.

Cricktor
Legendary
*
Offline Offline

Activity: 1134
Merit: 2332



View Profile
March 23, 2025, 09:38:56 PM
Merited by LoyceV (6), ABCbits (1)
 #6

As I want my node to only communicate via Tor with other nodes, I have the following differences in my bitcoin.conf:
Code:
# Network
# listen=1        -- commented out
listenonion=1
proxy=127.0.0.1:9050
bind=127.0.0.1
onlynet=onion

I use a larger mempool and have my node save its current state before shutting down; full RBF enabled:
Code:
maxmempool=1024
persistmempool=1
mempoolfullrbf=1
walletrbf=1

And I like to keep the history of my debug.log:
Code:
shrinkdebugfile=0

nc50lc
Legendary
*
Offline Offline

Activity: 2786
Merit: 7192


Self-proclaimed Genius


View Profile
April 09, 2025, 12:15:46 PM
Merited by ABCbits (1), apogio (1)
 #7

I'll keep the topic open in case any Bitcoin Core savants want to add anything.
I want to know if I can add/remove/change anything in my config to contribute more to the network.
This is a bit late but since you're still open for suggestions on how to contribute even more:
You may consider adding peerblockfilters=1 and its requirement blockfilterindex=1 to your config.
That'll enable your node to serve some light clients that implemented BIP157 and BIP158.

Heads-up; once enabled, your node will have to create a separate blockfilterindex just like your txindex, but smaller in size.
And your node may gain a lot of light-client peers than full nodes depending on various conditions.

caesrcd
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile WWW
April 13, 2025, 06:50:36 PM
 #8

But looking at my peer window in Qt after 30 minutes of my node running, there's only one inbound Onion connection, with some occasionally coming in but disappearing the next second.
Newly created onion addresses take time to propagate across the network. This is why your node receives few incoming onion connections.

Alright, I did some more waiting and I now have 3 inbound onion connections. Awesome.
I'll keep the topic open in case any Bitcoin Core savants want to add anything.
The longer your node stays online, the more other nodes will receive your onion address in their list of already connected addresses. Within a few months, your node will be able to receive many more incoming connections much more quickly.
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!