Merge pull request #40 from jc23424/update-ports

update ports
This commit is contained in:
BlueSilver22 2018-02-03 19:24:46 -06:00 committed by GitHub
commit 01470c0809
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 127 additions and 133 deletions

View File

@ -1,6 +1,6 @@
Bitcoin Private v1.0.10-1
NOTICE, the default ports have changed! The p2p port is now 8033 and rpcport is 8023
NOTICE, the default ports have changed! The p2p port is now 7933 and rpcport is 7932
What is Bitcoin Private?
----------------

View File

@ -11,9 +11,9 @@ rpcpass = ""
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8023")
access = ServiceProxy("http://127.0.0.1:7932")
else:
access = ServiceProxy("http://"+rpcuser+":"+rpcpass+"@127.0.0.1:8023")
access = ServiceProxy("http://"+rpcuser+":"+rpcpass+"@127.0.0.1:7932")
cmd = sys.argv[1].lower()
if cmd == "backupwallet":

View File

@ -44,11 +44,11 @@
# Use as many addnode= settings as you like to connect to specific peers
#addnode=69.164.218.197
#addnode=10.0.0.2:8233
#addnode=10.0.0.2:7933
# Alternatively use as many connect= settings as you like to connect ONLY to specific peers
#connect=69.164.218.197
#connect=10.0.0.1:8233
#connect=10.0.0.1:7933
# Listening mode, enabled by default except when 'connect' is being used
#listen=1
@ -72,7 +72,7 @@
#rpcpassword=YourSuperGreatPasswordNumber_DO_NOT_USE_THIS_OR_YOU_WILL_GET_ROBBED_385593
# How many seconds Bitcoin Private will wait for a complete RPC HTTP request.
# after the HTTP connection is established.
# after the HTTP connection is established.
#rpcclienttimeout=30
# By default, only RPC connections from localhost are allowed.
@ -80,7 +80,7 @@
# either as a single IPv4/IPv6 or with a subnet specification.
# NOTE: opening up the RPC port to hosts outside your local trusted network is NOT RECOMMENDED,
# because the rpcpassword is transmitted over the network unencrypted and also because anyone
# because the rpcpassword is transmitted over the network unencrypted and also because anyone
# that can authenticate on the RPC port can steal your keys + take over the account running btcpd
# For more information see https://github.com/zcash/zcash/issues/1497
@ -89,7 +89,7 @@
#rpcallowip=2001:db8:85a3:0:0:8a2e:370:7334/96
# Listen for RPC connections on this TCP port:
#rpcport=8232
#rpcport=7932
# You can use Bitcoin Private or btcpd to send commands to btcpd
# running on another host using this option:
@ -122,8 +122,6 @@
# Pay an optional transaction fee every time you send Bitcoin Private. Transactions with fees
# are more likely than free transactions to be included in generated blocks, so may
# be validated sooner. This setting does not affect private transactions created with
# be validated sooner. This setting does not affect private transactions created with
# 'z_sendmany'.
#paytxfee=0.00

View File

@ -3,8 +3,8 @@
rpcuser=someuser
rpcpassword=somepassword
host=127.0.0.1
port=8232
#port=18232
port=7932
#port=17932
# bootstrap.dat hashlist settings (linearize-hashes)
max_height=313000

View File

@ -96,7 +96,7 @@ if __name__ == '__main__':
if 'host' not in settings:
settings['host'] = '127.0.0.1'
if 'port' not in settings:
settings['port'] = 8232
settings['port'] = 7932
if 'min_height' not in settings:
settings['min_height'] = 0
if 'max_height' not in settings:
@ -110,4 +110,3 @@ if __name__ == '__main__':
settings['max_height'] = int(settings['max_height'])
get_block_hashes(settings)

View File

@ -1,5 +1,5 @@
### Qos ###
This is a Linux bash script that will set up tc to limit the outgoing bandwidth for connections to the Bitcoin network. It limits outbound TCP traffic with a source or destination port of 8233, but not if the destination IP is within a LAN (defined as 192.168.x.x).
This is a Linux bash script that will set up tc to limit the outgoing bandwidth for connections to the Bitcoin network. It limits outbound TCP traffic with a source or destination port of 7933, but not if the destination IP is within a LAN (defined as 192.168.x.x).
This means one can have an always-on bitcoind instance running, and another local bitcoind/bitcoin-qt instance which connects to this node and receives blocks from it.

View File

@ -32,10 +32,10 @@ tc filter add dev ${IF} parent 1: protocol ip prio 2 handle 2 fw classid 1:11
# ret=$?
#done
#limit outgoing traffic to and from port 8233. but not when dealing with a host on the local network
#limit outgoing traffic to and from port 7933. but not when dealing with a host on the local network
# (defined by $LOCALNET)
# --set-mark marks packages matching these criteria with the number "2"
# these packages are filtered by the tc filter with "handle 2"
# this filter sends the packages into the 1:11 class, and this class is limited to ${LIMIT}
iptables -t mangle -A OUTPUT -p tcp -m tcp --dport 8233 ! -d ${LOCALNET} -j MARK --set-mark 0x2
iptables -t mangle -A OUTPUT -p tcp -m tcp --sport 8233 ! -d ${LOCALNET} -j MARK --set-mark 0x2
iptables -t mangle -A OUTPUT -p tcp -m tcp --dport 7933 ! -d ${LOCALNET} -j MARK --set-mark 0x2
iptables -t mangle -A OUTPUT -p tcp -m tcp --sport 7933 ! -d ${LOCALNET} -j MARK --set-mark 0x2

