oxen-core/src/blockchain_utilities
Jason Rhinelander 5b97ff6e9c cmake modernization
The archaic (i.e. decade old) cmake usage here really got in the way of
trying to properly use newer libraries (like lokimq), so this undertakes
overhauling it considerably to make it much more sane (and significantly
reduce the size).

I left more of the architecture-specific bits in the top-level
CMakeLists.txt intact; most of the efforts here are about properly
loading dependencies, specifying dependencies and avoiding a whole pile
of cmake antipatterns.

This bumps the required cmake version to 3.5, which is what xenial comes
with.

- extensive use of interface libraries to include libraries,
definitions, and include paths

- use Boost::whatever instead of ${Boost_WHATEVER_LIBRARY}.  The
interface targets are (again) much better as they also give you any
needed include or linking flags without needing to worry about them.

- don't list header files when building things.  This has *never* been
correct cmake usage (cmake has always known how to wallet_rpc_headers
the headers that .cpp files include to know about build changes).

- remove the loki_add_library monstrosity; it breaks target names and
makes compiling less efficient because the author couldn't figure out
how to link things together.

- make loki_add_executable take the output filename, and set the output
path to bin/ and install to bin because *every single usage* of
loki_add_executable was immediately followed by setting the output
filename and setting the output path to bin/ and installing to bin.

- move a bunch of crap that is only used in one particular
src/whatever/CMakeLists.txt into that particular CMakeLists.txt instead
of the top level CMakeLists.txt (or src/CMakeLists.txt).

- Remove a bunch of redundant dependencies; most of them look like they
were just copy-and-pasted in, and many more aren't needed (since they
are implied by the PUBLIC linking of other dependencies).

- Removed `die` since it just does a FATAL_ERROR, but adds color (which
is useless since CMake already makes FATAL_ERRORs perfectly visible).

- Change the way LOKI_DAEMON_AND_WALLET_ONLY works to just change the
make targets to daemon and simplewallet rather than changing the build
process (this should make it faster, too, since there are various other
things that will be excluded).
2020-03-06 00:36:57 -04:00
..
blockchain_ancestry.cpp Add support for Loki Name Service on the backend 2020-02-13 11:07:46 +11:00
blockchain_blackball.cpp Make tx type and version scoped enums 2019-06-19 17:47:03 -03:00
blockchain_depth.cpp Add support for Loki Name Service on the backend 2020-02-13 11:07:46 +11:00
blockchain_export.cpp Add support for Loki Name Service on the backend 2020-02-13 11:07:46 +11:00
blockchain_import.cpp Generic burn fee checking + blink burn fee checking 2019-11-27 14:23:56 -04:00
blockchain_objects.h Unify and move responsibility of voting to quorum_cop (#615) 2019-05-31 11:06:42 +10:00
blockchain_prune.cpp Add support for Loki Name Service on the backend 2020-02-13 11:07:46 +11:00
blockchain_prune_known_spent_data.cpp Add support for Loki Name Service on the backend 2020-02-13 11:07:46 +11:00
blockchain_stats.cpp Add support for Loki Name Service on the backend 2020-02-13 11:07:46 +11:00
blockchain_usage.cpp Add support for Loki Name Service on the backend 2020-02-13 11:07:46 +11:00
blockchain_utilities.h Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
blocksdat_file.cpp Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
blocksdat_file.h Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
bootstrap_file.cpp Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
bootstrap_file.h Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
bootstrap_serialization.h Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
CMakeLists.txt cmake modernization 2020-03-06 00:36:57 -04:00
README.md Merge commit 'e8487fa' into LokiMergeUpstream 2019-05-17 04:39:08 +10:00

Loki Blockchain Utilities

Copyright (c) 2014-2019, The Monero Project Copyright (c) 2018, The Loki Project

Introduction

The blockchain utilities allow one to import and export the blockchain.

Usage:

See also each utility's "--help" option.

Export an existing blockchain database

$ loki-blockchain-export

This loads the existing blockchain and exports it to $LOKI_DATA_DIR/export/blockchain.raw

Import the exported file

$ loki-blockchain-import

This imports blocks from $LOKI_DATA_DIR/export/blockchain.raw (exported using the loki-blockchain-export tool as described above) into the current database.

Defaults: --batch on, --batch size 20000, --verify on

Batch size refers to number of blocks and can be adjusted for performance based on available RAM.

Verification should only be turned off if importing from a trusted blockchain.

If you encounter an error like "resizing not supported in batch mode", you can just re-run the loki-blockchain-import command again, and it will restart from where it left off.

## use default settings to import blockchain.raw into database
$ loki-blockchain-import

## fast import with large batch size, database mode "fastest", verification off
$ loki-blockchain-import --batch-size 20000 --database lmdb#fastest --verify off

Import options

--input-file specifies input file path for importing

default: <data-dir>/export/blockchain.raw

--output-file specifies output file path to export to

default: <data-dir>/export/blockchain.raw

--block-stop stop at block number

--database <database type>

--database <database type>#<flag(s)>

database type: lmdb, memory

flags:

The flag after the # is interpreted as a composite mode/flag if there's only one (no comma separated arguments).

The composite mode represents multiple DB flags and support different database types:

safe, fast, fastest

Database-specific flags can be set instead.

LMDB flags (more than one may be specified):

nosync, nometasync, writemap, mapasync, nordahead

Examples:

$ loki-blockchain-import --database lmdb#fastest

$ loki-blockchain-import --database lmdb#nosync

$ loki-blockchain-import --database lmdb#nosync,nometasync