168 Commits

Author SHA1 Message Date
tomFlowee 574fb51b9f Fix logic error in dsproofstorage
This fixes the timeout not removing items from the
m_prevTxIdLookupTable.
2024-09-04 22:19:49 +02:00
John Galt c532227b5c Make this code aware of the new tx anatomy
Transactions can have token information before the output-script,
as such we add the filter and only go for the data we actually want.

This code is written by Telegram user @John_Galts_Gulch.
2024-09-01 21:51:18 +02:00
tomFlowee bcfe2f1649 Rewrite finding of config file.
To make the finding of flowee.conf and logs.conf a tad more predictable
and not random-seeming, this method is re-designed to have a clearly
defined set of fallbacks.
2024-09-01 15:59:22 +02:00
tomFlowee 1d4172d1db Remove unused includes 2024-08-31 23:09:56 +02:00
tomFlowee e9f89556eb Backport uPNP compile fix
This comes from Bitcoin Core commit: 8acdf6654

upnp: add compatibility for miniupnpc 2.2.8
original patch by: Cory Fields
2024-07-26 11:50:13 +02:00
tomFlowee b749d4fbe5 Minor changes 2024-04-07 20:19:46 +02:00
tomFlowee 995750fc99 Increase the requested FD count
Our database uses memmapping and each blk file allocates a file-
descriptor (FD). As such we should increase the number at the start of
the app, if we can.

Notice that the 2000 is chosen to work with a full node that still uses
tiny blk files (128 typically) instead of 1GB files as the Hub makes by
default.

Also fix a bug in the handing code. Using the hardcoded default
FD_SETSIZE made no sense there..
2024-03-28 16:16:48 +01:00
tomFlowee f84c61e187 Follow styleguide; methods start with a lowercase char. 2024-03-20 19:12:50 +01:00
tomFlowee 517a90abeb Detect too many orphans
If for some reason there are a massive amount of orphaned headers, we
don't just keep them around until they are resolved as that is
detrimental to the operation of the node.

Special case this for a reindex and simply skip all orphans fur the
duration.
2024-03-20 19:11:58 +01:00
tomFlowee f1505c0ac7 Handle a large set of metadata files better
Don't wait more than 10 seconds for missing DB data, we'll have to
conclude they won't be forthcoming and just register this in the log.
2024-03-20 19:05:38 +01:00
tomFlowee 96660d90c6 remove unused includes 2024-03-20 19:03:10 +01:00
tomFlowee 53d417e727 Allow using tiny DB files.
Doing a -reindex on a datadir of a different client gives us thousands
of small blk files, which may result in us hitting the max simultaneous
open files limit.
This change forces us to flush the list a bit more aggressively and
close open files.
2024-03-19 09:08:55 +01:00
tomFlowee bc47a700a4 Refactor; wrap BufferPool in shared_ptr
As we moved most of the creation of a BufferPool to be via the
Streaming::pool() method, which uses a thread-local, it makes sense
to start cleaning up the design and make it more modern C++.
The above mentioned method would return a reference and you'd see
loads of places use `auto &pool =` which is less than ideal.

As the number of places where we actually instantiate a BufferPool
goes down, the usage of some sort of smart pointer makes more sense.

This now makes all APIs use BufferPool be wrapped in a shared_ptr.
2023-12-21 15:23:23 +01:00
tomFlowee 2d0aec2cd7 Rename file to match class it is in
This follows the coding style guideline that the file that contains a
class should follow the exact name of this (main) class.

key.{h|cpp} -> PrivateKey.{h|cpp}
2023-11-24 22:20:40 +01:00
tomFlowee fce11e8d4f Rename file to match class it is in.
This follows the coding style guideline that the file that contains a
class should follow the exact name of this (main) class.

pubkey.{h|cpp} -> PublicKey.{h|cpp}
pubkey_utils.{h|cpp} -> PublicKeyUtils.{h|cpp}
2023-11-24 22:20:40 +01:00
tomFlowee ebaccb6fee Move include to cpp file 2023-07-15 11:36:19 +02:00
tomFlowee 5d62ed34b2 Fix global property usage in CMake
This makes txVulcano be built again.
2023-05-02 22:26:41 +02:00
tomFlowee 3becd7aa45 Remove unused log sections and code
Decentralized all things!