View File

@ -11,7 +11,7 @@ argument:
nodes_main.txt
nodes_test.txt
These files must consist of lines in the format
These files must consist of lines in the format
<ip>
<ip>:<port>
@ -127,12 +127,11 @@ def main():
g.write(' * IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly.\n')
g.write(' */\n')
with open(os.path.join(indir,'nodes_main.txt'),'r') as f:
process_nodes(g, f, 'pnSeed6_main', 8233)
process_nodes(g, f, 'pnSeed6_main', 7933)
g.write('\n')
with open(os.path.join(indir,'nodes_test.txt'),'r') as f:
process_nodes(g, f, 'pnSeed6_test', 18233)
process_nodes(g, f, 'pnSeed6_test', 17933)
g.write('#endif // BITCOIN_CHAINPARAMSSEEDS_H\n')
if __name__ == '__main__':
main()

View File

@ -67,7 +67,7 @@ def connect_JSON(config):
testnet = config.get('testnet', '0')
testnet = (int(testnet) > 0) # 0/1 in config file, convert to True/False
if not 'rpcport' in config:
config['rpcport'] = 18232 if testnet else 8232
config['rpcport'] = 17932 if testnet else 7932
connect = "http://%s:%s@127.0.0.1:%s"%(config['rpcuser'], config['rpcpassword'], config['rpcport'])
try:
result = ServiceProxy(connect)
@ -114,7 +114,7 @@ def list_available(bitcoind):
# or pay-to-script-hash outputs right now; anything exotic is ignored.
if pk["type"] != "pubkeyhash" and pk["type"] != "scripthash":
continue
address = pk["addresses"][0]
if address in address_summary:
address_summary[address]["total"] += vout["value"]
@ -160,7 +160,7 @@ def create_tx(bitcoind, fromaddresses, toaddress, amount, fee):
# Python's json/jsonrpc modules have inconsistent support for Decimal numbers.
# Instead of wrestling with getting json.dumps() (used by jsonrpc) to encode
# Decimals, I'm casting amounts to float before sending them to bitcoind.
#
#
outputs = { toaddress : float(amount) }
(inputs, change_amount) = select_coins(needed, potential_inputs)
if change_amount > BASE_FEE: # don't bother with zero or tiny change

View File

@ -151,7 +151,7 @@ Threads
- ThreadMapPort : Universal plug-and-play startup/shutdown
- ThreadSocketHandler : Sends/Receives data from peers on port 8233.
- ThreadSocketHandler : Sends/Receives data from peers on port 7933.
- ThreadOpenAddedConnections : Opens network connections to added nodes.
@ -163,7 +163,7 @@ Threads
- ThreadFlushWalletDB : Close the wallet.dat file if it hasn't been used in 500ms.
- ThreadRPCServer : Remote procedure call handler, listens on port 8232 for connections and services them.
- ThreadRPCServer : Remote procedure call handler, listens on port 7932 for connections and services them.
- ZcashMiner : Generates zcash (if wallet is enabled).

View File

@ -47,7 +47,7 @@ Send commands to node running on <ip> (default: 127.0.0.1)
.HP
\fB\-rpcport=\fR<port>
.IP
Connect to JSON\-RPC on <port> (default: 8232 or testnet: 18232)
Connect to JSON\-RPC on <port> (default: 7932 or testnet: 17932)
.HP
\fB\-rpcwait\fR
.IP

View File

@ -189,7 +189,7 @@ Relay non\-P2SH multisig (default: 1)
.HP
\fB\-port=\fR<port>
.IP
Listen for connections on <port> (default: 8233 or testnet: 18233)
Listen for connections on <port> (default: 7933 or testnet: 17933)
.HP
\fB\-proxy=\fR<ip:port>
.IP
@ -434,8 +434,8 @@ Password for JSON\-RPC connections
.HP
\fB\-rpcport=\fR<port>
.IP
Listen for JSON\-RPC connections on <port> (default: 8232 or testnet:
18232)
Listen for JSON\-RPC connections on <port> (default: 7932 or testnet:
17932)
.HP
\fB\-rpcallowip=\fR<ip>
.IP

View File

