Bladeren bron

main - > Starwels MAI

tags/v0.15.1
SHI 2 jaren geleden
bovenliggende
commit
5d86a68c53

+ 3
- 3
contrib/debian/examples/starwels.conf Bestand weergeven

@@ -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:8353
#addnode=10.0.0.2:8343

# 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:8353
#connect=10.0.0.1:8343

# Listening mode, enabled by default except when 'connect' is being used
#listen=1
@@ -110,7 +110,7 @@
#rpcallowip=2001:db8:85a3:0:0:8a2e:370:7334/96

# Listen for RPC connections on this TCP port:
#rpcport=8352
#rpcport=8342

# You can use Starwels or starwelsd to send commands to Starwels/starwelsd
# running on another host using this option:

+ 1
- 1
contrib/linearize/README.md Bestand weergeven

@@ -12,7 +12,7 @@ Required configuration file settings for linearize-hashes:

Optional config file setting for linearize-hashes:
* RPC: `host` (Default: `127.0.0.1`)
* RPC: `port` (Default: `8352`)
* RPC: `port` (Default: `8342`)
* Blockchain: `min_height`, `max_height`
* `rev_hash_bytes`: If true, the written block hash list will be
byte-reversed. (In other words, the hash returned by getblockhash will have its

+ 2
- 2
contrib/linearize/example-linearize.cfg Bestand weergeven

@@ -3,8 +3,8 @@ rpcuser=someuser
rpcpassword=somepassword
#datadir=~/.starwels
host=127.0.0.1
port=8352
#port=8342
port=8342
#port=8332

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

+ 1
- 1
contrib/linearize/linearize-hashes.py Bestand weergeven

@@ -125,7 +125,7 @@ if __name__ == '__main__':
if 'host' not in settings:
settings['host'] = '127.0.0.1'
if 'port' not in settings:
settings['port'] = 8352
settings['port'] = 8342
if 'min_height' not in settings:
settings['min_height'] = 0
if 'max_height' not in settings:

+ 1
- 1
contrib/qos/README.md Bestand weergeven

@@ -1,5 +1,5 @@
### QoS (Quality of service) ###

This is a Linux bash script that will set up tc to limit the outgoing bandwidth for connections to the Starwels network. It limits outbound TCP traffic with a source or destination port of 8353, but not if the destination IP is within a LAN.
This is a Linux bash script that will set up tc to limit the outgoing bandwidth for connections to the Starwels network. It limits outbound TCP traffic with a source or destination port of 8343, but not if the destination IP is within a LAN.

This means one can have an always-on starwelsd instance running, and another local starwelsd/starwels-qt instance which connects to this node and receives blocks from it.

+ 5
- 5
contrib/qos/tc.sh Bestand weergeven

@@ -44,16 +44,16 @@ fi
# ret=$?
#done

#limit outgoing traffic to and from port 8353. but not when dealing with a host on the local network
#limit outgoing traffic to and from port 8343. but not when dealing with a host on the local network
# (defined by $LOCALNET_V4 and $LOCALNET_V6)
# --set-mark marks packages matching these criteria with the number "2" (v4)
# --set-mark marks packages matching these criteria with the number "4" (v6)
# these packets 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 8353 ! -d ${LOCALNET_V4} -j MARK --set-mark 0x2
iptables -t mangle -A OUTPUT -p tcp -m tcp --sport 8353 ! -d ${LOCALNET_V4} -j MARK --set-mark 0x2
iptables -t mangle -A OUTPUT -p tcp -m tcp --dport 8343 ! -d ${LOCALNET_V4} -j MARK --set-mark 0x2
iptables -t mangle -A OUTPUT -p tcp -m tcp --sport 8343 ! -d ${LOCALNET_V4} -j MARK --set-mark 0x2

if [ ! -z "${LOCALNET_V6}" ] ; then
ip6tables -t mangle -A OUTPUT -p tcp -m tcp --dport 8353 ! -d ${LOCALNET_V6} -j MARK --set-mark 0x4
ip6tables -t mangle -A OUTPUT -p tcp -m tcp --sport 8353 ! -d ${LOCALNET_V6} -j MARK --set-mark 0x4
ip6tables -t mangle -A OUTPUT -p tcp -m tcp --dport 8343 ! -d ${LOCALNET_V6} -j MARK --set-mark 0x4
ip6tables -t mangle -A OUTPUT -p tcp -m tcp --sport 8343 ! -d ${LOCALNET_V6} -j MARK --set-mark 0x4
fi

+ 4
- 4
contrib/rpm/starwels.spec Bestand weergeven

@@ -332,10 +332,10 @@ if [ `%{_sbindir}/sestatus |grep -c "disabled"` -eq 0 ]; then
for selinuxvariant in %{selinux_variants}; do
%{_sbindir}/semodule -s ${selinuxvariant} -i %{_datadir}/selinux/${selinuxvariant}/starwels.pp &> /dev/null || :
done
%{_sbindir}/semanage port -a -t starwels_port_t -p tcp 8352
%{_sbindir}/semanage port -a -t starwels_port_t -p tcp 8353
%{_sbindir}/semanage port -a -t starwels_port_t -p tcp 8342
%{_sbindir}/semanage port -a -t starwels_port_t -p tcp 8343
%{_sbindir}/semanage port -a -t starwels_port_t -p tcp 8332
%{_sbindir}/semanage port -a -t starwels_port_t -p tcp 8333
%{_sbindir}/fixfiles -R starwels-server restore &> /dev/null || :
%{_sbindir}/restorecon -R %{_localstatedir}/lib/starwels || :
fi
@@ -351,10 +351,10 @@ fi
# SELinux
if [ $1 -eq 0 ]; then
if [ `%{_sbindir}/sestatus |grep -c "disabled"` -eq 0 ]; then
%{_sbindir}/semanage port -d -p tcp 8352
%{_sbindir}/semanage port -d -p tcp 8353
%{_sbindir}/semanage port -d -p tcp 8342
%{_sbindir}/semanage port -d -p tcp 8343
%{_sbindir}/semanage port -d -p tcp 8332
%{_sbindir}/semanage port -d -p tcp 8333
for selinuxvariant in %{selinux_variants}; do
%{_sbindir}/semodule -s ${selinuxvariant} -r starwels &> /dev/null || :
done

+ 2
- 2
contrib/seeds/generate-seeds.py Bestand weergeven

@@ -127,10 +127,10 @@ 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', 8353)
process_nodes(g, f, 'pnSeed6_main', 8343)
g.write('\n')
with open(os.path.join(indir,'nodes_test.txt'),'r') as f:
process_nodes(g, f, 'pnSeed6_test', 8343)
process_nodes(g, f, 'pnSeed6_test', 8333)
g.write('#endif // STARWELS_CHAINPARAMSSEEDS_H\n')
if __name__ == '__main__':

+ 8
- 8
contrib/seeds/nodes_main.txt Bestand weergeven

@@ -1,8 +1,8 @@
83.240.44.87:8353
91.240.86.126:8353
169.159.129.254:8353
129.213.44.160:8353
94.102.26.117:8353
94.130.90.229:8353
109.68.161.188:8353
165.227.118.61:8353
83.240.44.87:8343
91.240.86.126:8343
169.159.129.254:8343
129.213.44.160:8343
94.102.26.117:8343
94.130.90.229:8343
109.68.161.188:8343
165.227.118.61:8343

+ 8
- 8
contrib/seeds/nodes_test.txt Bestand weergeven

@@ -1,12 +1,12 @@
# List of fixed seed nodes for ai

83.240.44.87:8343
91.240.86.126:8343
169.159.129.254:8343
129.213.44.160:8343
94.102.26.117:8343
94.130.90.229:8343
109.68.161.188:8343
165.227.118.61:8343
83.240.44.87:8333
91.240.86.126:8333
169.159.129.254:8333
129.213.44.160:8333
94.102.26.117:8333
94.130.90.229:8333
109.68.161.188:8333
165.227.118.61:8333

# Onion nodes

+ 5
- 5
contrib/zmq/zmq_sub.py Bestand weergeven

@@ -8,10 +8,10 @@

Starwels should be started with the command line arguments:
starwelsd -ai -daemon \
-zmqpubhashblock=tcp://127.0.0.1:28352 \
-zmqpubrawtx=tcp://127.0.0.1:28352 \
-zmqpubhashtx=tcp://127.0.0.1:28352 \
-zmqpubhashblock=tcp://127.0.0.1:28352
-zmqpubhashblock=tcp://127.0.0.1:28342 \
-zmqpubrawtx=tcp://127.0.0.1:28342 \
-zmqpubhashtx=tcp://127.0.0.1:28342 \
-zmqpubhashblock=tcp://127.0.0.1:28342

We use the asyncio library here. `self.handle()` installs itself as a
future at the end of the function. Since it never returns with the event
@@ -34,7 +34,7 @@ if not (sys.version_info.major >= 3 and sys.version_info.minor >= 5):
print("This example only works with Python 3.5 and greater")
exit(1)

port = 28352
port = 28342

class ZMQHandler():
def __init__(self):

+ 5
- 5
contrib/zmq/zmq_sub3.4.py Bestand weergeven

@@ -8,10 +8,10 @@

Starwels should be started with the command line arguments:
starwelsd -ai -daemon \
-zmqpubhashblock=tcp://127.0.0.1:28352 \
-zmqpubrawtx=tcp://127.0.0.1:28352 \
-zmqpubhashtx=tcp://127.0.0.1:28352 \
-zmqpubhashblock=tcp://127.0.0.1:28352
-zmqpubhashblock=tcp://127.0.0.1:28342 \
-zmqpubrawtx=tcp://127.0.0.1:28342 \
-zmqpubhashtx=tcp://127.0.0.1:28342 \
-zmqpubhashblock=tcp://127.0.0.1:28342

We use the asyncio library here. `self.handle()` installs itself as a
future at the end of the function. Since it never returns with the event
@@ -38,7 +38,7 @@ if not (sys.version_info.major >= 3 and sys.version_info.minor >= 4):
print("This example only works with Python 3.4 and greater")
exit(1)

port = 28352
port = 28342

class ZMQHandler():
def __init__(self):

+ 3
- 3
doc/REST-interface.md Bestand weergeven

@@ -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 8352 for mainnet and port 8342 for ai.
The interface runs on the same port as the JSON-RPC interface, by default port 8342 for mainnet and port 8332 for ai.

Supported API
-------------
@@ -57,7 +57,7 @@ https://github.com/starwels/bips/blob/master/bip-0064.mediawiki

Example:
```
$ curl localhost:8342/rest/getutxos/checkmempool/b2cdfd7b89def827ff8af7cd9bff7627ff72e5e8b0f71210f92ea7a4000c5d75-0.json 2>/dev/null | json_pp
$ curl localhost:8332/rest/getutxos/checkmempool/b2cdfd7b89def827ff8af7cd9bff7627ff72e5e8b0f71210f92ea7a4000c5d75-0.json 2>/dev/null | json_pp
{
"chainHeight" : 325347,
"chaintipHash" : "00000000fb01a7f3745a717f8caebee056c484e6e0bfe4a9591c235bb70506fb",
@@ -99,4 +99,4 @@ Only supports JSON as output format.

Risks
-------------
Running a web browser on the same node with a REST enabled starwelsd can be a risk. Accessing prepared XSS websites could read out tx/block data of your node by placing links like `<script src="http://127.0.0.1:8352/rest/tx/1234567890.json">` which might break the nodes privacy.
Running a web browser on the same node with a REST enabled starwelsd can be a risk. Accessing prepared XSS websites could read out tx/block data of your node by placing links like `<script src="http://127.0.0.1:8342/rest/tx/1234567890.json">` which might break the nodes privacy.

+ 2
- 2
doc/developer-notes.md Bestand weergeven

@@ -195,7 +195,7 @@ Threads

- ThreadMapPort : Universal plug-and-play startup/shutdown

- ThreadSocketHandler : Sends/Receives data from peers on port 8353.
- ThreadSocketHandler : Sends/Receives data from peers on port 8343.

- ThreadOpenAddedConnections : Opens network connections to added nodes.

@@ -207,7 +207,7 @@ Threads

- ThreadFlushWalletDB : Close the wallet.dat file if it hasn't been used in 500ms.

- ThreadRPCServer : Remote procedure call handler, listens on port 8352 for connections and services them.
- ThreadRPCServer : Remote procedure call handler, listens on port 8342 for connections and services them.

- StarwelsMiner : Generates starwelss (if wallet is enabled).


+ 2
- 2
doc/gitian-building.md Bestand weergeven

@@ -99,11 +99,11 @@ After creating the VM, we need to configure it.

- Click `Ok` twice to save.

Get the [Debian 8.x net installer](http://cdimage.debian.org/mirror/cdimage/archive/8.5.0/amd64/iso-cd/debian-8.5.0-amd64-netinst.iso) (a more recent minor version should also work, see also [Debian Network installation](https://www.debian.org/CD/netinst/)).
Get the [Debian 8.x net installer](https://cdimage.debian.org/cdimage/archive/8.10.0/amd64/iso-cd/debian-8.10.0-amd64-netinst.iso) (a more recent minor version should also work, see also [Debian Network installation](https://www.debian.org/CD/netinst/)).
This DVD image can be [validated](https://www.debian.org/CD/verify) using a SHA256 hashing tool, for example on
Unixy OSes by entering the following in a terminal:

echo "ad4e8c27c561ad8248d5ebc1d36eb172f884057bfeb2c22ead823f59fa8c3dff debian-8.5.0-amd64-netinst.iso" | sha256sum -c
echo "896cc42998edf65f1db4eba83581941fb2a584f2214976432b841af96b17ccda debian-8.10.0-amd64-netinst.iso" | sha256sum -c
# (must return OK)

Then start the VM. On the first launch you will be asked for a CD or DVD image. Choose the downloaded ISO.

+ 1
- 1
doc/man/starwels-cli.1 Bestand weergeven

@@ -48,7 +48,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: 8352 or ai: 8342)
Connect to JSON\-RPC on <port> (default: 8342 or ai: 8332)
.HP
\fB\-rpcwait\fR
.IP

+ 4
- 4
doc/man/starwels-qt.1 Bestand weergeven

@@ -32,7 +32,7 @@ block hash)
If this block is in the chain assume that it and its ancestors are valid
and potentially skip their script verification (0 to verify all,
default:
0000000002a47ec40e87c18501786717cbebb96efa3bb05505e1c24cce51689e,
00000000764077b29d13e1cb2484f028a24ef2a44486b6e5d3cb17eb4716c465,
ai:
00000000d7674ad1e7703e7ba02b7611c12fe74de27b6a414cf6e906cc3599e9)
.HP
@@ -206,7 +206,7 @@ Support filtering of blocks and transaction with bloom filters (default:
.HP
\fB\-port=\fR<port>
.IP
Listen for connections on <port> (default: 8353 or ai: 8343)
Listen for connections on <port> (default: 8343 or ai: 8333)
.HP
\fB\-proxy=\fR<ip:port>
.IP
@@ -501,8 +501,8 @@ option can be specified multiple times
.HP
\fB\-rpcport=\fR<port>
.IP
Listen for JSON\-RPC connections on <port> (default: 8352 or ai:
8342)
Listen for JSON\-RPC connections on <port> (default: 8342 or ai:
8332)
.HP
\fB\-rpcallowip=\fR<ip>
.IP

+ 4
- 4
doc/man/starwelsd.1 Bestand weergeven

@@ -33,7 +33,7 @@ block hash)
If this block is in the chain assume that it and its ancestors are valid
and potentially skip their script verification (0 to verify all,
default:
0000000002a47ec40e87c18501786717cbebb96efa3bb05505e1c24cce51689e,
00000000764077b29d13e1cb2484f028a24ef2a44486b6e5d3cb17eb4716c465,
ai:
00000000d7674ad1e7703e7ba02b7611c12fe74de27b6a414cf6e906cc3599e9)
.HP
@@ -211,7 +211,7 @@ Support filtering of blocks and transaction with bloom filters (default:
.HP
\fB\-port=\fR<port>
.IP
Listen for connections on <port> (default: 8353 or ai: 8343)
Listen for connections on <port> (default: 8343 or ai: 8333)
.HP
\fB\-proxy=\fR<ip:port>
.IP
@@ -506,8 +506,8 @@ option can be specified multiple times
.HP
\fB\-rpcport=\fR<port>
.IP
Listen for JSON\-RPC connections on <port> (default: 8352 or ai:
8342)
Listen for JSON\-RPC connections on <port> (default: 8342 or ai:
8332)
.HP
\fB\-rpcallowip=\fR<ip>
.IP

+ 4
- 4
doc/release-notes/release-notes-0.10.0.md Bestand weergeven

@@ -142,10 +142,10 @@ unauthenticated access to public node data.
It is served on the same port as RPC, but does not need a password, and uses
plain HTTP instead of JSON-RPC.

Assuming a local RPC server running on port 8352, it is possible to request:
- Blocks: http://localhost:8352/rest/block/*HASH*.*EXT*
- Blocks without transactions: http://localhost:8352/rest/block/notxdetails/*HASH*.*EXT*
- Transactions (requires `-txindex`): http://localhost:8352/rest/tx/*HASH*.*EXT*
Assuming a local RPC server running on port 8342, it is possible to request:
- Blocks: http://localhost:8342/rest/block/*HASH*.*EXT*
- Blocks without transactions: http://localhost:8342/rest/block/notxdetails/*HASH*.*EXT*
- Transactions (requires `-txindex`): http://localhost:8342/rest/tx/*HASH*.*EXT*

In every case, *EXT* can be `bin` (for raw binary data), `hex` (for hex-encoded
binary) or `json`.

+ 4
- 4
doc/release-notes/release-notes-0.12.0.md Bestand weergeven

@@ -410,9 +410,9 @@ arbitrary TCP connections inside SSL. On e.g. Ubuntu it can be installed with:

sudo apt-get install stunnel4

Then, to tunnel a SSL connection on 28352 to a RPC server bound on localhost on port 18352 do:
Then, to tunnel a SSL connection on 28342 to a RPC server bound on localhost on port 18342 do:

stunnel -d 28352 -r 127.0.0.1:18352 -p stunnel.pem -P ''
stunnel -d 28342 -r 127.0.0.1:18342 -p stunnel.pem -P ''

It can also be set up system-wide in inetd style.

@@ -430,8 +430,8 @@ caching. A sample config for apache2 could look like:
SSLCertificateKeyFile /etc/apache2/ssl/server.key

<Location /starwelsrpc>
ProxyPass http://127.0.0.1:8352/
ProxyPassReverse http://127.0.0.1:8352/
ProxyPass http://127.0.0.1:8342/
ProxyPassReverse http://127.0.0.1:8342/
# optional enable digest auth
# AuthType Digest
# ...

+ 2
- 2
doc/release-notes/release-notes-0.15.0.md Bestand weergeven

@@ -152,7 +152,7 @@ Starwels 0.15.0 contains the following changes to the RPC interface and `starwel

* When running Starwels with a single wallet, there are **no** changes to the RPC interface or `starwels-cli`. All RPC calls and `starwels-cli` commands continue to work as before.
* When running Starwels with multi-wallet, all *node-level* RPC methods continue to work as before. HTTP RPC requests should be send to the normal `<RPC IP address>:<RPC port>/` endpoint, and `starwels-cli` commands should be run as before. A *node-level* RPC method is any method which does not require access to the wallet.
* When running Starwels with multi-wallet, *wallet-level* RPC methods must specify the wallet for which they're intended in every request. HTTP RPC requests should be send to the `<RPC IP address>:<RPC port>/wallet/<wallet name>/` endpoint, for example `127.0.0.1:8352/wallet/wallet1.dat/`. `starwels-cli` commands should be run with a `-rpcwallet` option, for example `starwels-cli -rpcwallet=wallet1.dat getbalance`.
* When running Starwels with multi-wallet, *wallet-level* RPC methods must specify the wallet for which they're intended in every request. HTTP RPC requests should be send to the `<RPC IP address>:<RPC port>/wallet/<wallet name>/` endpoint, for example `127.0.0.1:8342/wallet/wallet1.dat/`. `starwels-cli` commands should be run with a `-rpcwallet` option, for example `starwels-cli -rpcwallet=wallet1.dat getbalance`.
* A new *node-level* `listwallets` RPC method is added to display which wallets are currently loaded. The names returned by this method are the same as those used in the HTTP endpoint and for the `rpcwallet` argument.

Note that while multi-wallet is now fully supported, the RPC multi-wallet interface should be considered unstable for version 0.15.0, and there may backwards-incompatible changes in future versions.
@@ -377,7 +377,7 @@ Low-level RPC changes
- #10537 `b3eb0d6` Few Minor per-utxo assert-semantics re-adds and tweak (TheBlueMatt)
- #10626 `8c841a3` doc: Remove outdated minrelaytxfee comment (MarcoFalke)
- #10559 `234ffc6` Change semantics of HaveCoinInCache to match HaveCoin (morcos)
- #10581 `7878353` Simplify return values of GetCoin/HaveCoin(InCache) (sipa)
- #10581 `7878343` Simplify return values of GetCoin/HaveCoin(InCache) (sipa)
- #10684 `a381f6a` Remove no longer used mempool.exists(outpoint) (morcos)
- #10148 `d4e551a` Use non-atomic flushing with block replay (sipa)
- #10685 `30c2130` Clarify CCoinsViewMemPool documentation (TheBlueMatt)

+ 1
- 1
doc/release-notes/release-notes-0.7.1.md Bestand weergeven

@@ -77,7 +77,7 @@ Bug fixes

* Clicking on a starwels: URI on Windows should now launch Starwels-Qt properly.

* When running -testnet, use RPC port 18352 by default.
* When running -testnet, use RPC port 18342 by default.

* Better detection and handling of corrupt wallet.dat and blkindex.dat files.
Previous versions would crash with a DB_RUNRECOVERY exception, this

+ 3
- 3
doc/tor.md Bestand weergeven

@@ -42,11 +42,11 @@ reachable from the Tor network. Add these lines to your /etc/tor/torrc (or equiv
config file):

HiddenServiceDir /var/lib/tor/starwels-service/
HiddenServicePort 8353 127.0.0.1:8353
HiddenServicePort 8343 127.0.0.1:8343
HiddenServicePort 8333 127.0.0.1:8333

The directory can be different of course, but (both) port numbers should be equal to
your starwelsd's P2P listen port (8353 by default).
your starwelsd's P2P listen port (8343 by default).

-externalip=X You can tell starwels about its publicly reachable address using
this option, and this can be a .onion address. Given the above
@@ -81,7 +81,7 @@ as well, use `discover` instead:

./starwelsd ... -discover

and open port 8353 on your firewall (or use -upnp).
and open port 8343 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:

+ 1
- 1
doc/zmq.md Bestand weergeven

@@ -66,7 +66,7 @@ address. The same address can be used in more than one notification.

For instance:

$ starwelsd -zmqpubhashtx=tcp://127.0.0.1:28352 \
$ starwelsd -zmqpubhashtx=tcp://127.0.0.1:28342 \
-zmqpubrawtx=ipc:///tmp/starwelsd.tx.raw

Each PUB notification has a topic and body, where the header

+ 24
- 22
src/chainparams.cpp Bestand weergeven

@@ -65,35 +65,35 @@ public:
strNetworkID = "main";
consensus.nSubsidyHalvingInterval = 210000;
consensus.BIP34Height = 227931;
consensus.BIP34Hash = uint256S("0x00");
consensus.BIP34Hash = uint256S("0x00000000ac6a39893714f4240301f40abff1afcdcaf51d2f40ce6675a73f0961");
consensus.BIP65Height = 388381;
consensus.BIP66Height = 363725;
consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
consensus.nPowTargetSpacing = 10 * 60;
consensus.nPowTargetTimespan = 2 * 24 * 84;
consensus.nPowTargetSpacing = 2; // 2 second
consensus.fPowAllowMinDifficultyBlocks = false;
consensus.fPowNoRetargeting = false;
consensus.nRuleChangeActivationThreshold = 1916; // 95% of 2016
consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1493596800; // May 1 Monday, 2017
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1525132800; // May 1 Tuesday, 2018
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1498867200; // July 1 Saturday, 2017
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1530403200; // July 1 Sunday, 2018

// Deployment of BIP68, BIP112, and BIP113.
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1496275200; // June 1 Thursday, 2017
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1527811200; // June 1 Friday, 2018
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1501545600; // August 1 Tuesday, 2017
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1533081600; // August 1 Wednesday, 2018

// Deployment of SegWit (BIP141, BIP143, and BIP147)
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1498867200; // July 1 Saturday, 2017
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1530403200; // July 1 Sunday, 2018
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1504224000; // September 1 Friday, 2017
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1535760000; // September 1 Saturday, 2018

// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000000010c410c410c4");
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000006550f67b8b239");

// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x0000000002a47ec40e87c18501786717cbebb96efa3bb05505e1c24cce51689e"); // 4096
consensus.defaultAssumeValid = uint256S("0x00000000764077b29d13e1cb2484f028a24ef2a44486b6e5d3cb17eb4716c465"); // 262144

/**
* The message start string is designed to be unlikely to occur in normal data.
@@ -104,7 +104,7 @@ public:
pchMessageStart[1] = 0xbe;
pchMessageStart[2] = 0xb4;
pchMessageStart[3] = 0xd9;
nDefaultPort = 8353;
nDefaultPort = 8343;
nPruneAfterHeight = 100000;

genesis = CreateGenesisBlock(1484870400, 2121032621, 0x1d00ffff, 1, 50 * COIN);
@@ -130,16 +130,18 @@ public:
{
{1024, uint256S("0x00000000fb559851169e0d915093533d31af0d963e06a7d80a20496f9cfd2b9f")},
{2048, uint256S("0x00000000a753b360bb5d54908378d999132fbeb415279ef530b397ae249cbef4")},
{4096, uint256S("0x0000000002a47ec40e87c18501786717cbebb96efa3bb05505e1c24cce51689e")},
{8192, uint256S("0x00000000041f1f4c7d09c2ce6d656293b0217093a005f19799d3042b83267418")},
{16384, uint256S("0x00000000000d596ae3c31ca582245d29435d98720d55283a7f3d6bb92a1afc98")},
{4096, uint256S("0x00000000d7674ad1e7703e7ba02b7611c12fe74de27b6a414cf6e906cc3599e9")},
{8192, uint256S("0x000000007039ae6930925c9c6297835642ea5a4d6f32cef2f6b84867e049fff8")},
{32768, uint256S("0x00000000cc19cff47d676ad56594e695ac96a1d2781a83a5fd1a7702b98a9a65")},
{65536, uint256S("0x00000000c6814c6715cda6f76b08b967abc0ea70aa3f8db8e8c62206477cb749")},
{131072, uint256S("0x00000000dbff9cae44489b3c02bbd556b67db5e3d21318c35cca0b6c361e6944")},
}
};

chainTxData = ChainTxData{
// Data as of block 000000000000059d570e7eb57c53c49a9106580305510c091f6df8c07695a092 (height 32768).
1523273405, // * UNIX timestamp of last known number of transactions
33144, // * total number of transactions between genesis and that timestamp
// Data as of block 00000000764077b29d13e1cb2484f028a24ef2a44486b6e5d3cb17eb4716c465 (height 262144).
1530692464, // * UNIX timestamp of last known number of transactions
262230, // * total number of transactions between genesis and that timestamp
// (the tx=... number in the SetBestChain debug.log lines)
3.1 // * estimated number of transactions per second after that timestamp
};
@@ -155,7 +157,7 @@ public:
strNetworkID = "main";
consensus.nSubsidyHalvingInterval = 210000;
consensus.BIP34Height = 227931;
consensus.BIP34Hash = uint256S("0x00");
consensus.BIP34Hash = uint256S("0x00000000ac6a39893714f4240301f40abff1afcdcaf51d2f40ce6675a73f0961");
consensus.BIP65Height = 388381;
consensus.BIP66Height = 363725;
consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
@@ -189,7 +191,7 @@ public:
pchMessageStart[1] = 0xbe;
pchMessageStart[2] = 0xb4;
pchMessageStart[3] = 0xd9;
nDefaultPort = 8343;
nDefaultPort = 8333;
nPruneAfterHeight = 100000;

genesis = CreateGenesisBlock(1484870400, 2121032621, 0x1d00ffff, 1, 50 * COIN);
@@ -244,8 +246,8 @@ public:
consensus.BIP65Height = 1351; // BIP65 activated on regtest (Used in rpc activation tests)
consensus.BIP66Height = 1251; // BIP66 activated on regtest (Used in rpc activation tests)
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
consensus.nPowTargetSpacing = 10 * 60;
consensus.nPowTargetTimespan = 2 * 24 * 84;
consensus.nPowTargetSpacing = 2; // 2 second
consensus.fPowAllowMinDifficultyBlocks = true;
consensus.fPowNoRetargeting = true;
consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains

+ 3
- 3
src/chainparamsbase.cpp Bestand weergeven

@@ -32,7 +32,7 @@ class CBaseMainParams : public CBaseChainParams
public:
CBaseMainParams()
{
nRPCPort = 8352;
nRPCPort = 8342;
}
};

@@ -44,7 +44,7 @@ class CBaseTestNetParams : public CBaseChainParams
public:
CBaseTestNetParams()
{
nRPCPort = 8342;
nRPCPort = 8332;
strDataDir = "ai";
}
};
@@ -57,7 +57,7 @@ class CBaseRegTestParams : public CBaseChainParams
public:
CBaseRegTestParams()
{
nRPCPort = 8342;
nRPCPort = 8332;
strDataDir = "regtest";
}
};

+ 11
- 11
src/chainparamsseeds.h Bestand weergeven

@@ -8,17 +8,6 @@
* IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly.
*/
static SeedSpec6 pnSeed6_main[] = {
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0xF0,0x2C,0x57}, 8353},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xA9,0x9F,0x81,0xFE}, 8353},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x81,0xD5,0x2C,0xA0}, 8353},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5B,0xF0,0x56,0x7E}, 8353},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5E,0x66,0x1A,0x75}, 8353},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5E,0x82,0x5A,0xE5}, 8353},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6D,0x44,0xA1,0xBC}, 8353},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xA5,0xE3,0x76,0x3D}, 8353}
};

