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 \
|
kernel/bitcoinkernel.cpp \
|
||||||
arith_uint256.cpp \
|
arith_uint256.cpp \
|
||||||
chain.cpp \
|
chain.cpp \
|
||||||
chainparamsbase.cpp \
|
|
||||||
chainparams.cpp \
|
|
||||||
clientversion.cpp \
|
clientversion.cpp \
|
||||||
coins.cpp \
|
coins.cpp \
|
||||||
common/args.cpp \
|
|
||||||
common/config.cpp \
|
|
||||||
compressor.cpp \
|
compressor.cpp \
|
||||||
consensus/merkle.cpp \
|
consensus/merkle.cpp \
|
||||||
consensus/tx_check.cpp \
|
consensus/tx_check.cpp \
|
||||||
|
@ -978,7 +974,6 @@ libbitcoinkernel_la_SOURCES = \
|
||||||
util/moneystr.cpp \
|
util/moneystr.cpp \
|
||||||
util/rbf.cpp \
|
util/rbf.cpp \
|
||||||
util/serfloat.cpp \
|
util/serfloat.cpp \
|
||||||
util/settings.cpp \
|
|
||||||
util/strencodings.cpp \
|
util/strencodings.cpp \
|
||||||
util/string.cpp \
|
util/string.cpp \
|
||||||
util/syscall_sandbox.cpp \
|
util/syscall_sandbox.cpp \
|
||||||
|
|
|
@ -17,8 +17,6 @@
|
||||||
#include <kernel/context.h>
|
#include <kernel/context.h>
|
||||||
#include <kernel/validation_cache_sizes.h>
|
#include <kernel/validation_cache_sizes.h>
|
||||||
|
|
||||||
#include <chainparams.h>
|
|
||||||
#include <common/args.h>
|
|
||||||
#include <consensus/validation.h>
|
#include <consensus/validation.h>
|
||||||
#include <core_io.h>
|
#include <core_io.h>
|
||||||
#include <node/blockstorage.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::path abs_datadir = std::filesystem::absolute(argv[1]);
|
||||||
std::filesystem::create_directories(abs_datadir);
|
std::filesystem::create_directories(abs_datadir);
|
||||||
gArgs.ForceSetArg("-datadir", abs_datadir.string());
|
|
||||||
|
|
||||||
|
|
||||||
// SETUP: Misc Globals
|
// SETUP: Context
|
||||||
SelectParams(ChainType::MAIN);
|
|
||||||
auto chainparams = CChainParams::Main();
|
|
||||||
|
|
||||||
kernel::Context kernel_context{};
|
kernel::Context kernel_context{};
|
||||||
// We can't use a goto here, but we can use an assert since none of the
|
// 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
|
// 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>();
|
auto notifications = std::make_unique<KernelNotifications>();
|
||||||
|
|
||||||
|
|
||||||
// SETUP: Chainstate
|
// SETUP: Chainstate
|
||||||
|
auto chainparams = CChainParams::Main();
|
||||||
const ChainstateManager::Options chainman_opts{
|
const ChainstateManager::Options chainman_opts{
|
||||||
.chainparams = *chainparams,
|
.chainparams = *chainparams,
|
||||||
.datadir = gArgs.GetDataDirNet(),
|
.datadir = abs_datadir,
|
||||||
.adjusted_time_callback = NodeClock::now,
|
.adjusted_time_callback = NodeClock::now,
|
||||||
.notifications = *notifications,
|
.notifications = *notifications,
|
||||||
};
|
};
|
||||||
const node::BlockManager::Options blockman_opts{
|
const node::BlockManager::Options blockman_opts{
|
||||||
.chainparams = chainman_opts.chainparams,
|
.chainparams = chainman_opts.chainparams,
|
||||||
.blocks_dir = gArgs.GetBlocksDirPath(),
|
.blocks_dir = abs_datadir / "blocks",
|
||||||
};
|
};
|
||||||
ChainstateManager chainman{chainman_opts, blockman_opts};
|
ChainstateManager chainman{chainman_opts, blockman_opts};
|
||||||
|
|
||||||
|
@ -148,7 +144,8 @@ int main(int argc, char* argv[])
|
||||||
// Main program logic starts here
|
// Main program logic starts here
|
||||||
std::cout
|
std::cout
|
||||||
<< "Hello! I'm going to print out some information about your datadir." << std::endl
|
<< "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());
|
LOCK(chainman.GetMutex());
|
||||||
std::cout
|
std::cout
|
||||||
|
|
Loading…
Add table
Reference in a new issue