Commit Graph

42 Commits

Author SHA1 Message Date
TomZ 648eb56c9d Drop cmake add_dependencies() calls
When we made the 3rdparty libs be build by cmake the need to manually
add dependencies became irrelevant.
2020-07-05 12:50:09 +02:00
TomZ 32251471a5 On fetch-block, also notify about each transaction.
The callback on each transaction was only called when individual tx
were fetched, which is "magic" behaviour and I don't like
inconsistencies.
So, also call the callback for each transaction in a block we fetched.
2020-06-19 16:40:29 +02:00
TomZ c5a8181299 Pre-allocate a larger buffer
This will most likely benefit some FloweeJS users when they do some stuff
that I didn't think a good idea, at least this way they will not get 
a bunch of errors :)
2020-06-19 16:40:29 +02:00
TomZ 7e5d3a98dd Fix in apputils/blockchain (floweejs) for assert
This assert would hit in some cases, due to coinbase not getting a
prevtx field.

This solves that properly.
2020-06-19 16:40:29 +02:00
TomZ a01fbab2b7 Update tests and fixes in bitcore-proxy
this fixes mixups when more than one output of a transaction was used in
our search.
2020-01-17 19:44:29 +01:00
TomZ a1cb53e603 Delay callback until end
This allows us to do sends from the callback.
2019-12-30 17:25:26 +01:00
TomZ 50fc8dd024 Make available some helper methods as protected 2019-12-27 21:31:44 +01:00
TomZ d15998e658 Provide a safe way to modify jobs out-of-thread
The FloweeJS component uses this class but requires the usage
of the NodeJS 'main' thread. Which needs safe access to the jobs
list at the same time the Flowee workers need access.
Simple solution; add a mutex.
2019-12-23 13:20:08 +01:00
TomZ ea1ab3c987 Fix interpreting API results. 2019-12-10 17:39:17 +01:00
TomZ 85d5dac081 add is{Hub|Indexer}Connected() methods. 2019-12-09 15:13:37 +01:00
TomZ ad65d8010b Fix check for coinbase in search API. 2019-12-09 15:13:37 +01:00
TomZ 0e02f9796d cleanup 2019-12-09 15:13:37 +01:00
TomZ 78fa7fc627 add new virtuals for floweejs 2019-12-01 23:05:33 +01:00
TomZ d004e0f5b1 Update UTXO search callback
Make the UTXO search callback actually useful for more than tests.

This passes all the data we have and what the user could want to use,
also updating the receiver (bitcore-proxy).
2019-11-30 19:53:12 +01:00
TomZ d658189a73 Move callback
Make the callback happen after we get the indexer status.

Additionally, fix the issue where looking up a txid that failed
would end up being recursive due to us copying the initially requested
hash. Causing it to be a duplicate (which then fails etc).
2019-11-29 22:14:51 +01:00
TomZ e8c38f6b77 Add api docs 2019-11-28 23:59:32 +01:00
TomZ bcec400e79 Remove Qt dependency from the blockchain search stuff. 2019-11-13 19:09:16 +01:00
TomZ d573e307c3 Refactor; move SplitHostPort to utilstrencodings 2019-11-12 15:35:54 +01:00
TomZ 6770467a06 Change the callback to have the version included 2019-11-11 19:37:15 +01:00
TomZ 3b5491e9d3 Fixlets in log-levels for the bitcore proxy. 2019-11-11 19:37:01 +01:00
TomZ e7ad998d57 Add -fPIC to installed libs 2019-11-04 14:20:50 +01:00
TomZ 2396938cfb New version and only connect to new versions 2019-10-20 11:57:01 +02:00
TomZ fcbe8d3b8b Adjust BitcoreProxy to the new Indexer API 2019-10-16 22:57:50 +02:00
TomZ 00814e24f9 API: Use hash of outscript instead of address
The usage of a ripe160 for bitcoin addresses in the API and in the
Indexer loses some info, specifically what kind of script it is.
Additionally not all types of scripts fit this mold. At best that means
its not future-proof.

This adds a method to the API in order to select from a Tx the hashed
outscript (thats singlehashed sha256) and refactor the address indexer
to use that instead of the ripe160 address.

The API enums broke a little, so I used the opportunity to break it a
lot and clean up the enums in order to make them more future-proof.
But, yeah, software from before this commit is protocol incompatible
with software after this commit.
2019-10-16 22:57:50 +02:00
TomZ ba11657cf7 BitcoreProxy; add endpoint & docs
This makes the service mostly self-documenting as it serves plain simple
html pages for error messages which show the end points you can use.

This adds support for the "unspent outputs for address" endpoint.
2019-10-06 13:07:28 +02:00
TomZ a9e546071f BitCore: Add support for address lookup 2019-10-05 16:08:37 +02:00
TomZ 2e37162aa1 AppUtils lib; add search API
The core APIs in Flowee are quite low-level and especially combining
results from multiple services becomes tedius, verbose and thus
error-prone.

For this reason I wrote a new SearchEngine and related classes which
allow one to create a single compound request, submit it to the engine and
get a callback when it is done.

For instance one can now create a request for a transaction by txid and the
system will split this into a txid-lookup and the actual fetch for the
transaction.
Enough callbacks and options exist to be able to add a lot more details
this way in a simple manner.
2019-09-23 11:03:36 +02:00
TomZ c6e48e2e11 Be much more consistent with our types
(socket) ports are uint16_t
log-debug sections are shorts.
2019-09-12 15:23:30 +02:00
TomZ c5c25a5e29 Minor usability fix
Avoid confusing naming and consistent casing.
2019-09-08 20:51:25 +02:00
TomZ 844747fa65 Make configurable which cli options to allow. 2019-08-24 22:25:10 +02:00
TomZ c3ddab9cd4 Make Indexer bind to localhost as default 2019-08-24 22:25:10 +02:00
TomZ 99e7f8656c Make headers go to nice subdirs 2019-06-07 09:53:05 +02:00
TomZ a7f4e942f9 Add README for indexer 2019-06-06 20:15:01 +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 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 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 1f52ae7a7f FloweeServiceApplication: support net wildcard
For service applications that bind to networks (currently
only indexer) this allows users to pass the address:
    0.0.0.0
to bind to. The effect will be that we find all the network
interfaces in the system and bind to all of them.
Notice that we already had "localhost" as an alias to bind to both
v4 and v6 loopback interfaces.

This new feature depends on optional dependency QtNetwork.
2019-05-17 12:32:11 +02:00
TomZ ba2216d582 Add to CLI clients verbose/quiet options
All client apps (=connecting to a server only) now gained the  verbose
and quiet command line arguments to select a different level of
verbosity.

Servers don't need this as they use a config file.

This also makes the --debug option only for debug builds as the logging
system already doesn't compile in debug statements otherwise, it makes
little sense to try to print them.
2019-05-13 18:27:09 +02:00
TomZ 5b155600d9 Make app arguments more consitent
Now everyone auto-connects to localhost unless passed the
option --connect=

Also make indexer find the logs.conf from the same dir as the
commandline passed config file.

This makes running it as a service more useful.
2019-05-09 12:16:11 +02:00
TomZ 8d81cc5471 Create new lib apputils
This lib depends on QtCore, as such it is separated from other libs. As
many apps depend on QtCore we can share classes here to avoid
duplication.
2019-05-07 20:53:22 +02:00