What is the rationale behind assigning random ports?

+2 votes

Hi!

I've been looking into MultiChain source code and you can find default values for ports:

  • src/chainparams/params.h
    • #define MC_DEFAULT_NETWORK_PORT 8571
    • #define MC_DEFAULT_RPC_PORT 8570
However, when you create a a new chain without specifying ports yourself, instead of getting the default ones, mc_MultichainParams::Create (used by multichain-util) assign a random value to them and the default values seems pretty useless. Why did you choose to use random ports instead of the default ones?
 
Thanks for your time.
asked Jun 15, 2017 by anonymous

1 Answer

+1 vote
Because people experimenting with MultiChain often create multiple chains, so it made more sense to have each chain with random ports instead of all with the same, which would cause port clashes on the system.
answered Jun 15, 2017 by MultiChain
...