Bitcoin Forum
May 07, 2024, 01:09:34 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to reserve connection slot for mobile SPV wallet (Bread) on Bitcoin Core  (Read 479 times)
e4xit (OP)
Sr. Member
****
Offline Offline

Activity: 302
Merit: 250



View Profile
October 23, 2017, 12:04:19 PM
 #1

I have a Bitcoin Core node running on a server at home which I have limited to 30 connections as this suits my current internet connection. I am now trying to use the 'advanced' feature of Bread (wallet) for iOS which allows connection to a manually-configured node however this only results in a successful connection 10% of the time -- when I have a free slot which may or may not be the case at any given moment.

I am aware that you can configure this for a local or remote node with a fixed ip address using the "addnode" command line argument, but is there a way to make this work for remote nodes without a fixed ip address? I think that "whitebind":
Code:
-whitebind=<addr> 	Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6 
...might provide this functionality but not sure how you would configure it for this use case...

Perhaps there is a way to specify a second port which would reserve a few connections for people connecting via it? Is this what I can do with whitebind?

I think the ideal situation would be to connect to my home node over Tor, but not sure I can do this with Bread (wallet).

Not your keys, not your coins.
CoinJoin, always.
Bitcoin mining is now a specialized and very risky industry, just like gold mining. Amateur miners are unlikely to make much money, and may even lose money. Bitcoin is much more than just mining, though!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715044174
Hero Member
*
Offline Offline

Posts: 1715044174

View Profile Personal Message (Offline)

Ignore
1715044174
Reply with quote  #2

1715044174
Report to moderator
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6587


Just writing some code


View Profile WWW
October 23, 2017, 04:28:12 PM
 #2

You can't reserve a connection for a specific peer or reserve ports for specific peers to connect to. The connection limit is global and not just for one network interface.

aleksej996
Sr. Member
****
Offline Offline

Activity: 490
Merit: 389


Do not trust the government


View Profile
October 23, 2017, 05:51:18 PM
 #3

Maybe you can run two instances of Bitcoin Core with different configurations, but same data directory. If this could work you would only use up more RAM and CPU, which are often negligible, while being able to specify different binding addresses and be able to open a permanent connection to that node.

For example, create a new configuration file witch binds Core to different port (not 8333), but only to localhost, so they can both work at the same time and only connections from the same PC can work on it. Also make a limit of only two connection to that node. Then start that node and go to your old node and add it as a peer. Create a Tor hidden service that forwards to that new node port, but don't change your configuration and add it as an external ip as you usually would. This should make that hidden service unknown for the Bitcoin Core network, as long as your light wallet doesn't tell anyone.

This is just an idea, it is very possible that it might never work. Especially with the same data directory, but you might be able to make soft links to the blocks or even hard links.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6587


Just writing some code


View Profile WWW
October 23, 2017, 05:52:49 PM
 #4

Maybe you can run two instances of Bitcoin Core with different configurations, but same data directory.
You cannot have two instances of Bitcoin Core share the same data directory. It won't work, and it is not supposed to work.

aleksej996
Sr. Member
****
Offline Offline

Activity: 490
Merit: 389


Do not trust the government


View Profile
October 23, 2017, 06:16:59 PM
 #5

Maybe you can run two instances of Bitcoin Core with different configurations, but same data directory.
You cannot have two instances of Bitcoin Core share the same data directory. It won't work, and it is not supposed to work.

Too bad, soft links to blocks should work then just fine. So OP could just copy the chainstate folder and link most of the old block files to that old data directory.
e4xit (OP)
Sr. Member
****
Offline Offline

Activity: 302
Merit: 250



View Profile
October 23, 2017, 08:52:41 PM
 #6

So there is no way to ensure my spv wallet can connect? Seems kinda sub-optimal from a privacy perspective

Not your keys, not your coins.
CoinJoin, always.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6587


Just writing some code


View Profile WWW
October 23, 2017, 11:28:36 PM
 #7

So there is no way to ensure my spv wallet can connect? Seems kinda sub-optimal from a privacy perspective
You can either increase your connection limit so that you have more available connections than people are likely to connect to you, or you can use an external firewall software to manage this for you.

If you use an external firewall, you could have it set so that you allow 21 connections (30 connections total - 8 outgoing connections - 1 for your wallet) on the default port from external sources, and then have another firewall rule on a different port which forwards traffic to the Bitcoin node port (8333) internally (so as to bypass the earlier firewall rule). You then connect to that other port with your SPV wallet.

e4xit (OP)
Sr. Member
****
Offline Offline

Activity: 302
Merit: 250



View Profile
October 24, 2017, 08:19:04 AM
 #8

So there is no way to ensure my spv wallet can connect? Seems kinda sub-optimal from a privacy perspective
You can either increase your connection limit so that you have more available connections than people are likely to connect to you, or you can use an external firewall software to manage this for you.

If you use an external firewall, you could have it set so that you allow 21 connections (30 connections total - 8 outgoing connections - 1 for your wallet) on the default port from external sources, and then have another firewall rule on a different port which forwards traffic to the Bitcoin node port (8333) internally (so as to bypass the earlier firewall rule). You then connect to that other port with your SPV wallet.

Nice idea! Am def. going to try that and will report back. Hopefully Unifi USG router will support number of concurrent connections by port as I don't recall having seen that as an option in the GUI...

Not your keys, not your coins.
CoinJoin, always.
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!