Commit Graph

358 Commits

Author SHA1 Message Date
tomFlowee 9f16d67460 Make API more robust
this avoids the endPoint() method sometimes throwing an exception from
std::map::at confusing the caller.
2023-07-20 20:59:26 +02:00
tomFlowee ebaccb6fee Move include to cpp file 2023-07-15 11:36:19 +02:00
tomFlowee 10510fcb99 Add ProtoBuilder / ProtoParser classes
Protocol Buffers interaction is just another serialization standard,
while its widespread it has fortunately mostly been kept out of
anything relevant or important. Mostly due to the fact that is
really quite bad from a technical perspective.

This adds simple and basic support for creating and parsing
protocol buffer messages, mostly to allow interoperability.
If you want quality: use the MessagBuilder/MessageParser ones instead.
2023-07-14 11:45:47 +02:00
tomFlowee 1e3a4aeee3 Add out of bounds check for MessageParser 2023-07-09 17:09:07 +02:00
tomFlowee 0ae791af1e Make the implementation fit the methodname.
The methodname:
  blockHeightAtTime()
makes the reader think about the actual height of the chain at that
time. Returning that value until the timestamp of the next block is
reached.
Now the method actally returns that number.

The code does not do any work to account for blocks going backwards in
time compared to the block before.
2023-06-14 16:51:23 +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 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 f7b25282a0 Add missing include statements 2023-02-06 18:10:03 +01:00
tomFlowee b5b493542b Rework base58 and tests
The unit tests testing base58 encoding were using univalue JSON
parsing, since we deprecatd univalue to be a hub-private lib
this has now been ported to Qts JSON parser.
Which also makes the clunky cmake hack nice to replace with the
QRC files concept.

As I was in there anyway, the base58 methods being global scope
C-style methods has now been fixed by putting them in a namespace.
2022-12-13 11:34:54 +01:00
tomFlowee 7b29af9c19 Port base58_tests from boost to QTestLib 2022-12-13 11:34:54 +01:00
tomFlowee e9563bdad0 Move univalue tests to belong to the hub tests.
As this is not actually used outside of the Hub, it really makes
more sense to make this testing part of the hub testing.
Also makes it easier to compile.
2022-12-13 11:34:54 +01:00
tomFlowee 4b358543c5 Add unit test for partial blockchain saving. 2022-11-13 15:53:51 +01:00
tomFlowee 9e295b6f30 Port to std library equivalent. 2022-11-04 11:51:23 +01:00
tomFlowee 7d7cc2a7c0 Port httpengine to Qt6 2022-09-10 00:35:59 +02:00
tomFlowee 2d3d74d9c7 Update for changes path from QT_TESTCASE_BUILDDIR
Seems that the this path changed, either in Qt or in the cmake modules
(which comes down to the same thing).
It now no longer points to the root of my project but to the place where
my executable is stored (the testing/api dir).
2022-09-07 15:46:45 +02:00
tomFlowee 4ecfaab242 Merge branch 'master' into platformUpdate 2022-09-07 13:06:07 +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 abea4c9bce Remove this from compile for now 2022-09-07 12:05:27 +02:00
tomFlowee 66f3ec2fe4 Port to Qt6 2022-09-07 12:01:14 +02:00
tomFlowee 8ff3802687 Fixes in the HDMaster* classes 2022-07-11 18:04:14 +02:00
tomFlowee 887fbef139 Add some convenients methods. 2022-07-11 13:31:24 +02:00
tomFlowee 9a9a2d0829 Avoid duplicating magic numbers
Move the prefix numbers all to one place to avoid copy-pasting them.
Also make the xpub more complete.
2022-07-08 13:14:41 +02:00
tomFlowee f318774663 Add HDMasterPubkey to derive xpub style addresses
This also alters the 'toString()' on HDMasterKey to stop giving
a rather useless xpub and turn it into a dedicated toXPubString()

Closes: #1
2022-07-07 21:16:50 +02:00
tomFlowee 0eee5a06b6 Split test into two.
Since they are in different libs, it makes sense to put the right part in
the right test dir.
2022-07-07 21:00:53 +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 1ebcd0077a Cleanup API and install header
This changes the usage of 'unsigned char*' in the API with the much more
common 'char *' as that has literally no effect on the generated code
anyway.
2022-05-11 23:37:51 +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 7a7c80913c lowecase method names. 2022-05-01 14:53:52 +02:00
tomFlowee aef7366034 Implement BIP69 in TransactionBuilder
This adds support for the
 Lexicographical Indexing of Transaction Inputs and Outputs
anonimize concepts of transactions directly in the transaction builder.
2022-04-15 17:33:55 +02:00
tomFlowee e23925a954 Clean up the API and implement logging on failure 2022-04-06 14:23:37 +02:00
tomFlowee 0663515da0 Fix naming of tests 2022-04-06 11:46:40 +02:00
tomFlowee a47a7072b3 Add unit test for allocator too 2022-04-06 11:39:49 +02:00
tomFlowee fa70e99dae Make include more on-topic 2022-04-06 11:32:44 +02:00
tomFlowee 0d4b214e23 Move over to the new allocator 2022-04-06 10:24:16 +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 a4bf291040 Move another file to become qtestlib 2022-02-22 17:35:33 +01:00
tomFlowee ceb11cd273 Cleanup coding in file a little. 2022-02-22 17:28:33 +01:00
tomFlowee a7854430a2 Move from legacy boost to qtestlib. 2022-02-22 17:24:01 +01:00
tomFlowee 4c92085e6c Remove txid from metablock.
Flowee experimented with a 'metablock' a piece of data stored next to
the blocks with some metadata it discovered during validation.
One of those pieces of info is the txid, which turned out to be too big
to store here (16GB or so added).

This change removes the txid but it does keep the script-flags and the
fees for each transaction (8 bytes per tx) which adds maybe 3GB to the
entire chain.
2022-02-22 16:15:33 +01:00
tomFlowee bdbc53ac91 Remove old wallet code.
Again, wallet has moved to flowee-pay
2022-02-14 17:53:47 +01:00
tomFlowee 26262783de Allow mid(1, 0) to be called
This now creates a zero size, empty, result.
2022-02-10 18:02:50 +01:00
tomFlowee 41e00b134f Add convenience methods on ConstBuffer
this adds indexOf() and toString()
2022-01-25 23:59:54 +01:00
tomFlowee 9c4984dcf7 [P2Plib] Make initial startup 70% faster
What we did previously is load a static chain which was to avoid lots of
work by simply memory-mapping the data instead of inserting it in a
vector.

This improves upon that by also having a metadata file which holds the
block-hashes directly readable. This avoids us having to iterate over
the blockheaders and hashing them.

Additionally we now have a single chain-work field that is the total
amount added work for the headers. This saves us from doing 256-bit
divisions and work for each blockheader as well.

Result is that we make the statup mostly about memory moving and remove
all CPU intensive stuff. Going from 1450ms to 400ms on desktop.
I expect an even greater gain on mobile CPUs.
2022-01-12 19:45:51 +01:00
tomFlowee 1b5ae89d31 [Refactor] rename FastTransaction.{h|cpp} -> Tx.* 2021-11-02 11:05:14 +01:00