22 Commits

Author SHA1 Message Date
tomFlowee 008eb35f95 Make compile faster
The IDE include checker got to the point where it is actually useful and
this removes a lot of unneeded includes.
Naturally, especially for headers like util.h, this may mean we need to
re-add includes in consuming cpp files that bloats the diff a bit.
2026-05-14 13:27:17 +02:00
tomFlowee bb7275466b Stop using deprecated asio io_service
This ports the io-service to the source compatible io-context
class, with the most work going to the WorkerThreads which owns
that one.
2025-02-08 19:05:26 +01:00
tomFlowee 9e097c84b3 Upgrade deprecated 2023-02-21 14:16:43 +01:00
tomFlowee 0100c2f9e2 Wrap the services in one class
This allows us to avoid duplicating complexity in starting the API
subsystem.
2021-03-16 15:14:13 +01:00
tomFlowee 4d5e7bfb09 Protect node with user-limits for the API.
This introduces several options for public node operators to limit their
nodes usage by 3rd parties, this is aimed at usage of resource-hungry
areas.

We allow limiting the amount of connections any single IP can keep open
with us.
We limit the amount of reconnects we allow in a short number of seconds.
We allow limiting the number of addresses (or scriptHashes) a peer can
register for the node to scan.
The last one is for both the addressMonitorService as well as for the
getBlock filters.

For node operators these items become available using command line
options or config-file options. By default these limits are unlimited as
we assume default usage to be private.
2021-02-26 15:14:14 +01:00
TomZ 82dfd082cd Initial support for a Transaction Monitor API 2020-05-19 08:29:31 +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 df7de2ecd2 Clean up the hairy ball of util.cpp
Move some globals and all stuff pulling in crypto to the
server/serverutil.cpp file

Remove dead code.

Move several items that were used in only one place to the respective
files using them.

Move the class WaitUntilFinishedHelper into its own file.

Made sure no header includes utils.h
remove a handfull of files including utils.h for nothing.
2019-08-24 22:25:09 +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 22fd85bd20 Allow -testnet to be set in a config file.
Should a user point to a config file with the option `-conf` then
we will read the testnet/regtest options from that file.

This does not change the old behavior. To be clear;
Should a user pass -regtest on the commandline (and not -conf) then
we will only read the config file from the regtest subdir
(~/.config/flowee/regtest).
2019-05-12 11:04:04 +02:00
TomZ 6202d74d62 More branding 2019-04-03 14:58:19 +02:00
TomZ 3e46c3e7b4 Rename some old code to use the product name 'Hub' 2019-04-02 17:51:07 +02:00
TomZ ec0673187c Add new BlockNotificationService 2019-03-17 22:49:46 +01:00
TomZ 4cd84c0d34 update comments about flowee.conf 2018-11-21 12:26:17 +01:00
TomZ 1b8c1a586f Allow API server to be disabled via option 2018-10-11 16:26:36 +02:00
TomZ 0fe7749733 Make finding config file more sane
We inherited the design from Core that you can put in your config
file which chain you will follow (testnet, regtest).
This has the effect that you can't have different config files for
different chains and that we always read the fallback location for
all chains. Especially the last one is just harmful.

So, regtest/testnet can only be selected from commandline.
If you choose one of those, it will look for a flowee.conf in the
related subdir (flowee/regtest/flowee.conf for instance) and NOT
for the global one. The global one is only ever read for mainnet.
2018-09-25 18:22:57 +02:00
TomZ 39154aa625 Make startup/shutdown a bit more logical
Actually delete the asio io_service when we are done with it since that
will delete any left over tasks in the queue.
This makes deletion order more predictable.
2018-09-24 21:23:27 +02:00
TomZ c42da8503b More fixes 2018-06-12 23:07:06 +02: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 e610771119 Introduce AddressMonitorService
This service allows one to connect it and register any number of
bitcoin-addresses which will then cause any transaction or block
coming in the future lead the subscriber to get notified about
such events.
2018-02-17 14:47:51 +01:00
TomZ 4635c7a7c4 Rename "AdminServer" to "APIServer"
The change signifies that the server is not just for admin purposes it
will become the preferred way for all subnet-local interactions.

Notice that we still have the JSON based RPC protocol as fallback.
2018-02-17 14:47:51 +01:00
TomZ b6d550d8f5 Start hub application (former bitcoind) 2018-02-14 13:49:53 +01:00