But, really, don't put the logging sections for external apps in the
library code.
2023-04-04 15:47:25 +02:00
tomFlowee 038e7bc0a5 Add new CMake option 'build_apps'.
To enable this means the buildsystem will build all the applications
as well as the libraries.
Applications are 'hub' / 'txVulcano' / 'indexer' etc.
Default this one is turned off.
2023-03-20 19:50:32 +01:00
tomFlowee 9e097c84b3 Upgrade deprecated 2023-02-21 14:16:43 +01:00
tomFlowee b702227cc4 stop using deprecated API 2023-02-13 10:38:17 +01:00
tomFlowee f7b25282a0 Add missing include statements 2023-02-06 18:10:03 +01:00
tomFlowee c63519fa47 Move 3rdparty libraries around.
The leveldb and univalue 3rd party libraries are not installed and
not needed by anyone outside of the Hub.
So move them there, making it easier for 3rd party usage.
2022-12-13 11:34:54 +01:00
tomFlowee 2f70766091 remove useless 'throw' statements 2022-09-07 12:53:35 +02:00
tomFlowee adc1d8d3fe Support cash-addresses in cpu-mining coinbase.
Tested by mining a testnet4 block (109202)
2022-08-18 23:29:40 +02:00
tomFlowee 10f94a0e74 Fixlet in logging. 2022-08-18 23:13:35 +02:00
tomFlowee 1ab4d88993 Split version.h
Version.h held mostly stuff for protocol.h, which is a hub-specific file.
The only thing that we actually use is the PROTOCOL_VERSION in our code
and as such that one moved to the interfaces dir.
2022-07-06 22:50:53 +02:00
tomFlowee 05bbba3cb3 Rename class CKey -> PrivateKey 2022-07-06 22:12:33 +02:00
tomFlowee c9af7cca4a Rename class CPubKey -> PublicKey 2022-07-06 21:56:34 +02:00
tomFlowee c33d54ed7d Rename class CKeyID -> KeyId 2022-07-06 21:52:47 +02:00
tomFlowee c2c5fd7973 Make compile 2022-06-20 16:27:00 +02:00
tomFlowee 9fa877f425 Rename hashing methods to start with lowercase 2022-05-17 00:46:54 +02:00
tomFlowee cca8a885bc Fix coding style issues
Follow the coding styleguide and make the methods lowercase on CKey
2022-05-11 13:46:15 +02:00
tomFlowee 7b57024413 Make set() be internally consistent
setting an incorrect value should not keep the old data after we already
update the fValid boolean.
That would give the user the impression that the data was removed while
it really isn't.
2022-05-11 13:20:15 +02:00
tomFlowee b4a3da2642 The 'Server' and 'Api' dirs are not libs
These are technically static libs, but not in any way shared libs.
They are used solely only by this repo and really only by the hub.

Most important, no header files are installed and basically none of
the normal rules for reusable libraries are applied to these files.
2022-02-22 18:39:13 +01:00
tomFlowee 4118d83f12 Move 'hub-cli' into the 'hub' dir. 2022-02-22 18:11:00 +01:00
tomFlowee ae78dd0bb8 Update email address 2021-06-20 22:44:44 +02: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 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 82dfd082cd Initial support for a Transaction Monitor API 2020-05-19 08:29:31 +02:00
TomZ fcdb52d5aa Make leveldb build with cmake
As this now means we completely use cmake, remove some legacy
stuff as well.
2020-04-08 22:48:29 +02:00
TomZ 1144f013a4 Build secp256k1 with cmake 2020-04-08 22:48:29 +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 2bb06afa9e Cleanup the link-lines 2019-08-24 22:25:09 +02:00
TomZ a1dfd1cde9 Work on installable headers 2019-06-03 10:59:33 +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 ffb4196434 Add conf and systemd files to install 2019-05-13 12:20:57 +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