• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

Why restrict port for mainnet?

europound

Member
must be 9999 for mainnet ?
why would you restrict port for mn?
why can't it be flexible?
 
Last edited:
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"?
 
Are you sure? It should broadcast which port it is listening on when it connects to the other peers.
 
@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.
 
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
 
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).
 
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;
        }
 
Back
Top