static SeedSpec6 pnSeed6_test[] = {
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0xF0,0x2C,0x57}, 8343},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xA9,0x9F,0x81,0xFE}, 8343},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x81,0xD5,0x2C,0xA0}, 8343},
@@ -28,4 +17,15 @@ static SeedSpec6 pnSeed6_test[] = {
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6D,0x44,0xA1,0xBC}, 8343},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xA5,0xE3,0x76,0x3D}, 8343}
};

static SeedSpec6 pnSeed6_test[] = {
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0xF0,0x2C,0x57}, 8333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xA9,0x9F,0x81,0xFE}, 8333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x81,0xD5,0x2C,0xA0}, 8333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5B,0xF0,0x56,0x7E}, 8333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5E,0x66,0x1A,0x75}, 8333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5E,0x82,0x5A,0xE5}, 8333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6D,0x44,0xA1,0xBC}, 8333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xA5,0xE3,0x76,0x3D}, 8333}
};
#endif // STARWELS_CHAINPARAMSSEEDS_H

+ 5
- 5
src/rpc/net.cpp Bestand weergeven

@@ -205,8 +205,8 @@ UniValue addnode(const JSONRPCRequest& request)
"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:8353\" \"onetry\"")
+ HelpExampleRpc("addnode", "\"192.168.0.6:8353\", \"onetry\"")
+ HelpExampleCli("addnode", "\"192.168.0.6:8343\" \"onetry\"")
+ HelpExampleRpc("addnode", "\"192.168.0.6:8343\", \"onetry\"")
);

if(!g_connman)
@@ -247,9 +247,9 @@ UniValue disconnectnode(const JSONRPCRequest& request)
"1. \"address\" (string, optional) The IP address/port of the node\n"
"2. \"nodeid\" (number, optional) The node ID (see getpeerinfo for node IDs)\n"
"\nExamples:\n"
+ HelpExampleCli("disconnectnode", "\"192.168.0.6:8353\"")
+ HelpExampleCli("disconnectnode", "\"192.168.0.6:8343\"")
+ HelpExampleCli("disconnectnode", "\"\" 1")
+ HelpExampleRpc("disconnectnode", "\"192.168.0.6:8353\"")
+ HelpExampleRpc("disconnectnode", "\"192.168.0.6:8343\"")
+ HelpExampleRpc("disconnectnode", "\"\", 1")
);

@@ -294,7 +294,7 @@ UniValue getaddednodeinfo(const JSONRPCRequest& request)
" \"connected\" : true|false, (boolean) If connected\n"
" \"addresses\" : [ (list of objects) Only when connected = true\n"
" {\n"
" \"address\" : \"192.168.0.201:8353\", (string) The starwels server IP and port we're connected to\n"
" \"address\" : \"192.168.0.201:8343\", (string) The starwels server IP and port we're connected to\n"
" \"connected\" : \"outbound\" (string) connection, inbound or outbound\n"
" }\n"
" ]\n"

