mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-03 09:56:38 -05:00
kernel: Remove chainparams, chainparamsbase, args, settings from kernel library
This commit is contained in:
parent
05870b1c92
commit
c2dae5d7d8
2 changed files with 7 additions and 15 deletions
|
@ -912,12 +912,8 @@ libbitcoinkernel_la_SOURCES = \
|
|||
kernel/bitcoinkernel.cpp \
|
||||
arith_uint256.cpp \
|
||||
chain.cpp \
|
||||
chainparamsbase.cpp \
|
||||
chainparams.cpp \
|
||||
clientversion.cpp \
|
||||
coins.cpp \
|
||||
common/args.cpp \
|
||||
common/config.cpp \
|
||||
compressor.cpp \
|
||||
consensus/merkle.cpp \
|
||||
consensus/tx_check.cpp \
|
||||
|
@ -978,7 +974,6 @@ libbitcoinkernel_la_SOURCES = \
|
|||
util/moneystr.cpp \
|
||||
util/rbf.cpp \
|
||||
util/serfloat.cpp \
|
||||
util/settings.cpp \
|
||||
util/strencodings.cpp \
|
||||
util/string.cpp \
|
||||
util/syscall_sandbox.cpp \
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
#include <kernel/context.h>
|
||||
#include <kernel/validation_cache_sizes.h>
|
||||
|
||||
#include <chainparams.h>
|
||||
#include <common/args.h>
|
||||
#include <consensus/validation.h>
|
||||
#include <core_io.h>
|
||||
#include <node/blockstorage.h>
|
||||
|
@ -53,13 +51,9 @@ int main(int argc, char* argv[])
|
|||
}
|
||||
std::filesystem::path abs_datadir = std::filesystem::absolute(argv[1]);
|
||||
std::filesystem::create_directories(abs_datadir);
|
||||
gArgs.ForceSetArg("-datadir", abs_datadir.string());
|
||||
|
||||
|
||||
// SETUP: Misc Globals
|
||||
SelectParams(ChainType::MAIN);
|
||||
auto chainparams = CChainParams::Main();
|
||||
|
||||
// SETUP: Context
|
||||
kernel::Context kernel_context{};
|
||||
// We can't use a goto here, but we can use an assert since none of the
|
||||
// things instantiated so far requires running the epilogue to be torn down
|
||||
|
@ -106,16 +100,18 @@ int main(int argc, char* argv[])
|
|||
};
|
||||
auto notifications = std::make_unique<KernelNotifications>();
|
||||
|
||||
|
||||
// SETUP: Chainstate
|
||||
auto chainparams = CChainParams::Main();
|
||||
const ChainstateManager::Options chainman_opts{
|
||||
.chainparams = *chainparams,
|
||||
.datadir = gArgs.GetDataDirNet(),
|
||||
.datadir = abs_datadir,
|
||||
.adjusted_time_callback = NodeClock::now,
|
||||
.notifications = *notifications,
|
||||
};
|
||||
const node::BlockManager::Options blockman_opts{
|
||||
.chainparams = chainman_opts.chainparams,
|
||||
.blocks_dir = gArgs.GetBlocksDirPath(),
|
||||
.blocks_dir = abs_datadir / "blocks",
|
||||
};
|
||||
ChainstateManager chainman{chainman_opts, blockman_opts};
|
||||
|
||||
|
@ -148,7 +144,8 @@ int main(int argc, char* argv[])
|
|||
// Main program logic starts here
|
||||
std::cout
|
||||
<< "Hello! I'm going to print out some information about your datadir." << std::endl
|
||||
<< "\t" << "Path: " << gArgs.GetDataDirNet() << std::endl;
|
||||
<< "\t"
|
||||
<< "Path: " << abs_datadir << std::endl;
|
||||
{
|
||||
LOCK(chainman.GetMutex());
|
||||
std::cout
|
||||
|
|
Loading…
Add table
Reference in a new issue