Author

Topic: Question about ports numbers (Read 183 times)

member
Activity: 252
Merit: 11
Lord Shiva
April 12, 2018, 05:48:44 AM
#6
Stramyc, great thank you!
full member
Activity: 198
Merit: 130
Some random software engineer
April 12, 2018, 04:38:25 AM
#5
Yes, you can run multiple coins, specifying different -port (default 8333 for bitcoin) & -rpcport (defalt 8332).
If your daemon are using the same datadir (like Bitcoin Core & Bitcoin ABC, that are using $HOME/.bitcoin/ under linux/mac systems), you have to specify another one using -datadir.
Besides this, you're all good!

Thank you so much!

That is, they will not work on same port in any way?

If your first daemon is running on 8332/8333, and the 2nd on 9332/9333, obviously no, then won't work on the same ports.

The only way to use multiple daemon using the same ports is to use different IPs (you may want to run, say, X masternodes for testing on your own computer, you can use 127.0.0.2, 127.0.0.3, 127.0.0.4... and make sure to bind the port only on one IP, dedicated on IP by daemon. Note that if you're using 127.x.x.x IPs that they are internal - called loopback - IPs, and they are not reachable by any other servers/computers).

The following settings is working:

Code:
$ mkdir /tmp/btc-testnet{1,2,3}
$ /opt/bitcoin/bin/bitcoind -server -testnet -daemon -bind=127.0.0.2 -port=18333 -rpcbind=127.0.0.2:18332 -rpcallowip=127.0.0.2 -datadir=/tmp/btc-testnet1
Bitcoin server starting
$ /opt/bitcoin/bin/bitcoind -server -testnet -daemon -bind=127.0.0.3 -port=18333 -rpcbind=127.0.0.3:18332 -rpcallowip=127.0.0.3 -datadir=/tmp/btc-testnet2
Bitcoin server starting
$ /opt/bitcoin/bin/bitcoind -server -testnet -daemon -bind=127.0.0.4 -port=18333 -rpcbind=127.0.0.4:18332 -rpcallowip=127.0.0.4 -datadir=/tmp/btc-testnet3
Bitcoin server starting

$ ps auxw|grep testnet
mycroft  31588 39.4  1.4 1416208 469844 ?      Ssl  10:35   0:18 /opt/bitcoin/bin/bitcoind -server -testnet -daemon -bind=127.0.0.2 -port=18333 -rpcbind=127.0.0.2:18332 -rpcallowip=127.0.0.2 -datadir=/tmp/btc-testnet1
mycroft  31658 15.9  0.4 1056564 138540 ?      Ssl  10:35   0:02 /opt/bitcoin/bin/bitcoind -server -testnet -daemon -bind=127.0.0.3 -port=18333 -rpcbind=127.0.0.3:18332 -rpcallowip=127.0.0.3 -datadir=/tmp/btc-testnet2
mycroft  31689  8.0  0.2 1054436 85972 ?       Ssl  10:36   0:00 /opt/bitcoin/bin/bitcoind -server -testnet -daemon -bind=127.0.0.4 -port=18333 -rpcbind=127.0.0.4:18332 -rpcallowip=127.0.0.4 -datadir=/tmp/btc-testnet3

$ netstat -nap|grep -E "(31588|31658|31689)"|grep LISTEN
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.4:18332         0.0.0.0:*               LISTEN      31689/bitcoind
tcp        0      0 127.0.0.3:18332         0.0.0.0:*               LISTEN      31658/bitcoind
tcp        0      0 127.0.0.2:18332         0.0.0.0:*               LISTEN      31588/bitcoind
tcp        0      0 127.0.0.4:18333         0.0.0.0:*               LISTEN      31689/bitcoind
tcp        0      0 127.0.0.3:18333         0.0.0.0:*               LISTEN      31658/bitcoind
tcp        0      0 127.0.0.2:18333         0.0.0.0:*               LISTEN      31588/bitcoind

Note that you need to specify both rpcbind & rpcallowip, or it won't work. (rpcbind will be ignored if rpcallowip doesn't work).

If you want to use multiple daemon on the same hosts using the same external ports, you'll have to have multiple external ips (failover ip) binded on this host.
sr. member
Activity: 322
Merit: 363
39twH4PSYgDSzU7sLnRoDfthR6gWYrrPoD
April 12, 2018, 04:28:10 AM
#4

Thank you so much!

That is, they will not work on same port in any way?
Not at the same time, no.
member
Activity: 252
Merit: 11
Lord Shiva
April 12, 2018, 04:11:21 AM
#3
Yes, you can run multiple coins, specifying different -port (default 8333 for bitcoin) & -rpcport (defalt 8332).
If your daemon are using the same datadir (like Bitcoin Core & Bitcoin ABC, that are using $HOME/.bitcoin/ under linux/mac systems), you have to specify another one using -datadir.
Besides this, you're all good!

Thank you so much!

That is, they will not work on same port in any way?
full member
Activity: 198
Merit: 130
Some random software engineer
April 12, 2018, 04:01:54 AM
#2
Yes, you can run multiple coins, specifying different -port (default 8333 for bitcoin) & -rpcport (defalt 8332).
If your daemon are using the same datadir (like Bitcoin Core & Bitcoin ABC, that are using $HOME/.bitcoin/ under linux/mac systems), you have to specify another one using -datadir.
Besides this, you're all good!
member
Activity: 252
Merit: 11
Lord Shiva
April 12, 2018, 03:58:13 AM
#1
Hello!

If I create a bitcoin-clone that works on 8333 port (not changing)

And than I run it both (bitcoind and bitcoinclond) on the same ubuntu-server as daemons - is that daemons will works correctly?

If not - what can I do? Only change a port-number? Or there are another options?

Thank you!

//This is a practical question. I need to run a lot of different altcoins on the same server.
Jump to: