Commit Graph

11775 Commits

Author SHA1 Message Date
TomZ e168e3904d Respond to error. 2019-06-07 09:53:05 +02:00
TomZ 99e7f8656c Make headers go to nice subdirs 2019-06-07 09:53:05 +02:00
TomZ b327821236 make compile 2019-06-07 09:53:05 +02:00
TomZ 449f91f46d Move solver method to utils lib
The code that detects standard script-types is now available as a
library function, renamed to live in a namespace;
Script::solver()
2019-06-06 22:21:46 +02:00
TomZ a7f4e942f9 Add README for indexer 2019-06-06 20:15:01 +02:00
TomZ ec2610139e Allow setting indexer connections in conf file
This adds the ability to read from the config file the network
connections. Both the listening address and port as well as the upstream
'hub' address.
2019-06-06 19:44:16 +02:00
TomZ 3c659855db Merge branch '2019.05' 2019-06-06 17:47:19 +02:00
TomZ c5aefb0722 Various small fixes in indexer-cli 2019-06-06 17:43:27 +02:00
TomZ 913fced357 Make CI build binaries differently
Make sure we build binaries for all branches, enabling testing.
Don't upload a docker for anything but releases (and betas).
2019-06-06 09:54:31 +02:00
TomZ a723243e65 Use new gitlab-ci feature; variables 2019-06-06 09:41:32 +02:00
TomZ 01641773e1 Import httpengine library
This C++ library is a small framework which creates a full
http(s) server.

This is imported code from the qhttpengine open source project.
I modified some core components in order to make this framework
multi-threading and changed some APIs for cleanlyness. As such
it is not source compatible and getting it accepted upstream is
not realistic.
2019-06-04 21:41:26 +02:00
TomZ 6643059f2a Forgot to add copyright headers to these files 2019-06-04 21:40:12 +02:00
TomZ 0c9f415eb8 Several NetworkManager fixes
This adds all the header ints to chunked messages, solving the problem
of losing RequestId on roundtrips if the answer was too big.

Added a unit test for this "new" features.

This makes callbacks all use shared_from_this() in order to avoid
callbacks being done on deleted instances (thanks boost!).

Last, special case when the user doesn't connect but just sends messages
which caused a send of data, only to realize the connection wasn't open,
and then a connect.
This makes sure we immediately start a connect on queue of a message.
2019-06-04 21:40:02 +02:00
TomZ 57b0b58aa7 Add code to stream a NetworkEndPoint to Logger. 2019-06-03 21:41:04 +02:00
TomZ d10e50803c Avoid warnings from Qt.
Lets not ask about m_verbose when we didn't add it to the parser at all.
2019-06-03 21:39:37 +02:00
TomZ feb73bd1a8 Improve loglevel and naming. 2019-06-03 21:38:21 +02:00
TomZ d0662d6e22 Install more headers. 2019-06-03 21:37:30 +02:00
TomZ ca2d6b041a fix connection() not finding an existing connection 2019-06-03 14:37:08 +02:00
TomZ a00938a118 Fix race condition in shutdown of NetworkConnection 2019-06-03 14:37:08 +02:00
TomZ 50870520df Fix NetworkConnection::isConnected() behaviour
This brings it closer to what we expect.
2019-06-03 14:36:59 +02:00
TomZ 08ca3c59c9 Set sane default log levels 2019-06-03 10:59:33 +02:00
TomZ a1dfd1cde9 Work on installable headers 2019-06-03 10:59:33 +02:00
TomZ b6faee185b signal reparseConfig on FloweeServiceApplication
When a user sends a signal SIGHUP, we parse the configs again
traditionally on Unix.
We already use this for log-configs.
This signal allows apps to get notification and reload their
own configs.
2019-06-03 10:59:33 +02:00
TomZ fbfc0f2015 update test to follow API change 2019-06-03 10:59:33 +02:00
TomZ 7203a058a3 Change API call SplitHostPort slightly
Instead of taking an int for the port, take a short.
This matches better with the networkmanager EndPoint struct.
2019-06-02 20:16:49 +02:00
TomZ f868a8274e Make all protocol upgrades equal.
The "UAHF" one used to be "more equal", mostly just because it happened
to be the first.
This makes them all equally equal.

