46 Commits

Author SHA1 Message Date
tomFlowee ced4f98beb Add token support to the Tx object
We add a Token class to Tx, which adds an easy to use API when compared
to the plain iterator. The main point of the API chosen is to make sure
we don't do unneeded parsing or copying for tokens unless needed.

Additionally refactor the ValidationPrivate::UnspentOutput class to
inherit from the Tx::Output class in order to avoid lots of duplicated
logic on handling the data.
2026-05-13 17:20:32 +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 d4b1d240f0 Add unspentdb export --no-export argument
This basically just walks the of records without actually exporting
them.
It will nicely print related info files, number of actual records found
etc.
2024-04-07 20:19:46 +02:00
tomFlowee 665d61eeb4 Add various helpful warnings and info messages. 2024-04-07 20:19:46 +02:00
tomFlowee 20e6b356da Add ability for Export to take a dir
This will iterate over all DBs and list all of them.

Additionally, add a 'height' option to list at a specific height.
2024-04-07 20:19:46 +02:00
tomFlowee d680346e25 Make the command line arguments a bit clearer
This allows us to explicitly specify dir/info/db arguments.
2024-04-07 20:19:46 +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 66f3ec2fe4 Port to Qt6 2022-09-07 12:01:14 +02:00
tomFlowee 9789296212 Port to newer Qt apis 2022-08-21 11:48:58 +02:00
tomFlowee 9fa877f425 Rename hashing methods to start with lowercase 2022-05-17 00:46:54 +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 1b5ae89d31 [Refactor] rename FastTransaction.{h|cpp} -> Tx.* 2021-11-02 11:05:14 +01:00
tomFlowee ae78dd0bb8 Update email address 2021-06-20 22:44:44 +02:00
tomFlowee d614c33d2a Add --keep option to prune to make a backup of the original files. 2021-02-28 22:16:05 +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
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 629644d938 Fix incorrect warning messages on empty file 2020-03-06 00:26:55 +01:00
TomZ dd29c17d49 Improve info command 2020-03-06 00:20:06 +01:00
TomZ fb2854f23d Add unspentdb Duplicate command. 2020-03-05 23:29:53 +01:00
TomZ 7ce5880f95 Make unspent-db command easier to use
This change drops the various arguments that force the user to select if
an argument is an .info file or a .db file etc. Instead auto-detect them
and also allow the user to provide a list of arguments.

The most direct effect is that I can now run 'unspent-db info *.info"
2020-03-05 23:29:52 +01:00
TomZ d9604e3f33 Design a better detection for need of UTXO-GC
Doing a garbage collect of the Sha256 based databases means we remove
all the records that have been deleted from our file.
We also sort the file to have all the jump-tables at the end, making it
much cheaper on memory-locality to find (or not) items in the DB.

The downsides are that this prune step takes time, writes dozens of MBs
and that we lose checkpoints. The latter means we no longer can rollback
to a safe position, simply because we flushed those records.

So we want to do this often enough to avoid fragmentation but not too
often because it creates a greater risk on data consistency.

This algoritm checks the actual data and calculates the fragmentation of
the jump-tables to decide if we want to start a GC.

When we do GC, we try to do as many files as makes sense, to make sure we
can wait quite a long time before we need to do a new GC.
2020-03-05 23:29:52 +01:00
TomZ a5a2aef53e Increase the amount of checkpoints from 5 to 15.
Now we can revert much cheaper to an earlier checkpoint it becomes much
more important that we actually keep them around to be usable.
2020-03-05 23:18:42 +01:00
TomZ 57080e8103 Make check command (unspentdb) more interactive
Print a list of dots to give progress report on the expensive
"checking buckets" task.
2020-03-02 16:36:26 +01:00
TomZ ec52bd5efe Make unspentdb info command support new tags 2020-03-01 17:10: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 33149dd9be Fixlets in logging 2019-06-19 16:55:55 +02:00
TomZ a1dfd1cde9 Work on installable headers 2019-06-03 10:59:33 +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 ffa9db67a3 Make lookup command look at the blockchain too 2018-09-25 00:07:00 +02:00
TomZ a28ffd18bb Write less txid's to the DB file and write shorter ones.
When pruning we sort leafs by txid / output and refrain from
writing the txid repeatedly for outputs of the same tx.
Additionally, use the fact that we only ever get to a leaf via
a bucket and since the first 64 bits of a txid is there, skip
repeating them when writing to disk.
Last, make pruning have different strategies.

This should shrink the utxo by about 40%
2018-09-24 21:24:28 +02:00
TomZ 02a7c1d2f6 Refactor pruner to lib from DBA tools 2018-09-20 22:03:44 +02:00
TomZ c55c5ebe32 make lookup command a bit more useful. 2018-09-20 21:55:07 +02:00
TomZ fb6b7f562d Add CLI command Lookup (for the utxo) 2018-09-20 21:55:07 +02:00
TomZ 087f2aa61e Add export command 2018-09-20 21:55:07 +02:00
TomZ 41771b8060 Finish up check command 2018-09-20 21:55:07 +02:00
TomZ 9a8bc78700 Move common code to the baseclass and start Check command 2018-09-20 21:55:07 +02:00
TomZ bf370f121d Make pruning work 2018-09-20 21:55:07 +02:00
TomZ 6c0f39317f Copy some data in the prune command 2018-09-20 21:55:07 +02:00
TomZ 44d7dae89a Start prune command 2018-09-20 21:55:07 +02:00
TomZ 067c196a81 Add -v option to show bucket usage. 2018-09-20 21:55:07 +02:00
TomZ da90708d7f Implement proper expansion of files. 2018-09-20 21:55:07 +02:00
TomZ f81fea1a89 Add InfoCommand to show details of an info file 2018-09-20 21:55:07 +02:00
TomZ 73cb23da3d start new tool 2018-09-20 21:55:07 +02:00