Bitcoin Forum
September 28, 2016, 08:29:18 PM *
News: Latest stable version of Bitcoin Core: 0.13.0 (New!) [Torrent]. Make sure you verify it.
 
   Home   Help Search Donate Login Register  
Pages: [1] 2 »  All
  Print  
Author Topic: [PATCH REQUEST] Variable ports (205BTC reward)  (Read 3731 times)
mizerydearia
Hero Member
*****
Offline Offline

Activity: 574



View Profile
September 05, 2010, 05:46:52 AM
 #1

I would like to request for a patch to be developed that allows a bitcoin client to have configurable ports (currently 8332 and 8333) using configuration file to determine which ports to use.  So as to incentivize development for this patch I would like to offer 5btc (I am poor) and if anyone else would like to additionally contribute so as to offer more incentive, feel free to reply.

    5btc (miz)
+ 200btc (aceat64)
--------
  205btc


jgarzik's patch
1475094558
Hero Member
*
Offline Offline

Posts: 1475094558

View Profile Personal Message (Offline)

Ignore
1475094558
Reply with quote  #2

1475094558
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1475094558
Hero Member
*
Offline Offline

Posts: 1475094558

View Profile Personal Message (Offline)

Ignore
1475094558
Reply with quote  #2

1475094558
Report to moderator
1475094558
Hero Member
*
Offline Offline

Posts: 1475094558

View Profile Personal Message (Offline)

Ignore
1475094558
Reply with quote  #2

1475094558
Report to moderator
Insti
Sr. Member
****
Offline Offline

Activity: 294


Firstbits: 1duzy


View Profile
September 05, 2010, 06:59:42 AM
 #2

(I am poor)
Quote
Bitcoin donations received: 344.29

You probably didn't need to claim poverty.
mizerydearia
Hero Member
*****
Offline Offline

Activity: 574



View Profile
September 05, 2010, 07:13:17 AM
 #3

(I am poor)
Quote
Bitcoin donations received: 344.29

You probably didn't need to claim poverty.

I've donated to others as well, especially nanotube who has helped me a lot with bitbot!  The amount in the image is not indicative of how much I have, but rather total amount of donations overall.  Also, I would like to preserve some balance for future usage/expenditures/donations.  However, beyond scope of my Bitcoin balance, I am still unemployed and have no money remaining for any purpose (including foods) and am still lazy other than dedicating most of my time/effort towards Bitcoin-related projects.
aceat64
Full Member
***
Offline Offline

Activity: 127


View Profile
September 09, 2010, 06:39:04 AM
 #4

If someone wrote a patch that lets me set the IP/port for JSON-RPC in bitcoin.conf, I'll send them 200 BTC.  Grin
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1470


View Profile
September 09, 2010, 08:16:52 AM
 #5


Does this patch work for you guys?

     http://yyz.us/bitcoin/patch.bitcoin-bindaddr

The patch adds four command line parameters,

     -bindaddr=W.X.Y.Z      Bind to address W.X.Y.Z, instead of 127.0.0.1.  Supports bind-any modes via "*" and "0.0.0.0" addresses.
     -bindport=X         Bind to port X, instead of 8332
     -rpcaddr=W.X.Y.Z       Connect to address W.X.Y.Z, instead of 127.0.0.1
     -rpcport=X           Connect to port X, instead of 8332

Because of the way bitcoin works, all command line parameters may be specifed in the config file.  Therefore, the above would be added to the config file like this,

Code:
bindaddr=W.X.Y.Z
bindport=X
rpcaddr=W.X.Y.Z
rpcport=X

Jeff Garzik, bitcoin core dev team and BitPay engineer; opinions are my own, not my employer.
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
aceat64
Full Member
***
Offline Offline

Activity: 127


View Profile
September 09, 2010, 04:41:07 PM
 #6

Thank you jgarzik. The patch is working great, and I've sent the 200 BTC to the address in your signature.
mizerydearia
Hero Member
*****
Offline Offline

Activity: 574



View Profile
September 15, 2010, 08:38:02 PM
 #7

This doesn't seem to be compatible with Slight change so that JSON-RPC binds to all/any IPs instead of just the loopback..  Can these patches be combined or is one better than the other?
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1470


View Profile
September 15, 2010, 08:55:43 PM
 #8

This doesn't seem to be compatible with Slight change so that JSON-RPC binds to all/any IPs instead of just the loopback..  Can these patches be combined or is one better than the other?

Those two patches attempt similar things, and so should be considered mutually incompatible.

Jeff Garzik, bitcoin core dev team and BitPay engineer; opinions are my own, not my employer.
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
aceat64
Full Member
***
Offline Offline

Activity: 127


View Profile
September 16, 2010, 02:39:52 AM
 #9

This doesn't seem to be compatible with Slight change so that JSON-RPC binds to all/any IPs instead of just the loopback..  Can these patches be combined or is one better than the other?

Those two patches attempt similar things, and so should be considered mutually incompatible.


Yup, I've removed my patch, as jgarzik's is better (mine was just a simple hack).
mizerydearia
Hero Member
*****
Offline Offline

Activity: 574



View Profile
September 16, 2010, 07:54:52 AM
 #10

Ah, cool.  Thanks for the confirmation.
aceat64
Full Member
***
Offline Offline

Activity: 127


View Profile
September 16, 2010, 05:06:50 PM
 #11

