Commit Graph

40 Commits

Author SHA1 Message Date
TomZ 5cefa4981f Make cachier compile w/o QRencoder lib 2020-08-11 22:06:28 +02:00
TomZ 21e77809fa Silence some warnings 2020-06-05 15:32:11 +02:00
TomZ 69a7db91ec Introduce TransactionMonitorService
This supplies a push notification on txid becoming known to the Hub.

Additionally this changes its close relative the AddressMonitorService
to use a different tag for the transaction data and the
double-spend-proof data so as to make it obvious which one is being
sent.
2020-05-19 20:57:51 +02:00
TomZ 175096b2bd Refactor: move files
Move some files back to the server "library".
Merge the 'console' lib with server, as it doesn't really make sense with
just one file and nobody exclusively linking to it.

The server "libary" is not really a library, its the place we put all
the files shared by hub-qt hub-cli and hub.
We no longer depend on these files from other places (mostly due to
moving to the new logging framework) and as such we can move the files
back.
2019-11-13 19:09:24 +01:00
TomZ d573e307c3 Refactor; move SplitHostPort to utilstrencodings 2019-11-12 15:35:54 +01:00
TomZ 7708e3f840 simplify 2019-10-20 22:12:09 +02:00
TomZ f1d0a68579 Port address monitor service to use address-hash
Remove addresses of type ripe160 to be used in the API of AddresMonitor
API service. Instead use a sha256 hash of the entire output script.

This is mostly internal changes not affecting the operations much.
2019-10-20 20:17:17 +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 d751261eb9 Fix typo 2019-09-08 20:43:01 +02:00
TomZ e7a7ada953 Cleanup dependencies a bit more.
This means that for apps like 'pos' no longer link against libSSL

The streams no longer zero-after-free, there are no secrets transported
in datastreams so this is useless and avoids linking in one OpenSSL
call.

The insecure_rand() method depended on the openssl code to seed it with
randomness. Now replaced with a proven current-time-milliseconds.
This is enough in those cases because it was always meant to be an
insecure random.
2019-08-24 22:25:10 +02:00
TomZ 0755acd1e6 [API] Add double-spend-proofs to addressMonitor
In the address monitor service this detects specifically if a double
spend detected by the Hub is applicable for our subscriber, and if it is
then a Message will be sent to the subscriber.

This introduces a new message type DoubleSpendFound
and changes the API for the TransactionFound message while dropping the
TransactionRejected message.
2019-07-24 18:41:16 +02:00
TomZ a1dfd1cde9 Work on installable headers 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 0282e4b2a3 Set first version allowed for AddressMonitor to be 2019-5.1 2019-05-17 20:48:21 +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 550583305a Be consistent between apps, add help option to pos 2019-05-13 12:20:57 +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 32c45610cd Further fixes for cashier / PoS
Also upgrade the cashier app with logging, ctrl-c catching
and debug + version command line arguments.

Last, this checks the server version and exits if the Hub
version is too old.
2019-05-08 09:07:17 +02:00
TomZ e4e2ef4193 Make the pos commandline use the FloweeServiceApplication
this has the direct effect that logging works better there.
2019-05-07 20:54:26 +02:00
TomZ 82a8e137bb API reviews
Rename 'RawTransaction' to 'LiveTransactions'
Review the AddressMonitorService.
Cleanup and remove some unused items (but keep binary compatible).
2019-05-06 20:13:10 +02:00
TomZ ccd66a49b2 Document and refactor NetworkService
The main goal of this is to make sure that network services
implementations don't reuse one bufferpool for all their remotes as that
can cause threading issues.
One bufferpool per remote is now made easy.
2019-04-09 17:24:38 +02:00
TomZ ab1248cac9 remove double include of cur dir 2019-03-29 21:58:36 +01:00
TomZ cae5e02a4d Drop not needed libs from includes dir 2019-03-29 21:07:28 +01:00
TomZ 5939de8ef0 Move API protocol definition to interfaces dir.
It makes no sense to include the API "library" just to use
the header file.
2019-03-29 21:07:28 +01:00
TomZ 209e955a11 fix some naming TODOs 2019-03-28 10:23:06 +01:00
TomZ c8108f387c Drop API login requirement and api-cookie argument 2019-03-27 18:55:13 +01:00
TomZ d88f51ffc0 fix error in install when missing dependency 2019-03-05 19:04:14 +01:00
TomZ a04f31cbdd Fix dependencies 2018-07-21 09:02:16 +02:00
TomZ 12eacad84c make compile on older systems 2018-06-23 21:00:57 +02:00
TomZ ba69da6306 cleanup 2018-05-09 10:48:16 +02:00
TomZ 7a026acee2 Finish up first phase.
Handle incoming payments, show if under/overpaid and
make sure everything is properly inserted into the database.

This makes the process actually work and useful for a small business
2018-03-27 22:24:23 +02:00
TomZ 3d7b8e7ab6 Add ExchangeRateResolver with kraken support 2018-03-26 17:26:46 +02:00
TomZ 3ab384b336 Introduce new pos gui app 2018-03-23 19:06:17 +01:00
TomZ 3199bd3886 Make 'default' logger group based on compile unit. 2018-03-21 17:57:53 +01:00
TomZ b4d142d933 Add Qt support to Logger 2018-03-16 23:30:27 +01:00
TomZ 3476b98a32 initialize variable 2018-02-19 00:44:01 +01:00
TomZ 066f9586d8 on registering an address at AddressMonitorService, search mempool.
So the service only noticed new stuff happening, like a transaction
coming in or block being mined.
With this change we get a little smarter and look in the current mempool
as well to try and match a transaction.

This should be very useful for clients that lose network connection
briefly.
2018-02-19 00:02:24 +01:00
TomZ 3d16d31fda Remove cookie handling, the NetworkManager does that now. 2018-02-17 23:36:00 +01:00
TomZ 0d2b529491 First very simple client for address monitoring.
This is the simplest and most central part of a point-of-sale
component, as such I place it in that directory.
2018-02-17 19:03:14 +01:00
TomZ 33fe0fccb5 Cleanup ValidationInterface
Get rid of the weird boost signals setup
Move it to a new library 'interfaces' which is
for stuff that has no dependencies and can avoid
creating inter-library or cicular dependencies.
2018-02-16 12:37:13 +01:00