+ 1
- 1
src/rpc/server.cpp Bestand weergeven

@@ -519,7 +519,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:8352/\n";
"\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:8342/\n";
}

void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface)

+ 35
- 35
src/test/addrman_tests.cpp Bestand weergeven

@@ -92,15 +92,15 @@ BOOST_AUTO_TEST_CASE(addrman_simple)
BOOST_CHECK_EQUAL(addr_null.ToString(), "[::]:0");

// Test: Does Addrman::Add work as expected.
CService addr1 = ResolveService("250.1.1.1", 8353);
CService addr1 = ResolveService("250.1.1.1", 8343);
BOOST_CHECK(addrman.Add(CAddress(addr1, NODE_NONE), source));
BOOST_CHECK_EQUAL(addrman.size(), 1);
CAddrInfo addr_ret1 = addrman.Select();
BOOST_CHECK_EQUAL(addr_ret1.ToString(), "250.1.1.1:8353");
BOOST_CHECK_EQUAL(addr_ret1.ToString(), "250.1.1.1:8343");

// Test: Does IP address deduplication work correctly.
// Expected dup IP should not be added.
CService addr1_dup = ResolveService("250.1.1.1", 8353);
CService addr1_dup = ResolveService("250.1.1.1", 8343);
BOOST_CHECK(!addrman.Add(CAddress(addr1_dup, NODE_NONE), source));
BOOST_CHECK_EQUAL(addrman.size(), 1);

@@ -111,7 +111,7 @@ BOOST_AUTO_TEST_CASE(addrman_simple)
// hash collisions may occur. But we can always be sure of at least one
// success.

CService addr2 = ResolveService("250.1.1.2", 8353);
CService addr2 = ResolveService("250.1.1.2", 8343);
BOOST_CHECK(addrman.Add(CAddress(addr2, NODE_NONE), source));
BOOST_CHECK(addrman.size() >= 1);

@@ -123,8 +123,8 @@ BOOST_AUTO_TEST_CASE(addrman_simple)

// Test: AddrMan::Add multiple addresses works as expected
std::vector<CAddress> vAddr;
vAddr.push_back(CAddress(ResolveService("250.1.1.3", 8353), NODE_NONE));
vAddr.push_back(CAddress(ResolveService("250.1.1.4", 8353), NODE_NONE));
vAddr.push_back(CAddress(ResolveService("250.1.1.3", 8343), NODE_NONE));
vAddr.push_back(CAddress(ResolveService("250.1.1.4", 8343), NODE_NONE));
BOOST_CHECK(addrman.Add(vAddr, source));
BOOST_CHECK(addrman.size() >= 1);
}
@@ -138,7 +138,7 @@ BOOST_AUTO_TEST_CASE(addrman_ports)
BOOST_CHECK_EQUAL(addrman.size(), 0);

// Test 7; Addr with same IP but diff port does not replace existing addr.
CService addr1 = ResolveService("250.1.1.1", 8353);
CService addr1 = ResolveService("250.1.1.1", 8343);
addrman.Add(CAddress(addr1, NODE_NONE), source);
BOOST_CHECK_EQUAL(addrman.size(), 1);

@@ -146,7 +146,7 @@ BOOST_AUTO_TEST_CASE(addrman_ports)
addrman.Add(CAddress(addr1_port, NODE_NONE), source);
BOOST_CHECK_EQUAL(addrman.size(), 1);
CAddrInfo addr_ret2 = addrman.Select();
BOOST_CHECK_EQUAL(addr_ret2.ToString(), "250.1.1.1:8353");
BOOST_CHECK_EQUAL(addr_ret2.ToString(), "250.1.1.1:8343");

// Test: 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.
@@ -154,7 +154,7 @@ BOOST_AUTO_TEST_CASE(addrman_ports)
BOOST_CHECK_EQUAL(addrman.size(), 1);
bool newOnly = true;
CAddrInfo addr_ret3 = addrman.Select(newOnly);
BOOST_CHECK_EQUAL(addr_ret3.ToString(), "250.1.1.1:8353");
BOOST_CHECK_EQUAL(addr_ret3.ToString(), "250.1.1.1:8343");
}


@@ -165,13 +165,13 @@ BOOST_AUTO_TEST_CASE(addrman_select)
CNetAddr source = ResolveIP("252.2.2.2");

// Test: Select from new with 1 addr in new.
CService addr1 = ResolveService("250.1.1.1", 8353);
CService addr1 = ResolveService("250.1.1.1", 8343);
addrman.Add(CAddress(addr1, NODE_NONE), source);
BOOST_CHECK_EQUAL(addrman.size(), 1);

bool newOnly = true;
CAddrInfo addr_ret1 = addrman.Select(newOnly);
BOOST_CHECK_EQUAL(addr_ret1.ToString(), "250.1.1.1:8353");
BOOST_CHECK_EQUAL(addr_ret1.ToString(), "250.1.1.1:8343");

// Test: move addr to tried, select from new expected nothing returned.
addrman.Good(CAddress(addr1, NODE_NONE));
@@ -180,30 +180,30 @@ BOOST_AUTO_TEST_CASE(addrman_select)
BOOST_CHECK_EQUAL(addr_ret2.ToString(), "[::]:0");

CAddrInfo addr_ret3 = addrman.Select();
BOOST_CHECK_EQUAL(addr_ret3.ToString(), "250.1.1.1:8353");
BOOST_CHECK_EQUAL(addr_ret3.ToString(), "250.1.1.1:8343");

BOOST_CHECK_EQUAL(addrman.size(), 1);


// Add three addresses to new table.
CService addr2 = ResolveService("250.3.1.1", 8353);
CService addr2 = ResolveService("250.3.1.1", 8343);
CService addr3 = ResolveService("250.3.2.2", 9999);
CService addr4 = ResolveService("250.3.3.3", 9999);

addrman.Add(CAddress(addr2, NODE_NONE), ResolveService("250.3.1.1", 8353));
addrman.Add(CAddress(addr3, NODE_NONE), ResolveService("250.3.1.1", 8353));
addrman.Add(CAddress(addr4, NODE_NONE), ResolveService("250.4.1.1", 8353));
addrman.Add(CAddress(addr2, NODE_NONE), ResolveService("250.3.1.1", 8343));
addrman.Add(CAddress(addr3, NODE_NONE), ResolveService("250.3.1.1", 8343));
addrman.Add(CAddress(addr4, NODE_NONE), ResolveService("250.4.1.1", 8343));

// Add three addresses to tried table.
CService addr5 = ResolveService("250.4.4.4", 8353);
CService addr5 = ResolveService("250.4.4.4", 8343);
CService addr6 = ResolveService("250.4.5.5", 7777);
CService addr7 = ResolveService("250.4.6.6", 8353);
CService addr7 = ResolveService("250.4.6.6", 8343);

addrman.Add(CAddress(addr5, NODE_NONE), ResolveService("250.3.1.1", 8353));
addrman.Add(CAddress(addr5, NODE_NONE), ResolveService("250.3.1.1", 8343));
addrman.Good(CAddress(addr5, NODE_NONE));
addrman.Add(CAddress(addr6, NODE_NONE), ResolveService("250.3.1.1", 8353));
addrman.Add(CAddress(addr6, NODE_NONE), ResolveService("250.3.1.1", 8343));
addrman.Good(CAddress(addr6, NODE_NONE));
addrman.Add(CAddress(addr7, NODE_NONE), ResolveService("250.1.1.3", 8353));
addrman.Add(CAddress(addr7, NODE_NONE), ResolveService("250.1.1.3", 8343));
addrman.Good(CAddress(addr7, NODE_NONE));

// Test: 6 addrs + 1 addr from last test = 7.
@@ -276,9 +276,9 @@ BOOST_AUTO_TEST_CASE(addrman_find)

BOOST_CHECK_EQUAL(addrman.size(), 0);

CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8353), NODE_NONE);
CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8343), NODE_NONE);
CAddress addr2 = CAddress(ResolveService("250.1.2.1", 9999), NODE_NONE);
CAddress addr3 = CAddress(ResolveService("251.255.2.1", 8353), NODE_NONE);
CAddress addr3 = CAddress(ResolveService("251.255.2.1", 8343), NODE_NONE);

CNetAddr source1 = ResolveIP("250.1.2.1");
CNetAddr source2 = ResolveIP("250.1.2.2");
@@ -290,7 +290,7 @@ BOOST_AUTO_TEST_CASE(addrman_find)
// Test: ensure Find returns an IP matching what we searched on.
CAddrInfo* info1 = addrman.Find(addr1);
BOOST_REQUIRE(info1);
BOOST_CHECK_EQUAL(info1->ToString(), "250.1.2.1:8353");
BOOST_CHECK_EQUAL(info1->ToString(), "250.1.2.1:8343");

// Test 18; Find does not discriminate by port number.
CAddrInfo* info2 = addrman.Find(addr2);
@@ -300,7 +300,7 @@ BOOST_AUTO_TEST_CASE(addrman_find)
// Test: Find returns another IP matching what we searched on.
CAddrInfo* info3 = addrman.Find(addr3);
BOOST_REQUIRE(info3);
BOOST_CHECK_EQUAL(info3->ToString(), "251.255.2.1:8353");
BOOST_CHECK_EQUAL(info3->ToString(), "251.255.2.1:8343");
}

BOOST_AUTO_TEST_CASE(addrman_create)
@@ -309,17 +309,17 @@ BOOST_AUTO_TEST_CASE(addrman_create)

BOOST_CHECK_EQUAL(addrman.size(), 0);

CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8353), NODE_NONE);
CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8343), NODE_NONE);
CNetAddr source1 = ResolveIP("250.1.2.1");

int nId;
CAddrInfo* pinfo = addrman.Create(addr1, source1, &nId);

// Test: The result should be the same as the input addr.
BOOST_CHECK_EQUAL(pinfo->ToString(), "250.1.2.1:8353");
BOOST_CHECK_EQUAL(pinfo->ToString(), "250.1.2.1:8343");

CAddrInfo* info2 = addrman.Find(addr1);
BOOST_CHECK_EQUAL(info2->ToString(), "250.1.2.1:8353");
BOOST_CHECK_EQUAL(info2->ToString(), "250.1.2.1:8343");
}


@@ -329,7 +329,7 @@ BOOST_AUTO_TEST_CASE(addrman_delete)

BOOST_CHECK_EQUAL(addrman.size(), 0);

CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8353), NODE_NONE);
CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8343), NODE_NONE);
CNetAddr source1 = ResolveIP("250.1.2.1");

int nId;
@@ -353,15 +353,15 @@ BOOST_AUTO_TEST_CASE(addrman_getaddr)
std::vector<CAddress> vAddr1 = addrman.GetAddr();
BOOST_CHECK_EQUAL(vAddr1.size(), 0);

CAddress addr1 = CAddress(ResolveService("250.250.2.1", 8353), NODE_NONE);
CAddress addr1 = CAddress(ResolveService("250.250.2.1", 8343), NODE_NONE);
addr1.nTime = GetAdjustedTime(); // Set time so isTerrible = false
CAddress addr2 = CAddress(ResolveService("250.251.2.2", 9999), NODE_NONE);
addr2.nTime = GetAdjustedTime();
CAddress addr3 = CAddress(ResolveService("251.252.2.3", 8353), NODE_NONE);
CAddress addr3 = CAddress(ResolveService("251.252.2.3", 8343), NODE_NONE);
addr3.nTime = GetAdjustedTime();
CAddress addr4 = CAddress(ResolveService("252.253.3.4", 8353), NODE_NONE);
CAddress addr4 = CAddress(ResolveService("252.253.3.4", 8343), NODE_NONE);
addr4.nTime = GetAdjustedTime();
CAddress addr5 = CAddress(ResolveService("252.254.4.5", 8353), NODE_NONE);
CAddress addr5 = CAddress(ResolveService("252.254.4.5", 8343), NODE_NONE);
addr5.nTime = GetAdjustedTime();
CNetAddr source1 = ResolveIP("250.1.2.1");
CNetAddr source2 = ResolveIP("250.2.3.3");
@@ -408,7 +408,7 @@ BOOST_AUTO_TEST_CASE(caddrinfo_get_tried_bucket)
{
CAddrManTest addrman;

CAddress addr1 = CAddress(ResolveService("250.1.1.1", 8353), NODE_NONE);
CAddress addr1 = CAddress(ResolveService("250.1.1.1", 8343), NODE_NONE);
CAddress addr2 = CAddress(ResolveService("250.1.1.1", 9999), NODE_NONE);

CNetAddr source1 = ResolveIP("250.1.1.1");
@@ -462,7 +462,7 @@ BOOST_AUTO_TEST_CASE(caddrinfo_get_new_bucket)
{
CAddrManTest addrman;

CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8353), NODE_NONE);
CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8343), NODE_NONE);
CAddress addr2 = CAddress(ResolveService("250.1.2.1", 9999), NODE_NONE);