I've now removed jgarzik's patch from my client in favor of using Satoshi's -rpcallowip setting (since it's in the vanilla svn).
nelisky
Legendary
*
Offline Offline

Activity: 1554


View Profile
September 16, 2010, 05:15:32 PM
 #12

I've now removed jgarzik's patch from my client in favor of using Satoshi's -rpcallowip setting (since it's in the vanilla svn).

But that doesn't allow separate ports to run multiple clients on the same machine, does it?
aceat64
Full Member
***
Offline Offline

Activity: 127


View Profile
September 16, 2010, 05:28:40 PM
 #13

I've now removed jgarzik's patch from my client in favor of using Satoshi's -rpcallowip setting (since it's in the vanilla svn).

But that doesn't allow separate ports to run multiple clients on the same machine, does it?

That is correct, but my main concern was being able to connect to the JSON-RPC interface from somewhere other than localhost. Specifically so that I could manage my nodes with phpMyBitcoin.
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1470


View Profile
September 16, 2010, 05:57:26 PM
 #14

I've now removed jgarzik's patch from my client in favor of using Satoshi's -rpcallowip setting (since it's in the vanilla svn).

But that doesn't allow separate ports to run multiple clients on the same machine, does it?

I'll update my patch on top of -rpcallowip soonish...  The JSON-RPC port is still hardcoded as 8332 in vanilla svn Sad

Jeff Garzik, bitcoin core dev team and BitPay engineer; opinions are my own, not my employer.
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1470


View Profile
September 18, 2010, 07:43:56 PM
 #15

Patch updated for latest SVN.  Given recent upstream changes to support binding to any address (0.0.0.0 or '*'), this patch is reduced to adding an option to bind or connect to a non-standard, not 8332 port:

URL: http://yyz.us/bitcoin/patch.bitcoin-bindaddr

Jeff Garzik, bitcoin core dev team and BitPay engineer; opinions are my own, not my employer.
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
aceat64
Full Member
***
Offline Offline

Activity: 127


View Profile
September 19, 2010, 05:36:13 AM
 #16

Patch updated for latest SVN.  Given recent upstream changes to support binding to any address (0.0.0.0 or '*'), this patch is reduced to adding an option to bind or connect to a non-standard, not 8332 port:

URL: http://yyz.us/bitcoin/patch.bitcoin-bindaddr


I've added the new bindaddr patch to my client.
nelisky
Legendary
*
Offline Offline

Activity: 1554


View Profile
September 21, 2010, 01:59:54 AM
 #17

I know my usecase (multiple bitcoin clients on the same server) is not the same thing that is being solved by this patch, it does fix most of it. The only thing remaining is to prevent binding to 8333 (no reason to change that, as other clients only try to connect to 8333, afaict. IRC only advertises IP, right?).

I've patched my client with this simple change:
Code:
--- a/net.cpp
+++ b/net.cpp
@@ -1236,6 +1236,9 @@ bool BindListenPort(string& strError)
     memset(&sockaddr, 0, sizeof(sockaddr));
     sockaddr.sin_family = AF_INET;
     sockaddr.sin_addr.s_addr = INADDR_ANY; // bind to all IPs on this computer
+    if (mapArgs.count("-disableinbound")) {
+      return true;
+    }
     sockaddr.sin_port = DEFAULT_PORT;
     if (::bind(hListenSocket, (struct sockaddr*)&sockaddr, sizeof(sockaddr)) == SOCKET_ERROR)
     {

so passing the -disableinbound switch makes it not try to bind the 8333 port.
mizerydearia
Hero Member
*****
Offline Offline

Activity: 574



View Profile
September 21, 2010, 12:49:37 PM
 #18

no reason to change that, as other clients only try to connect to 8333, afaict. IRC only advertises IP, right?

For IRC I set my user name to 8332 and my real name to 8333 as per server connection configuration and then connected.
Code:
/whois necrodearia
[necrodearia] (8332@address.net): 8333
* [necrodearia] #bitcoin-dev #bitcoin
* [necrodearia] peacock.heliacal.net :Chicago, IL USA
* [necrodearia] idle 00:00:09, signon: Tue Sep 21 07:46:38
* [necrodearia] End of WHOIS list.

Using this method, it is possible to embed port numbers that a client is using into their IRC connection so that ports are not restricted to 8332 and 8333.  I suggest implementing this or a related implementation into a future version of Bitcoin.

Satoshi o/
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
September 21, 2010, 01:31:38 PM
 #19

no reason to change that, as other clients only try to connect to 8333, afaict. IRC only advertises IP, right?

No, both IP and port are encoded in the #bitcoin IRC usernames (see the EncodeAddress/DecodeAddress routines in irc.cpp).

(so mizerydearia:  no need to do what you done did...)

How often do you get the chance to work on a potentially world-changing project?
nelisky
Legendary
*
Offline Offline

Activity: 1554


View Profile
September 21, 2010, 01:54:08 PM
 #20

no reason to change that, as other clients only try to connect to 8333, afaict. IRC only advertises IP, right?

No, both IP and port are encoded in the #bitcoin IRC usernames (see the EncodeAddress/DecodeAddress routines in irc.cpp).

(so mizerydearia:  no need to do what you done did...)

So I could use -inboundport=<port> and use that instead of DEFAULT_PORT, or if 0 disable inbound completely like I do now. Hmmm, I feel a patch to your patch coming.
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!