Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Evolyn on May 24, 2014, 07:23:59 PM



Title: different connection limits on each connection type
Post by: Evolyn on May 24, 2014, 07:23:59 PM
Hello,

at the moment I'm running (only) one dedecated full node. It's possible to connect via IPv4 and TOR (i know technically tor runs over ipv4... but thats not the point). When the node hase been restarted recently, there are some ipv4 connections and alot of tor connections. After a while when max connections are reached the ration between regular and tor connections changes more and more to the detriment of tor. Now I want to have different limits for each connection type.

The node, current bitcoind version, runs on debian. My linux skills are limited and I'd prefer a solution not bound directly to the os, at least a similar solution on different linux distributions. I plan to set up few more nodes later on different providers and location. My main intention is to have some full nodes around the world, used as fast gateway between regular net and tor so tor users can enjoy a very fast propagation as well.

Any help is welcome,

Evolyn


Title: Re: different connection limits on each connection type
Post by: Foxpup on May 25, 2014, 02:24:45 AM
The obvious solution is to just not listen on your public IP. I'm not sure why you'd want to in the first place; it seems like it can only be counterproductive if your objective is to help Tor users.


Title: Re: different connection limits on each connection type
Post by: zvs on May 25, 2014, 02:59:13 PM
Run it with -onlynet Tor

or put onlynet=tor

in your .conf file


Title: Re: different connection limits on each connection type
Post by: shorena on May 25, 2014, 03:15:09 PM
Run it with -onlynet Tor

or put onlynet=tor

in your .conf file

If I understood OP correctly thats not helping. The goal is to have 30 ipv4 connections (max) and 70 tor connections. Same client. Afaik this isnt possible currently. Can probably be coded though.


Title: Re: different connection limits on each connection type
Post by: zvs on May 25, 2014, 03:19:50 PM
Run it with -onlynet Tor

or put onlynet=tor

in your .conf file

If I understood OP correctly thats not helping. The goal is to have 30 ipv4 connections (max) and 70 tor connections. Same client. Afaik this isnt possible currently. Can probably be coded though.

I'm pretty sure you can use onlynet=Tor with some addnode IPv4 addresses....  dunno, been a while


Title: Re: different connection limits on each connection type
Post by: shorena on May 25, 2014, 03:27:23 PM

I'm pretty sure you can use onlynet=Tor with some addnode IPv4 addresses....  dunno, been a while

Didnt think about it this way, should work. Afaik addnode just adds a node without further checking the network. IIRC I had some nodes in a local testnet I added via ipv4 but they would show as ipv6 which confused me at first.
So with a good list of static ipv4 nodes this would indeed speed up an otherwise tor only node.


Title: Re: different connection limits on each connection type
Post by: Evolyn on May 26, 2014, 05:15:10 AM
If I understood OP correctly thats not helping. The goal is to have 30 ipv4 connections (max) and 70 tor connections. Same client. Afaik this isnt possible currently. Can probably be coded though.

Yes. That's what I want.


I'm pretty sure you can use onlynet=Tor with some addnode IPv4 addresses....  dunno, been a while

Didnt think about it this way, should work. Afaik addnode just adds a node without further checking the network. IIRC I had some nodes in a local testnet I added via ipv4 but they would show as ipv6 which confused me at first.
So with a good list of static ipv4 nodes this would indeed speed up an otherwise tor only node.

I see. The problem here is I have to maintain a good list of static ipv4 nodes and from time to time I still have to restart the client to make a changed config file with updated addnoses affect the client. Even if a connection dropps for some reason what always can happen, in the long term the ipv4 connected nodes will become 0 and I still have to restart the client over time?

Seems like a "setup and forget"-solution is not possible (yet)? In this case the current status where I just retart the client when I don't like the amounts of different connection types is still the easiest solution?


Title: Re: different connection limits on each connection type
Post by: shorena on May 26, 2014, 06:54:19 AM
-snip-
I see. The problem here is I have to maintain a good list of static ipv4 nodes and from time to time I still have to restart the client to make a changed config file with updated addnoses affect the client. Even if a connection dropps for some reason what always can happen, in the long term the ipv4 connected nodes will become 0 and I still have to restart the client over time?

You can also use addnode remotly, but this would still require you to periodically check each node and handle problems manually. Im pretty sure this can be automatized with a cronjob that notifies you if a certain number of connections is reached.

Seems like a "setup and forget"-solution is not possible (yet)? In this case the current status where I just retart the client when I don't like the amounts of different connection types is still the easiest solution?

This can be implemented but not easily.


Title: Re: different connection limits on each connection type
Post by: zvs on May 27, 2014, 05:07:24 AM
If I understood OP correctly thats not helping. The goal is to have 30 ipv4 connections (max) and 70 tor connections. Same client. Afaik this isnt possible currently. Can probably be coded though.

Yes. That's what I want.


I'm pretty sure you can use onlynet=Tor with some addnode IPv4 addresses....  dunno, been a while

Didnt think about it this way, should work. Afaik addnode just adds a node without further checking the network. IIRC I had some nodes in a local testnet I added via ipv4 but they would show as ipv6 which confused me at first.
So with a good list of static ipv4 nodes this would indeed speed up an otherwise tor only node.

I see. The problem here is I have to maintain a good list of static ipv4 nodes and from time to time I still have to restart the client to make a changed config file with updated addnoses affect the client. Even if a connection dropps for some reason what always can happen, in the long term the ipv4 connected nodes will become 0 and I still have to restart the client over time?

Seems like a "setup and forget"-solution is not possible (yet)? In this case the current status where I just retart the client when I don't like the amounts of different connection types is still the easiest solution?

with addnode, if a connection drops, it'll retry it every x seconds.  I think the base retry is every 120 seconds.

There are some ipv4 nodes that have been up 95%+ for years.  try http://bitcoin.sipa.be/seeds.txt (http://bitcoin.sipa.be/seeds.txt) ... I'd say that's pretty long term