137 Commits

Author SHA1 Message Date
tomFlowee 9e165d07ef Allow basedir to be given in the config file.
A general cleanup of how we start indexer.
2026-05-21 23:51:09 +02:00
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 efa6c05e1a A API review of CashAddr.h
This removes from the header all private methods, adds API docs and does
some renames that make code using this API much more readable.
2026-02-09 15:28:04 +01:00
tomFlowee 11d24589c3 Make compile
Add missing include so it also compiled against Qt 6.10
2025-10-21 19:28:16 +02:00
tomFlowee 49324fad28 Limit linking to only needed boost libs.
We now removed the need for Boost:chrono in all the libs, to avoid
accidentally linking to it again this change makes the apps link to
the actual specific libs instead of just all.
2025-03-07 15:36:36 +01:00
tomFlowee 55328ce0d7 Help binding to future interfaces
The idea of binding to interfaces now will take into account the
interfaces maybe becoming available only after the server started.

If your server starts at machine boot, it is a 50/50 chance that the
network interfaces are already fully configured and have received
addresses. In case of dhcp, more often than not this means that your
server will not be listening at the main interface because it wasn't up
yet.

This new api allows the server to give a function to register a new
interface and we have some linux specific code that will notice changes
in the interfaces and we'll allow the app to bind to it a moment or two
after that.
2025-02-20 20:37:33 +01:00
tomFlowee 586c0d5eef Some string usage cleanups.
Avoid unneeded conversions.
2025-02-12 15:35:41 +01:00
John Galt aa44de7d89 Change PostgreSQL so that inserts are faster (using COPY) 2025-02-12 15:35:41 +01:00
tomFlowee 1dc2656bef Follow ASIO porting for apps too. 2025-02-11 19:41:22 +01: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 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 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 1d4b476045 Port to Qt6 and cleanup
A simple port caused a regression in the unit tests that took me a long
time to track down, as a result the code has been commented, prettyfied
and more.

The final issue was that the return time of QList::size() turned from an
int to a ulong and I stored that in a QDataStream with the streaming
operator.
On extracing the now twice as long number I just put it into an int,
causing 4 bytes to not be read and a subsequent off-by-one in reading
further data from the file (a list of ints).
2022-09-07 15:08:34 +02:00
tomFlowee 4ecfaab242 Merge branch 'master' into platformUpdate 2022-09-07 13:06:07 +02:00
tomFlowee 9269fc873d Fix warnings and possible off-by-one 2022-09-07 13:04:30 +02:00
tomFlowee f7bf33828f Stop using deprecated Qt APIs
This makes the code compile on Qt6 as well.
2022-09-07 12:53:35 +02:00
tomFlowee 66f3ec2fe4 Port to Qt6 2022-09-07 12:01:14 +02:00
tomFlowee 9fa877f425 Rename hashing methods to start with lowercase 2022-05-17 00:46:54 +02:00
tomFlowee 1d25e45a1c Reconcile more places to use pools API
This removes 2 more custom solutions to converge on one
  Streaming::pool()
namespaced method.
2022-01-25 23:20:12 +01:00
tomFlowee ae78dd0bb8 Update email address 2021-06-20 22:44:44 +02:00
tomFlowee d5eef9238c Make sure filesize is a power-of-2
Memmapping can use any filesize, but the pages are allocated in a power
of two amount.
Assuming 4K pages we now aim to have 65536 pages to map a big file.
2021-02-07 20:02:10 +01:00
tomFlowee b9f2c23ffb Optimize memory-access
A single lookup on a db file took 20 reads using a binary-search.
This change makes that around 15 reads, of MUCH more localized
manner.
2021-02-07 18:09:55 +01:00
tomFlowee bfcb9b0be2 whitespace fix 2021-02-07 14:28:00 +01:00
tomFlowee a3cf6cbcd8 Switch to std::map / std::unordered_map 2021-02-07 13:46:57 +01:00
tomFlowee 7a6baf73e4 Optimize;
cache filesize.
2021-02-07 10:57:45 +01:00
tomFlowee c71b6fa9c0 Fix off-by one and be more consistent
Lets default to using the plain and simple assert(), the Q_ASSERT macro
doesn't really add anything for us.
2021-02-06 23:18:21 +01:00
tomFlowee 1deaab6cc3 Search harder for config file.
This gets around the sillyness where you need an extra dir for a config.
  ~/.config/flowee/rest-service/rest-service.conf

