Skip to content

Commit

Permalink
Merge #10825: net: set regtest JSON-RPC port to 18443 to avoid confli…
Browse files Browse the repository at this point in the history
…ct with testnet 18332

Summary:
ce3baa1 changed regtest RPCport to 18443 to avoid conflict with testnet 18332 (Ferdinando M. Ametrano)

Pull request description:

  using the same JSON-RPC default port for both testnet and regtest prevents running both at the same time on the same machine. Since RPCport=P2Pport-1 for both mainnet and testnet, and regtest P2Pport being 18444, 18443 is proposed for regtest RPCport

  Documentation has been updated (or created where missing); manpages doc/man/bitcoin*.1 could include information for regtest too

Tree-SHA512: d42185f7ef54dc918ece19b543c8681d08bb9c5a971394e21f2d9a1091734b091b08df69fab622c207b46f402cf9323ded5b7a33fbd0af722388930169124e7f

Backport of Core PR10825
https://github.com/bitcoin/bitcoin/pull/10825/files

Test Plan:
```
make check
test_runner.py
```

Reviewers: #bitcoin_abc, deadalnix, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D3773
  • Loading branch information
laanwj authored and jasonbcox committed Aug 2, 2019
1 parent a061908 commit b65a823
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions contrib/linearize/example-linearize.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ rpcuser=someuser
rpcpassword=somepassword
#datadir=~/.bitcoin
host=127.0.0.1

#mainnet default
port=8332

#testnet default
#port=18332

#regtest default
#port=18443

# bootstrap.dat hashlist settings (linearize-hashes)
max_height=313000

Expand Down
4 changes: 4 additions & 0 deletions contrib/rpm/bitcoin.spec
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ done
%{_sbindir}/semanage port -a -t bitcoin_port_t -p tcp 8333
%{_sbindir}/semanage port -a -t bitcoin_port_t -p tcp 18332
%{_sbindir}/semanage port -a -t bitcoin_port_t -p tcp 18333
%{_sbindir}/semanage port -a -t bitcoin_port_t -p tcp 18443
%{_sbindir}/semanage port -a -t bitcoin_port_t -p tcp 18444
%{_sbindir}/fixfiles -R bitcoin-server restore &> /dev/null || :
%{_sbindir}/restorecon -R %{_localstatedir}/lib/bitcoin || :
fi
Expand All @@ -355,6 +357,8 @@ if [ $1 -eq 0 ]; then
%{_sbindir}/semanage port -d -p tcp 8333
%{_sbindir}/semanage port -d -p tcp 18332
%{_sbindir}/semanage port -d -p tcp 18333
%{_sbindir}/semanage port -d -p tcp 18443
%{_sbindir}/semanage port -d -p tcp 18444
for selinuxvariant in %{selinux_variants}; do
%{_sbindir}/semodule -s ${selinuxvariant} -r bitcoin &> /dev/null || :
done
Expand Down
2 changes: 1 addition & 1 deletion doc/REST-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Unauthenticated REST Interface

The REST API can be enabled with the `-rest` option.

The interface runs on the same port as the JSON-RPC interface, by default port 8332 for mainnet and port 18332 for testnet.
The interface runs on the same port as the JSON-RPC interface, by default port 8332 for mainnet, port 18332 for testnet, and port 18443 for regtest.

Supported API
-------------
Expand Down
2 changes: 1 addition & 1 deletion src/chainparamsbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class CBaseTestNetParams : public CBaseChainParams {
class CBaseRegTestParams : public CBaseChainParams {
public:
CBaseRegTestParams() {
nRPCPort = 18332;
nRPCPort = 18443;
strDataDir = "regtest";
}
};
Expand Down

0 comments on commit b65a823

Please sign in to comment.