@ -44,11 +44,11 @@ reachable from the Tor network. Add these lines to your /etc/tor/torrc (or equiv
config file):
HiddenServiceDir /var/lib/tor/zcash-service/
HiddenServicePort 8233 127.0.0.1:8233
HiddenServicePort 18233 127.0.0.1:18233
HiddenServicePort 7933 127.0.0.1:7933
HiddenServicePort 17933 127.0.0.1:17933
The directory can be different of course, but (both) port numbers should be equal to
your btcpd's P2P listen port (8233 by default).
your btcpd's P2P listen port (7933 by default).
-externalip=X You can tell Zcash about its publicly reachable address using
this option, and this can be a .onion address. Given the above
@ -83,7 +83,7 @@ as well, use `discover` instead:
./btcpd ... -discover
and open port 8233 on your firewall (or use -upnp).
and open port 7933 on your firewall (or use -upnp).
If you only want to use Tor to reach onion addresses, but not use it as a proxy
for normal IPv4/IPv6 communication, use:
@ -109,15 +109,15 @@ requires a Tor connection to work. It can be explicitly disabled with `-listenon
and, if not disabled, configured using the `-torcontrol` and `-torpassword` settings.
To show verbose debugging information, pass `-debug=tor`.
Connecting to Tor's control socket API requires one of two authentication methods to be
configured. For cookie authentication the user running btcpd must have write access
to the `CookieAuthFile` specified in Tor configuration. In some cases this is
preconfigured and the creation of a hidden service is automatic. If permission problems
are seen with `-debug=tor` they can be resolved by adding both the user running tor and
the user running btcpd to the same group and setting permissions appropriately. On
Debian-based systems the user running btcpd can be added to the debian-tor group,
which has the appropriate permissions. An alternative authentication method is the use
of the `-torpassword` flag and a `hash-password` which can be enabled and specified in
Connecting to Tor's control socket API requires one of two authentication methods to be
configured. For cookie authentication the user running btcpd must have write access
to the `CookieAuthFile` specified in Tor configuration. In some cases this is
preconfigured and the creation of a hidden service is automatic. If permission problems
are seen with `-debug=tor` they can be resolved by adding both the user running tor and
the user running btcpd to the same group and setting permissions appropriately. On
Debian-based systems the user running btcpd can be added to the debian-tor group,
which has the appropriate permissions. An alternative authentication method is the use
of the `-torpassword` flag and a `hash-password` which can be enabled and specified in
Tor configuration.
@ -136,7 +136,7 @@ Now use btcp-cli to verify there is only a single peer connection.
[
{
"id" : 1,
"addr" : "zctestseie6wxgio.onion:18233",
"addr" : "zctestseie6wxgio.onion:17933",
...
"version" : 170002,
"subver" : "/MagicBean:1.0.0/",

View File

@ -34,7 +34,7 @@ addnode connect to onion
addnode connect to generic DNS name
'''
class ProxyTest(BitcoinTestFramework):
class ProxyTest(BitcoinTestFramework):
def __init__(self):
# Create two proxies on different ports
# ... one unauthenticated
@ -65,9 +65,9 @@ class ProxyTest(BitcoinTestFramework):
# Note: proxies are not used to connect to local nodes
# this is because the proxy to use is based on CService.GetNetwork(), which return NET_UNROUTABLE for localhost
return start_nodes(4, self.options.tmpdir, extra_args=[
['-listen', '-debug=net', '-debug=proxy', '-proxy=%s:%i' % (self.conf1.addr),'-proxyrandomize=1'],
['-listen', '-debug=net', '-debug=proxy', '-proxy=%s:%i' % (self.conf1.addr),'-onion=%s:%i' % (self.conf2.addr),'-proxyrandomize=0'],
['-listen', '-debug=net', '-debug=proxy', '-proxy=%s:%i' % (self.conf2.addr),'-proxyrandomize=1'],
['-listen', '-debug=net', '-debug=proxy', '-proxy=%s:%i' % (self.conf1.addr),'-proxyrandomize=1'],
['-listen', '-debug=net', '-debug=proxy', '-proxy=%s:%i' % (self.conf1.addr),'-onion=%s:%i' % (self.conf2.addr),'-proxyrandomize=0'],
['-listen', '-debug=net', '-debug=proxy', '-proxy=%s:%i' % (self.conf2.addr),'-proxyrandomize=1'],
['-listen', '-debug=net', '-debug=proxy', '-proxy=[%s]:%i' % (self.conf3.addr),'-proxyrandomize=0', '-noonion']
])
@ -101,24 +101,24 @@ class ProxyTest(BitcoinTestFramework):
if test_onion:
# Test: outgoing onion connection through node
node.addnode("bitcoinostk4e4re.onion:8333", "onetry")
node.addnode("bitcoinostk4e4re.onion:7933", "onetry")
cmd = proxies[2].queue.get()
assert(isinstance(cmd, Socks5Command))
assert_equal(cmd.atyp, AddressType.DOMAINNAME)
assert_equal(cmd.addr, "bitcoinostk4e4re.onion")
assert_equal(cmd.port, 8333)
assert_equal(cmd.port, 7933)
if not auth:
assert_equal(cmd.username, None)
assert_equal(cmd.password, None)
rv.append(cmd)
# Test: outgoing DNS name connection through node
node.addnode("node.noumenon:8333", "onetry")
node.addnode("node.noumenon:7933", "onetry")
cmd = proxies[3].queue.get()
assert(isinstance(cmd, Socks5Command))
assert_equal(cmd.atyp, AddressType.DOMAINNAME)
assert_equal(cmd.addr, "node.noumenon")
assert_equal(cmd.port, 8333)
assert_equal(cmd.port, 7933)
if not auth:
assert_equal(cmd.username, None)
assert_equal(cmd.password, None)
@ -162,7 +162,7 @@ class ProxyTest(BitcoinTestFramework):
assert_equal(n1['onion']['proxy'], '%s:%i' % (self.conf2.addr))
assert_equal(n1['onion']['proxy_randomize_credentials'], False)
assert_equal(n1['onion']['reachable'], True)
n2 = networks_dict(self.nodes[2].getnetworkinfo())
for net in ['ipv4','ipv6','onion']:
assert_equal(n2[net]['proxy'], '%s:%i' % (self.conf2.addr))
@ -177,4 +177,3 @@ class ProxyTest(BitcoinTestFramework):
if __name__ == '__main__':
ProxyTest().main()

View File

@ -24,7 +24,7 @@ class RawTransactionsTest(BitcoinTestFramework):
self.nodes = start_nodes(3, self.options.tmpdir)
#connect to a local machine for debugging
#url = "http://bitcoinrpc:DP6DvqZtqXarpeNWyN3LZTFchCCyCUuHwNF7E8pX99x1@%s:%d" % ('127.0.0.1', 18232)
#url = "http://bitcoinrpc:DP6DvqZtqXarpeNWyN3LZTFchCCyCUuHwNF7E8pX99x1@%s:%d" % ('127.0.0.1', 17932)
#proxy = AuthServiceProxy(url)
#proxy.url = url # store URL on proxy for info
#self.nodes.append(proxy)
@ -131,7 +131,7 @@ class RawTransactionsTest(BitcoinTestFramework):
rawTx = self.nodes[2].createrawtransaction(inputs, outputs)
rawTxPartialSigned = self.nodes[1].signrawtransaction(rawTx, inputs)
assert_equal(rawTxPartialSigned['complete'], False) #node1 only has one key, can't comp. sign the tx
rawTxSigned = self.nodes[2].signrawtransaction(rawTx, inputs)
assert_equal(rawTxSigned['complete'], True) #node2 can sign the tx compl., own two of three keys
self.nodes[2].sendrawtransaction(rawTxSigned['hex'])

View File

@ -34,7 +34,7 @@ std::string HelpMessageCli()
strUsage += HelpMessageOpt("-regtest", _("Enter regression test mode, which uses a special chain in which blocks can be "
"solved instantly. This is intended for regression testing tools and app development."));
strUsage += HelpMessageOpt("-rpcconnect=<ip>", strprintf(_("Send commands to node running on <ip> (default: %s)"), "127.0.0.1"));
strUsage += HelpMessageOpt("-rpcport=<port>", strprintf(_("Connect to JSON-RPC on <port> (default: %u or testnet: %u)"), 8023, 18023));
strUsage += HelpMessageOpt("-rpcport=<port>", strprintf(_("Connect to JSON-RPC on <port> (default: %u or testnet: %u)"), 7932, 17932));
strUsage += HelpMessageOpt("-rpcwait", _("Wait for RPC server to start"));
strUsage += HelpMessageOpt("-rpcuser=<user>", _("Username for JSON-RPC connections"));
strUsage += HelpMessageOpt("-rpcpassword=<pw>", _("Password for JSON-RPC connections"));

View File

@ -56,7 +56,7 @@ public:
pchMessageStart[2] = 0xb2;
pchMessageStart[3] = 0xed;
vAlertPubKey = ParseHex("04f2cd746e629ffd320a81287474c98c2ad15d15b0a210b0144edcd8f3e1301c6311fd751fa34ba17d88090374cfec7cd9aaca55a5a0c4456511acc01b922005de");
nDefaultPort = 8033;
nDefaultPort = 7933;
nMaxTipAge = 24 * 60 * 60;
nPruneAfterHeight = 100000;
const size_t N = 200, K = 9;
@ -94,9 +94,8 @@ public:
vFixedSeeds.clear();
vSeeds.clear();
//vSeeds.push_back(CDNSSeedData("zclassic.org", "dnsseed.zclassic.org")); // zclassic
vSeeds.push_back(CDNSSeedData("indieonion.org", "dnsseed.indieonion.org")); // @IndieOnion
vSeeds.push_back(CDNSSeedData("rotorproject.org", "dnsseed.rotorproject.org")); // @IndieOnion
// TODO: setup a DNSSeed
//vSeeds.push_back(CDNSSeedData("btcprivate.org", "dnsseed.btcprivate.org"));
// guarantees the first 2 characters, when base58 encoded, are "t1"
base58Prefixes[PUBKEY_ADDRESS] = {0x1C,0xB8};
@ -215,7 +214,7 @@ public:
pchMessageStart[2] = 0xf6;
pchMessageStart[3] = 0xd6;
vAlertPubKey = ParseHex("048679fb891b15d0cada9692047fd0ae26ad8bfb83fabddbb50334ee5bc0683294deb410be20513c5af6e7b9cec717ade82b27080ee6ef9a245c36a795ab044bb3");
nDefaultPort = 18233;
nDefaultPort = 17933;
nPruneAfterHeight = 1000;
//! Modify the testnet genesis block so the timestamp is valid for a later start.
@ -228,7 +227,8 @@ public:
vFixedSeeds.clear();
vSeeds.clear();
vSeeds.push_back(CDNSSeedData("rotorproject.org", "test-dnsseed.rotorproject.org")); // Bitcoin Private
// TODO: setup a DNSSeed
//vSeeds.push_back(CDNSSeedData("btcprivate.org", "dnsseed.testnet.btcprivate.org"));
// guarantees the first 2 characters, when base58 encoded, are "tm"
base58Prefixes[PUBKEY_ADDRESS] = {0x1D,0x25};
@ -314,7 +314,7 @@ public:
genesis.nNonce = uint256S("0x0000000000000000000000000000000000000000000000000000000000000009");
genesis.nSolution = ParseHex("05ffd6ad016271ade20cfce093959c3addb2079629f9f123c52ef920caa316531af5af3f");
consensus.hashGenesisBlock = genesis.GetHash();
nDefaultPort = 18033;
nDefaultPort = 17944;
assert(consensus.hashGenesisBlock == uint256S("0x0575f78ee8dc057deee78ef691876e3be29833aaee5e189bb0459c087451305a"));
nPruneAfterHeight = 1000;

View File

@ -17,7 +17,7 @@ class CBaseMainParams : public CBaseChainParams
public:
CBaseMainParams()
{
nRPCPort = 8023;
nRPCPort = 7932;
}
};
static CBaseMainParams mainParams;
@ -30,7 +30,7 @@ class CBaseTestNetParams : public CBaseMainParams
public:
CBaseTestNetParams()
{
nRPCPort = 18023;
nRPCPort = 17932;
strDataDir = "testnet4";
}
};

View File

@ -19,7 +19,7 @@
* for both bitcoind and bitcoin-core, to make it harder for attackers to
* target servers or GUI users specifically.
*/
const std::string CLIENT_NAME("NTwoR"); // No Taxation without Representation
const std::string CLIENT_NAME("BTCP");
/**
* Client version number
@ -117,8 +117,8 @@ std::string FormatFullVersion()
return CLIENT_BUILD;
}
/**
* Format the subversion field according to BIP 14 spec (https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki)
/**
* Format the subversion field according to BIP 14 spec (https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki)
*/
std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments)
{

View File

@ -386,7 +386,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-onion=<ip:port>", strprintf(_("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)"), "-proxy"));
strUsage += HelpMessageOpt("-onlynet=<net>", _("Only connect to nodes in network <net> (ipv4, ipv6 or onion)"));
strUsage += HelpMessageOpt("-permitbaremultisig", strprintf(_("Relay non-P2SH multisig (default: %u)"), 1));
strUsage += HelpMessageOpt("-port=<port>", strprintf(_("Listen for connections on <port> (default: %u or testnet: %u)"), 8233, 18233));
strUsage += HelpMessageOpt("-port=<port>", strprintf(_("Listen for connections on <port> (default: %u or testnet: %u)"), 7933, 17933));
strUsage += HelpMessageOpt("-proxy=<ip:port>", _("Connect through SOCKS5 proxy"));
strUsage += HelpMessageOpt("-proxyrandomize", strprintf(_("Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)"), 1));
strUsage += HelpMessageOpt("-seednode=<ip>", _("Connect to a node to retrieve peer addresses, and disconnect"));
@ -514,7 +514,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-rpcbind=<addr>", _("Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces)"));
strUsage += HelpMessageOpt("-rpcuser=<user>", _("Username for JSON-RPC connections"));
strUsage += HelpMessageOpt("-rpcpassword=<pw>", _("Password for JSON-RPC connections"));
strUsage += HelpMessageOpt("-rpcport=<port>", strprintf(_("Listen for JSON-RPC connections on <port> (default: %u or testnet: %u)"), 8023, 18023));
strUsage += HelpMessageOpt("-rpcport=<port>", strprintf(_("Listen for JSON-RPC connections on <port> (default: %u or testnet: %u)"), 7932, 17932));
strUsage += HelpMessageOpt("-rpcallowip=<ip>", _("Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times"));
strUsage += HelpMessageOpt("-rpcthreads=<n>", strprintf(_("Set the number of threads to service RPC calls (default: %d)"), DEFAULT_HTTP_THREADS));
if (showDebug) {
@ -1719,4 +1719,3 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
return !fRequestShutdown;
}

View File

@ -179,8 +179,8 @@ UniValue addnode(const UniValue& params, bool fHelp)
"1. \"node\" (string, required) The node (see getpeerinfo for nodes)\n"
"2. \"command\" (string, required) 'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once\n"
"\nExamples:\n"
+ HelpExampleCli("addnode", "\"192.168.0.6:8233\" \"onetry\"")
+ HelpExampleRpc("addnode", "\"192.168.0.6:8233\", \"onetry\"")
+ HelpExampleCli("addnode", "\"192.168.0.6:7933\" \"onetry\"")
+ HelpExampleRpc("addnode", "\"192.168.0.6:7933\", \"onetry\"")
);
string strNode = params[0].get_str();
@ -223,8 +223,8 @@ UniValue disconnectnode(const UniValue& params, bool fHelp)
"\nArguments:\n"
"1. \"node\" (string, required) The node (see getpeerinfo for nodes)\n"
"\nExamples:\n"
+ HelpExampleCli("disconnectnode", "\"192.168.0.6:8233\"")
+ HelpExampleRpc("disconnectnode", "\"192.168.0.6:8233\"")
+ HelpExampleCli("disconnectnode", "\"192.168.0.6:7933\"")
+ HelpExampleRpc("disconnectnode", "\"192.168.0.6:7933\"")
);
CNode* pNode = FindNode(params[0].get_str());
@ -255,7 +255,7 @@ UniValue getaddednodeinfo(const UniValue& params, bool fHelp)
" \"connected\" : true|false, (boolean) If connected\n"
" \"addresses\" : [\n"
" {\n"
" \"address\" : \"192.168.0.201:8233\", (string) The bitcoin server host and port\n"
" \"address\" : \"192.168.0.201:7933\", (string) The bitcoin server host and port\n"
" \"connected\" : \"outbound\" (string) connection, inbound or outbound\n"
" }\n"
" ,...\n"

View File

@ -426,7 +426,7 @@ bool StartRPC()
// Launch one async rpc worker. The ability to launch multiple workers is not recommended at present and thus the option is disabled.
getAsyncRPCQueue()->addWorker();
/*
/*
int n = GetArg("-rpcasyncthreads", 1);
if (n<1) {
LogPrintf("ERROR: Invalid value %d for -rpcasyncthreads. Must be at least 1.\n", n);
@ -585,7 +585,7 @@ std::string HelpExampleCli(const std::string& methodname, const std::string& arg
std::string HelpExampleRpc(const std::string& methodname, const std::string& args)
{
return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", "
"\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:8032/\n";
"\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:7932/\n";
}
void RPCRegisterTimerInterface(RPCTimerInterface *iface)

View File

@ -77,8 +77,8 @@ void ThreadSendAlert()
// These versions are protocol versions
// 170002 : 1.0.0
alert.nMinVer = 170002;
alert.nMaxVer = 170002;
alert.nMinVer = 180003;
alert.nMaxVer = 180003;
//
// main.cpp:

View File

@ -67,22 +67,22 @@ BOOST_AUTO_TEST_CASE(addrman_simple)
BOOST_CHECK(addr_null.ToString() == "[::]:0");
// Test 2: Does Addrman::Add work as expected.
CService addr1 = CService("250.1.1.1", 8333);
CService addr1 = CService("250.1.1.1", 7933);
addrman.Add(CAddress(addr1), source);
BOOST_CHECK(addrman.size() == 1);
CAddrInfo addr_ret1 = addrman.Select();
BOOST_CHECK(addr_ret1.ToString() == "250.1.1.1:8333");
BOOST_CHECK(addr_ret1.ToString() == "250.1.1.1:7933");
// Test 3: Does IP address deduplication work correctly.
// Expected dup IP should not be added.
CService addr1_dup = CService("250.1.1.1", 8333);
CService addr1_dup = CService("250.1.1.1", 7933);
addrman.Add(CAddress(addr1_dup), source);
BOOST_CHECK(addrman.size() == 1);
// Test 5: New table has one addr and we add a diff addr we should
// have two addrs.
CService addr2 = CService("250.1.1.2", 8333);
CService addr2 = CService("250.1.1.2", 7933);
addrman.Add(CAddress(addr2), source);
BOOST_CHECK(addrman.size() == 2);
@ -105,7 +105,7 @@ BOOST_AUTO_TEST_CASE(addrman_ports)
BOOST_CHECK(addrman.size() == 0);
// Test 7; Addr with same IP but diff port does not replace existing addr.
CService addr1 = CService("250.1.1.1", 8333);
CService addr1 = CService("250.1.1.1", 7933);
addrman.Add(CAddress(addr1), source);
BOOST_CHECK(addrman.size() == 1);
@ -113,7 +113,7 @@ BOOST_AUTO_TEST_CASE(addrman_ports)
addrman.Add(CAddress(addr1_port), source);
BOOST_CHECK(addrman.size() == 1);
CAddrInfo addr_ret2 = addrman.Select();
BOOST_CHECK(addr_ret2.ToString() == "250.1.1.1:8333");
BOOST_CHECK(addr_ret2.ToString() == "250.1.1.1:7933");
// Test 8: Add same IP but diff port to tried table, it doesn't get added.
// Perhaps this is not ideal behavior but it is the current behavior.
@ -121,7 +121,7 @@ BOOST_AUTO_TEST_CASE(addrman_ports)
BOOST_CHECK(addrman.size() == 1);
bool newOnly = true;
CAddrInfo addr_ret3 = addrman.Select(newOnly);
BOOST_CHECK(addr_ret3.ToString() == "250.1.1.1:8333");
BOOST_CHECK(addr_ret3.ToString() == "250.1.1.1:7933");
}
@ -135,13 +135,13 @@ BOOST_AUTO_TEST_CASE(addrman_select)
CNetAddr source = CNetAddr("252.2.2.2");
// Test 9: Select from new with 1 addr in new.
CService addr1 = CService("250.1.1.1", 8333);
CService addr1 = CService("250.1.1.1", 7933);
addrman.Add(CAddress(addr1), source);
BOOST_CHECK(addrman.size() == 1);
bool newOnly = true;
CAddrInfo addr_ret1 = addrman.Select(newOnly);
BOOST_CHECK(addr_ret1.ToString() == "250.1.1.1:8333");
BOOST_CHECK(addr_ret1.ToString() == "250.1.1.1:7933");
// Test 10: move addr to tried, select from new expected nothing returned.
addrman.Good(CAddress(addr1));
@ -150,40 +150,40 @@ BOOST_AUTO_TEST_CASE(addrman_select)
BOOST_CHECK(addr_ret2.ToString() == "[::]:0");
CAddrInfo addr_ret3 = addrman.Select();
BOOST_CHECK(addr_ret3.ToString() == "250.1.1.1:8333");
BOOST_CHECK(addr_ret3.ToString() == "250.1.1.1:7933");
BOOST_CHECK(addrman.size() == 1);
// Add three addresses to new table.
CService addr2 = CService("250.3.1.1", 8333);
CService addr2 = CService("250.3.1.1", 7933);
CService addr3 = CService("250.3.2.2", 9999);
CService addr4 = CService("250.3.3.3", 9999);
addrman.Add(CAddress(addr2), CService("250.3.1.1", 8333));
addrman.Add(CAddress(addr3), CService("250.3.1.1", 8333));
addrman.Add(CAddress(addr4), CService("250.4.1.1", 8333));
addrman.Add(CAddress(addr2), CService("250.3.1.1", 7933));
addrman.Add(CAddress(addr3), CService("250.3.1.1", 7933));
addrman.Add(CAddress(addr4), CService("250.4.1.1", 7933));
// Add three addresses to tried table.
CService addr5 = CService("250.4.4.4", 8333);
CService addr5 = CService("250.4.4.4", 7933);
CService addr6 = CService("250.4.5.5", 7777);
CService addr7 = CService("250.4.6.6", 8333);
CService addr7 = CService("250.4.6.6", 7933);
addrman.Add(CAddress(addr5), CService("250.3.1.1", 8333));
addrman.Add(CAddress(addr5), CService("250.3.1.1", 7933));
addrman.Good(CAddress(addr5));
addrman.Add(CAddress(addr6), CService("250.3.1.1", 8333));
addrman.Add(CAddress(addr6), CService("250.3.1.1", 7933));
addrman.Good(CAddress(addr6));
addrman.Add(CAddress(addr7), CService("250.1.1.3", 8333));
addrman.Add(CAddress(addr7), CService("250.1.1.3", 7933));
addrman.Good(CAddress(addr7));
// Test 11: 6 addrs + 1 addr from last test = 7.
BOOST_CHECK(addrman.size() == 7);
// Test 12: Select pulls from new and tried regardless of port number.
BOOST_CHECK(addrman.Select().ToString() == "250.4.6.6:8333");
BOOST_CHECK(addrman.Select().ToString() == "250.4.6.6:7933");
BOOST_CHECK(addrman.Select().ToString() == "250.3.2.2:9999");
BOOST_CHECK(addrman.Select().ToString() == "250.3.3.3:9999");
BOOST_CHECK(addrman.Select().ToString() == "250.4.4.4:8333");
BOOST_CHECK(addrman.Select().ToString() == "250.4.4.4:7933");
}
BOOST_AUTO_TEST_CASE(addrman_new_collisions)
@ -255,9 +255,9 @@ BOOST_AUTO_TEST_CASE(addrman_find)
BOOST_CHECK(addrman.size() == 0);
CAddress addr1 = CAddress(CService("250.1.2.1", 8333));
CAddress addr1 = CAddress(CService("250.1.2.1", 7933));
CAddress addr2 = CAddress(CService("250.1.2.1", 9999));
CAddress addr3 = CAddress(CService("251.255.2.1", 8333));
CAddress addr3 = CAddress(CService("251.255.2.1", 7933));
CNetAddr source1 = CNetAddr("250.1.2.1");
CNetAddr source2 = CNetAddr("250.1.2.2");
@ -270,7 +270,7 @@ BOOST_AUTO_TEST_CASE(addrman_find)
CAddrInfo* info1 = addrman.Find(addr1);
BOOST_CHECK(info1);
if (info1)
BOOST_CHECK(info1->ToString() == "250.1.2.1:8333");
BOOST_CHECK(info1->ToString() == "250.1.2.1:7933");
// Test 18; Find does not discriminate by port number.
CAddrInfo* info2 = addrman.Find(addr2);
@ -282,7 +282,7 @@ BOOST_AUTO_TEST_CASE(addrman_find)
CAddrInfo* info3 = addrman.Find(addr3);
BOOST_CHECK(info3);
if (info3)
BOOST_CHECK(info3->ToString() == "251.255.2.1:8333");
BOOST_CHECK(info3->ToString() == "251.255.2.1:7933");
}
BOOST_AUTO_TEST_CASE(addrman_create)
@ -294,17 +294,17 @@ BOOST_AUTO_TEST_CASE(addrman_create)
BOOST_CHECK(addrman.size() == 0);
CAddress addr1 = CAddress(CService("250.1.2.1", 8333));
CAddress addr1 = CAddress(CService("250.1.2.1", 7933));
CNetAddr source1 = CNetAddr("250.1.2.1");
int nId;
CAddrInfo* pinfo = addrman.Create(addr1, source1, &nId);
// Test 20: The result should be the same as the input addr.
BOOST_CHECK(pinfo->ToString() == "250.1.2.1:8333");
BOOST_CHECK(pinfo->ToString() == "250.1.2.1:7933");
CAddrInfo* info2 = addrman.Find(addr1);
BOOST_CHECK(info2->ToString() == "250.1.2.1:8333");
BOOST_CHECK(info2->ToString() == "250.1.2.1:7933");
}
@ -317,7 +317,7 @@ BOOST_AUTO_TEST_CASE(addrman_delete)
BOOST_CHECK(addrman.size() == 0);
CAddress addr1 = CAddress(CService("250.1.2.1", 8333));
CAddress addr1 = CAddress(CService("250.1.2.1", 7933));
CNetAddr source1 = CNetAddr("250.1.2.1");
int nId;
@ -344,15 +344,15 @@ BOOST_AUTO_TEST_CASE(addrman_getaddr)
vector<CAddress> vAddr1 = addrman.GetAddr();
BOOST_CHECK(vAddr1.size() == 0);
CAddress addr1 = CAddress(CService("250.250.2.1", 8333));
CAddress addr1 = CAddress(CService("250.250.2.1", 7933));
addr1.nTime = GetAdjustedTime(); // Set time so isTerrible = false
CAddress addr2 = CAddress(CService("250.251.2.2", 9999));
addr2.nTime = GetAdjustedTime();
CAddress addr3 = CAddress(CService("251.252.2.3", 8333));
CAddress addr3 = CAddress(CService("251.252.2.3", 7933));
addr3.nTime = GetAdjustedTime();
CAddress addr4 = CAddress(CService("252.253.3.4", 8333));
CAddress addr4 = CAddress(CService("252.253.3.4", 7933));
addr4.nTime = GetAdjustedTime();
CAddress addr5 = CAddress(CService("252.254.4.5", 8333));
CAddress addr5 = CAddress(CService("252.254.4.5", 7933));
addr5.nTime = GetAdjustedTime();
CNetAddr source1 = CNetAddr("250.1.2.1");
CNetAddr source2 = CNetAddr("250.2.3.3");
@ -365,7 +365,7 @@ BOOST_AUTO_TEST_CASE(addrman_getaddr)
addrman.Add(addr5, source1);
// GetAddr returns 23% of addresses, 23% of 5 is 1 rounded down.
BOOST_CHECK(addrman.GetAddr().size() == 1);
BOOST_CHECK(addrman.GetAddr().size() == 1);
// Test 24: Ensure GetAddr works with new and tried addresses.
addrman.Good(CAddress(addr1));
@ -379,7 +379,7 @@ BOOST_AUTO_TEST_CASE(addrman_getaddr)
int octet3 = (i / (256 * 2)) % 256;
string strAddr = boost::to_string(octet1) + "." + boost::to_string(octet2) + "." + boost::to_string(octet3) + ".23";
CAddress addr = CAddress(CService(strAddr));
// Ensure that for all addrs in addrman, isTerrible == false.
addr.nTime = GetAdjustedTime();
addrman.Add(addr, CNetAddr(strAddr));
@ -403,7 +403,7 @@ BOOST_AUTO_TEST_CASE(caddrinfo_get_tried_bucket)
// Set addrman addr placement to be deterministic.
addrman.MakeDeterministic();
CAddress addr1 = CAddress(CService("250.1.1.1", 8333));
CAddress addr1 = CAddress(CService("250.1.1.1", 7933));
CAddress addr2 = CAddress(CService("250.1.1.1", 9999));
CNetAddr source1 = CNetAddr("250.1.1.1");
@ -460,7 +460,7 @@ BOOST_AUTO_TEST_CASE(caddrinfo_get_new_bucket)
// Set addrman addr placement to be deterministic.
addrman.MakeDeterministic();
CAddress addr1 = CAddress(CService("250.1.2.1", 8333));
CAddress addr1 = CAddress(CService("250.1.2.1", 7933));
CAddress addr2 = CAddress(CService("250.1.2.1", 9999));
CNetAddr source1 = CNetAddr("250.1.2.1");
@ -518,4 +518,4 @@ BOOST_AUTO_TEST_CASE(caddrinfo_get_new_bucket)
// than 64 buckets.
BOOST_CHECK(buckets.size() > 64);
}
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_SUITE_END()

View File

@ -62,15 +62,15 @@ BOOST_AUTO_TEST_CASE(netbase_splithost)
BOOST_CHECK(TestSplitHost("www.bitcoin.org:80", "www.bitcoin.org", 80));
BOOST_CHECK(TestSplitHost("[www.bitcoin.org]:80", "www.bitcoin.org", 80));
BOOST_CHECK(TestSplitHost("127.0.0.1", "127.0.0.1", -1));
BOOST_CHECK(TestSplitHost("127.0.0.1:8333", "127.0.0.1", 8333));
BOOST_CHECK(TestSplitHost("127.0.0.1:7933", "127.0.0.1", 7933));
BOOST_CHECK(TestSplitHost("[127.0.0.1]", "127.0.0.1", -1));
BOOST_CHECK(TestSplitHost("[127.0.0.1]:8333", "127.0.0.1", 8333));
BOOST_CHECK(TestSplitHost("[127.0.0.1]:7933", "127.0.0.1", 7933));
BOOST_CHECK(TestSplitHost("::ffff:127.0.0.1", "::ffff:127.0.0.1", -1));
BOOST_CHECK(TestSplitHost("[::ffff:127.0.0.1]:8333", "::ffff:127.0.0.1", 8333));
BOOST_CHECK(TestSplitHost("[::]:8333", "::", 8333));
BOOST_CHECK(TestSplitHost("::8333", "::8333", -1));
BOOST_CHECK(TestSplitHost(":8333", "", 8333));
BOOST_CHECK(TestSplitHost("[]:8333", "", 8333));
BOOST_CHECK(TestSplitHost("[::ffff:127.0.0.1]:7933", "::ffff:127.0.0.1", 7933));
BOOST_CHECK(TestSplitHost("[::]:7933", "::", 7933));
BOOST_CHECK(TestSplitHost("::7933", "::7933", -1));
BOOST_CHECK(TestSplitHost(":7933", "", 7933));
BOOST_CHECK(TestSplitHost("[]:7933", "", 7933));
BOOST_CHECK(TestSplitHost("", "", -1));
}
@ -85,10 +85,10 @@ bool static TestParse(string src, string canon)
BOOST_AUTO_TEST_CASE(netbase_lookupnumeric)
{
BOOST_CHECK(TestParse("127.0.0.1", "127.0.0.1:65535"));
BOOST_CHECK(TestParse("127.0.0.1:8333", "127.0.0.1:8333"));
BOOST_CHECK(TestParse("127.0.0.1:7933", "127.0.0.1:7933"));
BOOST_CHECK(TestParse("::ffff:127.0.0.1", "127.0.0.1:65535"));
BOOST_CHECK(TestParse("::", "[::]:65535"));
BOOST_CHECK(TestParse("[::]:8333", "[::]:8333"));
BOOST_CHECK(TestParse("[::]:7933", "[::]:7933"));
BOOST_CHECK(TestParse("[127.0.0.1]", "127.0.0.1:65535"));
BOOST_CHECK(TestParse(":::", ""));
}

View File

@ -9,7 +9,7 @@
* network protocol versioning
*/
static const int PROTOCOL_VERSION = 170002;
static const int PROTOCOL_VERSION = 180003;
//! initial proto version, to be increased after version/verack negotiation
static const int INIT_PROTO_VERSION = 209;
@ -18,7 +18,7 @@ static const int INIT_PROTO_VERSION = 209;
static const int GETHEADERS_VERSION = 31800;
//! disconnect from peers older than this proto version
static const int MIN_PEER_PROTO_VERSION = 170002;
static const int MIN_PEER_PROTO_VERSION = 180003;
//! nTime field added to CAddress, starting with this version;
//! if possible, avoid requesting addresses nodes older than this