now you can just use
  ~/.config/flowee/rest-service.conf
2021-02-06 23:10:17 +01:00
tomFlowee 3fe98afce9 Minor cleanup
This removes some unused includes from common headers and dead code
from some C++ files.
2021-01-05 22:05:25 +01:00
tomFlowee 9748d3988f Cleanups and improvements. 2020-12-25 23:51:06 +01:00
tomFlowee 519b03d93b Some notes 2020-12-16 18:44:31 +01:00
TomZ b257ac62b3 Due to popular demand: bind on all interfaces
When there is no config we now bind on all available (at startup)
interfaces to listen for service requests.

This solves the problem where a fresh server would not listen to
requests from the outside world but only on localhost.
2020-11-16 19:44:24 +01:00
TomZ 37e1f2fcd3 Fix bad usage of create_directories() 2020-11-14 23:59:01 +01:00
Justaphf 18ca7abb7c Add scalenet 2020-10-02 18:43:52 -04:00
Justaphf 13286db582 Add testnet4 2020-10-02 18:43:52 -04:00
justBCHit 95221aa584 Found a spentdb / enabled option in the source code. It is in the docker
information, but not in the "regular" docs. Enabling it works and
creates a 'spent' directory.
2020-08-30 23:35:31 +02:00
justBCHit 45fb281fd4 Update README 2020-08-23 19:54:46 +00:00
TomZ c244c94634 Add new Indexer API message: 'version'.
This mirrors the one in the Hub in that it returns the version of the
Indexer running on the server.
2020-07-27 21:27:26 +02:00
TomZ 71c529df4d Indexer-cli now aligns numbering 2020-05-14 22:10:17 +02:00
TomZ f4ce2cbf73 Cleanup the indexer-cli client
* avoid using warning/fatal log levels as they go to stderr
* correctly exit at end in more cases
* Limit size of transaction we dump on screen unasked.
* remove dead code.
2020-05-14 21:43:48 +02:00
justBCHit 8f386c7d63 Added port selection support for PostgreSQL and MySQL for Indexer 2020-05-13 12:55:07 +00:00
justBCHit d727c781e6 Added MySQL speed improvement 2020-05-11 17:05:39 +00:00
justBCHit 833b256469 Added MySQL support to AddressIndexer 2020-05-10 16:11:32 +00:00
TomZ 9744e01343 Make compile 2020-02-19 16:55:46 +01:00
TomZ 11d16001c6 Indexer: add get for current sync-height 2020-01-20 12:17:55 +01:00
TomZ ce55457c33 Avoid asking for a block the hub won't have 2020-01-15 12:18:01 +01:00
TomZ 987081a229 Make the SQL server sort by block-height for us 2019-12-26 00:00:03 +01:00
TomZ 901860e406 Fix more edge-cases where indexer might stop updating. 2019-12-17 17:57:08 +01:00
TomZ 5796de30ba Be smarter about getting new block on connect 2019-12-12 23:19:26 +01:00
TomZ a85a9e1207 Indexer now uses blockCount
Instead of asking for a block and reacting when we get a failure, this
just uses the current height instead.

This also makes 'flush' happen in each indexers' own thread, which should
be good for performance.
2019-12-12 16:02:08 +01:00
TomZ 7b5e922658 Flush address DB faster.
Ask the hub for the chain-length and when we processed the last block,
immediately flush the data to the SQL DB.
This makes use represent the whole world faster.
2019-12-12 14:49:46 +01:00