Why restrict port for mainnet?

europound

Member
Oct 22, 2016
120
1
68
71
must be 9999 for mainnet ?
why would you restrict port for mn?
why can't it be flexible?
 
Last edited:

Figlmüller

Member
Sep 2, 2014
85
45
58
Vienna, Austria
must be 9999 for mainnet ?
why would you restrict port for mn?
why can't it be flexible?
I think because some people don't like poking holes into their firewalls for every outgoing connection or datagram packet to random ports. 1 Port = 1 Service. That's what we have agreed upon, how it has always been, and what makes lifes of sysadmins easier.

So: Why should it be "flexible"?
 

europound

Member
Oct 22, 2016
120
1
68
71
you don't think good
give people options
why should i buy new ips?
with RIPE rules it is getting difficult
 

strophy

Administrator
Dash Core Team
Dash Support Group
Feb 13, 2016
767
451
133
Are you sure? It should broadcast which port it is listening on when it connects to the other peers.
 

thephez

Member
Dash Core Team
Jan 23, 2016
125
62
78
@europound @strophy I got curious about this and did a little digging. Running a normal node on another port should be fine - outbound connections will work without issue so you can stay in sync. The code is biased to avoid connecting to nodes on a non-standard port though so a masternode would probably not work well.

You can see a discussion (between Satoshi, Andresen, Garzik and other classics) of the security reasons for avoiding non-standard ports here - https://bitcointalk.org/index.php?topic=589.0;all. Info here also - https://bitcoin.stackexchange.com/a/32169 (code mentioned found here in Dash Core).

I have not seen good arguments for enabling a non-default port and the bitcoin guys seemed to think the issue was settled around 2011.
 
  • Like
Reactions: UdjinM6 and strophy

europound

Member
Oct 22, 2016
120
1
68
71
no security issue
nodes can verify authenticity of each other on any port

but RIPE policy for issuing new ips is a real problem and expensive
 

thephez

Member
Dash Core Team
Jan 23, 2016
125
62
78
no security issue
nodes can verify authenticity of each other on any port
Yes they can, but my impression of those links is that the primary security concern was DDoS (not verifying authenticity).

but RIPE policy for issuing new ips is a real problem and expensive
It sounds like you are wanting to run multiple MNs off a single IP using multiple ports. Dash Core specifically prevents this (even if you could run on different ports).
 

homesoft

New Member
Jun 17, 2018
8
0
1
44
In this and several other places there is a restriction. But there are altcoins in which the port change is allowed.

Code:
int mainnetDefaultPort = Params(CBaseChainParams::MAIN).GetDefaultPort();
    if(Params().NetworkIDString() == CBaseChainParams::MAIN) {
        if(service.GetPort() != mainnetDefaultPort) {
            nState = ACTIVE_MASTERNODE_NOT_CAPABLE;
            strNotCapableReason = strprintf("Invalid port: %u - only %d is supported on mainnet.", service.GetPort(), mainnetDefaultPort);
            LogPrintf("CActiveMasternode::ManageStateInitial -- %s: %s\n", GetStateString(), strNotCapableReason);
            return;
        }