CNetAddr source1 = ResolveIP("250.1.2.1");

+ 2
- 2
src/test/net_tests.cpp Bestand weergeven

@@ -91,13 +91,13 @@ BOOST_AUTO_TEST_CASE(caddrdb_read)
addrmanUncorrupted.MakeDeterministic();

CService addr1, addr2, addr3;
Lookup("250.7.1.1", addr1, 8353, false);
Lookup("250.7.1.1", addr1, 8343, false);
Lookup("250.7.2.2", addr2, 9999, false);
Lookup("250.7.3.3", addr3, 9999, false);

// Add three addresses to new table.
CService source;
Lookup("252.5.1.1", source, 8353, false);
Lookup("252.5.1.1", source, 8343, false);
addrmanUncorrupted.Add(CAddress(addr1, NODE_NONE), source);
addrmanUncorrupted.Add(CAddress(addr2, NODE_NONE), source);
addrmanUncorrupted.Add(CAddress(addr3, NODE_NONE), source);

+ 9
- 9
src/test/netbase_tests.cpp Bestand weergeven

@@ -83,15 +83,15 @@ bool static TestSplitHost(std::string test, std::string host, int port)
BOOST_AUTO_TEST_CASE(netbase_splithost)
{
BOOST_CHECK(TestSplitHost("127.0.0.1", "127.0.0.1", -1));
BOOST_CHECK(TestSplitHost("127.0.0.1:8353", "127.0.0.1", 8353));
BOOST_CHECK(TestSplitHost("127.0.0.1:8343", "127.0.0.1", 8343));
BOOST_CHECK(TestSplitHost("[127.0.0.1]", "127.0.0.1", -1));
BOOST_CHECK(TestSplitHost("[127.0.0.1]:8353", "127.0.0.1", 8353));
BOOST_CHECK(TestSplitHost("[127.0.0.1]:8343", "127.0.0.1", 8343));
BOOST_CHECK(TestSplitHost("::ffff:127.0.0.1", "::ffff:127.0.0.1", -1));
BOOST_CHECK(TestSplitHost("[::ffff:127.0.0.1]:8353", "::ffff:127.0.0.1", 8353));
BOOST_CHECK(TestSplitHost("[::]:8353", "::", 8353));
BOOST_CHECK(TestSplitHost("::8353", "::8353", -1));
BOOST_CHECK(TestSplitHost(":8353", "", 8353));
BOOST_CHECK(TestSplitHost("[]:8353", "", 8353));
BOOST_CHECK(TestSplitHost("[::ffff:127.0.0.1]:8343", "::ffff:127.0.0.1", 8343));
BOOST_CHECK(TestSplitHost("[::]:8343", "::", 8343));
BOOST_CHECK(TestSplitHost("::8343", "::8343", -1));
BOOST_CHECK(TestSplitHost(":8343", "", 8343));
BOOST_CHECK(TestSplitHost("[]:8343", "", 8343));
BOOST_CHECK(TestSplitHost("", "", -1));
}

@@ -104,10 +104,10 @@ bool static TestParse(std::string src, std::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:8353", "127.0.0.1:8353"));
BOOST_CHECK(TestParse("127.0.0.1:8343", "127.0.0.1:8343"));
BOOST_CHECK(TestParse("::ffff:127.0.0.1", "127.0.0.1:65535"));
BOOST_CHECK(TestParse("::", "[::]:65535"));
BOOST_CHECK(TestParse("[::]:8353", "[::]:8353"));
BOOST_CHECK(TestParse("[::]:8343", "[::]:8343"));
BOOST_CHECK(TestParse("[127.0.0.1]", "127.0.0.1:65535"));
BOOST_CHECK(TestParse(":::", "[::]:0"));


+ 4
- 4
test/functional/proxy_test.py Bestand weergeven

@@ -120,24 +120,24 @@ class ProxyTest(StarwelsTestFramework):

if test_onion:
# Test: outgoing onion connection through node
node.addnode("starwelsostk4e4re.onion:8353", "onetry")
node.addnode("starwelsostk4e4re.onion:8343", "onetry")
cmd = proxies[2].queue.get()
assert(isinstance(cmd, Socks5Command))
assert_equal(cmd.atyp, AddressType.DOMAINNAME)
assert_equal(cmd.addr, b"starwelsostk4e4re.onion")
assert_equal(cmd.port, 8353)
assert_equal(cmd.port, 8343)
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:8353", "onetry")
node.addnode("node.noumenon:8343", "onetry")
cmd = proxies[3].queue.get()
assert(isinstance(cmd, Socks5Command))
assert_equal(cmd.atyp, AddressType.DOMAINNAME)
assert_equal(cmd.addr, b"node.noumenon")
assert_equal(cmd.port, 8353)
assert_equal(cmd.port, 8343)
if not auth:
assert_equal(cmd.username, None)
assert_equal(cmd.password, None)

+ 1
- 1
test/functional/zmq_test.py Bestand weergeven

@@ -40,7 +40,7 @@ class ZMQTest (StarwelsTestFramework):
self.zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"hashtx")
self.zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"rawblock")
self.zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"rawtx")
ip_address = "tcp://127.0.0.1:28352"
ip_address = "tcp://127.0.0.1:28342"
self.zmqSubSocket.connect(ip_address)
self.extra_args = [['-zmqpubhashblock=%s' % ip_address, '-zmqpubhashtx=%s' % ip_address,
'-zmqpubrawblock=%s' % ip_address, '-zmqpubrawtx=%s' % ip_address], []]

Laden…
Annuleren
Opslaan