Specifically this removes the special casing and the enum for the 201708
HF (aka BCH fork-point).
We select the right branch now purely based on the historical check-
points.
2019-06-02 13:57:47 +02:00
TomZ e1926817b2 make 2019.05 be the latest tag 2019-05-30 16:04:47 +02:00
TomZ db9eb1adfb Install some more files 2019-05-30 13:36:57 +02:00
TomZ 3e242d736e API Test seems to not run on CI, disable for now 2019-05-30 13:25:59 +02:00
TomZ 0d72460471 Add another API test 2019-05-30 13:25:58 +02:00
TomZ e6a23d5f4f Merge branch '2019.05' 2019-05-27 09:28:25 +02:00
TomZ 702addadbb Remove race-conditions in connecting 2019-05-27 09:27:26 +02:00
TomZ 517d0b796d Fix determination of manual reorg
The "Greater than 6 blocks" can be off when we are doing IBD where
headers and chain are not pointing to the same block. Make sure this
works for such an occasion as well.
2019-05-27 09:27:19 +02:00
TomZ 2acde0f30a Allow no progress in download for 6 seconds instead of 2
before disconnecting.

As this only applies to IBD, we can take into account that we have a
higher number of connections typically and this helps stability.
2019-05-27 09:27:14 +02:00
TomZ 01459ec961 Refactor; move lastCommonAncestor to Blocks::Index ns
Out of the main.cpp and usable for a bigger audience.
2019-05-27 09:27:08 +02:00
TomZ 8ed6d6a3e2 NWM: Fix reconnecting a dead connection
A disconnect would cause the socket to close which caused a
callback which triggered a timer to reconnect after half a minute...

This makes sure that after we manually disconnect we honor that.
2019-05-27 09:23:05 +02:00
TomZ d68b5e9416 Read and print hub log for CI usage.
When a blackbox test fails add the logs from the nodes
into the output of the log itself so they are all in one
place.

Especially handy for CI or docker usage where getting files
is a lot harder than getting standard-out.
2019-05-27 09:23:05 +02:00
TomZ a20118c5fb Add LiveService unit test
The bugreport claimed that sending an existing coinbase would give
inconsistent results. This test can't find any unexpected behaviour.
2019-05-27 09:23:05 +02:00
TomZ 18035c2e66 Start new testing setup for API testing
This is a blackbox type testing for specific API calls.
2019-05-25 17:06:23 +02:00
TomZ 30eed0d330 Merge branch '2019.05' 2019-05-25 14:32:05 +02:00
TomZ 38b4e8b189 Allow hubs -apibind to use 'localhost' string
The command really only accepts IP addresses, but we use 'localhost' as
an exception to bind to loopback for ipv4 and ipv6 at the same time.

Also improve logging of errors and avoid failing to start the API
service if a bind address wasn't an IP.
2019-05-24 23:14:15 +02:00
TomZ e31a96183d Make chain select with -conf more stable
Require the config file path to be absolute before we assume we can read
it without knowing the chain beforehand.
2019-05-24 22:46:14 +02:00
TomZ 26fda112a0 Fix bug in API for where the answer is a plain bytearray.
This allows RPC wrapper classes to reuse the default implementation also
when the answer is not a uint256
2019-05-23 12:12:25 +02:00
TomZ 59c41123c1 Fix regression, throw when not found. 2019-05-22 23:12:44 +02:00
TomZ 5a2e08ce82 remove some unused code 2019-05-18 16:03:29 +02:00
TomZ a5e8ea401a Sync the new AddressMonitor service API with others
the OffsetInBlock token now has the same value as with other services.
2019-05-18 16:03:26 +02:00
TomZ a54107c168 Make NetworkService thread-safe
This makes the access to the per-peer datastructure lock-free and
thread-safe.
2019-05-18 16:03:22 +02:00
TomZ 7fd29f5084 remove some unused code 2019-05-18 16:00:50 +02:00
TomZ 134f6952d0 Sync the new AddressMonitor service API with others
the OffsetInBlock token now has the same value as with other services.
2019-05-18 15:57:40 +02:00
TomZ be28c9e650 Make NetworkService thread-safe
This makes the access to the per-peer datastructure lock-free and
thread-safe.
2019-05-18 15:56:34 +02:00