what is the significance of the rpc port and it's relation to the functionality of bitcoin

0

In this outdated but seemingly comprehensive guide to creating an altcoin fork of bitcoin they make special mention of the need to change the rpc port.

Although in the intervening time the file names have changed the variables remain so I think this advice is still valid.

What is the purpose of these ports? What information do they transmit? Why are they there and why must we change them when creating a new network?


Step 4- Ports(required)

a) bitcoinrpc.cpp 
    -change RPC port.

    Code:
    ip::tcp::endpoint endpoint(bindAddress, GetArg("-rpcport", 55883));

    Code:
    if (!d.connect(GetArg("-rpcconnect", "127.0.0.1"), GetArg("-rpcport", "55883")))

b) init.cpp
   -change RPC port

    Code:
    -rpcport= " + _("Listen for JSON-RPC connections on  (default: 55883)") + "\n" +

    -change Testnet and Common port(P2P).

    Code:
    -port= " + _("Listen for connections on  (default: 55884 or testnet: 45884)") + "\n" +

c) protocol.h

  -Testnet and P2P port again.

    Code:
    return testnet ? 45883 : 55884;

smatthewenglish

Posted 2017-05-06T20:19:27.723

Reputation: 1 063

Answers

2

There's no reason why you need to change them if you're not concerned about running Bitcoin and an altcoin on the same device/IP address.

Nick ODell

Posted 2017-05-06T20:19:27.723

Reputation: 26 536

2

The RPC port is the port used for tools such as bitcoin-cli to connect to the node and execute administrative commands (this is why it's bound by default to localhost / 127.0.0.1).

The reason it should be changed is so that it doesn't create conflicts if you wanted to run your altcoin on the same system as a bitcoin node, since only one can use a given port.

Darth Android

Posted 2017-05-06T20:19:27.723

Reputation: 121