#include <init.h>
#include <addrman.h>
#include <amount.h>
#include <avalanche/processor.h>
#include <banman.h>
#include <blockdb.h>
#include <blockfilter.h>
#include <chain.h>
#include <chainparams.h>
#include <checkpoints.h>
#include <compat/sanity.h>
#include <config.h>
#include <consensus/validation.h>
#include <flatfile.h>
#include <fs.h>
#include <hash.h>
#include <httprpc.h>
#include <httpserver.h>
#include <index/blockfilterindex.h>
#include <index/txindex.h>
#include <interfaces/chain.h>
#include <key.h>
#include <miner.h>
#include <net.h>
#include <net_permissions.h>
#include <net_processing.h>
#include <netbase.h>
#include <network.h>
#include <node/context.h>
#include <node/ui_interface.h>
#include <policy/mempool.h>
#include <policy/policy.h>
#include <policy/settings.h>
#include <rpc/blockchain.h>
#include <rpc/register.h>
#include <rpc/server.h>
#include <rpc/util.h>
#include <scheduler.h>
#include <script/scriptcache.h>
#include <script/sigcache.h>
#include <script/standard.h>
#include <shutdown.h>
#include <timedata.h>
#include <torcontrol.h>
#include <txdb.h>
#include <txmempool.h>
#include <util/asmap.h>
#include <util/check.h>
#include <util/moneystr.h>
#include <util/threadnames.h>
#include <util/translation.h>
#include <validation.h>
#include <validationinterface.h>
#include <walletinitinterface.h>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/signals2/signal.hpp>
#include <boost/thread.hpp>
#include <attributes.h>
#include <cerrno>
#include <csignal>
#include <sys/stat.h>
#include <cstdint>
#include <cstdio>
#include <functional>
#include <set>
Go to the source code of this file.
|
static fs::path | GetPidFile (const ArgsManager &args) |
|
static NODISCARD bool | CreatePidFile (const ArgsManager &args) |
|
void | Interrupt (NodeContext &node) |
| Interrupt threads. More...
|
|
void | Shutdown (NodeContext &node) |
|
static void | HandleSIGTERM (int) |
| Signal handlers are very limited in what they are allowed to do. More...
|
|
static void | HandleSIGHUP (int) |
|
static void | registerSignalHandler (int signal, void(*handler)(int)) |
|
static void | OnRPCStarted () |
|
static void | OnRPCStopped () |
|
void | SetupServerArgs (NodeContext &node) |
| Register all arguments with the ArgsManager. More...
|
|
std::string | LicenseInfo () |
| Returns licensing information (for -version) More...
|
|
static void | BlockNotifyGenesisWait (const CBlockIndex *pBlockIndex) |
|
static void | CleanupBlockRevFiles () |
|
static void | ThreadImport (const Config &config, ChainstateManager &chainman, std::vector< fs::path > vImportFiles, const ArgsManager &args) |
|
static bool | InitSanityCheck () |
| Sanity checks Ensure that Bitcoin is running in a usable environment with all necessary library support. More...
|
|
static bool | AppInitServers (Config &config, HTTPRPCRequestProcessor &httpRPCRequestProcessor, NodeContext &node) |
|
void | InitParameterInteraction (ArgsManager &args) |
| Parameter interaction: change current parameters depending on various rules. More...
|
|
void | InitLogging (const ArgsManager &args) |
| Initialize global loggers. More...
|
|
static void | new_handler_terminate () |
|
bool | AppInitBasicSetup (ArgsManager &args) |
| Initialize bitcoin: Basic context setup. More...
|
|
bool | AppInitParameterInteraction (Config &config, const ArgsManager &args) |
| Initialization: parameter interaction. More...
|
|
static bool | LockDataDirectory (bool probeOnly) |
|
bool | AppInitSanityChecks () |
| Initialization sanity checks: ecc init, sanity checks, dir lock. More...
|
|
bool | AppInitLockDataDirectory () |
| Lock bitcoin data directory. More...
|
|
bool | AppInitMain (Config &config, RPCServer &rpcServer, HTTPRPCRequestProcessor &httpRPCRequestProcessor, NodeContext &node) |
| Bitcoin main initialization. More...
|
|
◆ MIN_CORE_FILEDESCRIPTORS
#define MIN_CORE_FILEDESCRIPTORS 150 |
◆ AppInitBasicSetup()
Initialize bitcoin: Basic context setup.
- Note
- This can be done before daemonization. Do not call Shutdown() if this function fails.
- Precondition
- Parameters should be parsed and config file should be read.
Definition at line 1656 of file init.cpp.
◆ AppInitLockDataDirectory()
bool AppInitLockDataDirectory |
( |
| ) |
|
Lock bitcoin data directory.
- Note
- This should only be done after daemonization. Do not call Shutdown() if this function fails.
- Precondition
- Parameters should be parsed and config file should be read, AppInitSanityChecks should have been called.
Definition at line 2088 of file init.cpp.
◆ AppInitMain()
Bitcoin main initialization.
- Note
- This should only be done after daemonization.
- Precondition
- Parameters should be parsed and config file should be read, AppInitLockDataDirectory should have been called.
Register RPC commands regardless of -server setting so they will be available in the GUI RPC console even if external calls are disabled.
Start the RPC server. It will be started in "warmup" mode and not process calls yet (but it will verify that the server is there and will be ready later). Warmup mode will be completed when initialisation is finished.
Definition at line 2100 of file init.cpp.
◆ AppInitParameterInteraction()
Initialization: parameter interaction.
- Note
- This can be done before daemonization. Do not call Shutdown() if this function fails.
- Precondition
- Parameters should be parsed and config file should be read, AppInitBasicSetup should have been called.
Definition at line 1699 of file init.cpp.
◆ AppInitSanityChecks()
bool AppInitSanityChecks |
( |
| ) |
|
Initialization sanity checks: ecc init, sanity checks, dir lock.
- Note
- This can be done before daemonization. Do not call Shutdown() if this function fails.
- Precondition
- Parameters should be parsed and config file should be read, AppInitParameterInteraction should have been called.
Definition at line 2065 of file init.cpp.
◆ AppInitServers()
◆ BlockNotifyGenesisWait()
static void BlockNotifyGenesisWait |
( |
const CBlockIndex * |
pBlockIndex | ) |
|
|
static |
◆ CleanupBlockRevFiles()
static void CleanupBlockRevFiles |
( |
| ) |
|
|
static |
◆ CreatePidFile()
◆ GetPidFile()
◆ HandleSIGHUP()
static void HandleSIGHUP |
( |
int |
| ) |
|
|
static |
◆ HandleSIGTERM()
static void HandleSIGTERM |
( |
int |
| ) |
|
|
static |
Signal handlers are very limited in what they are allowed to do.
The execution context the handler is invoked in is not guaranteed, so we restrict handler operations to just touching variables:
Definition at line 338 of file init.cpp.
◆ InitLogging()
Initialize global loggers.
Initialize the logging infrastructure.
Note that this is called very early in the process lifetime, so you should be careful about what global state you rely on here.
Definition at line 1609 of file init.cpp.
◆ InitParameterInteraction()
Parameter interaction: change current parameters depending on various rules.
Definition at line 1497 of file init.cpp.
◆ InitSanityCheck()
static bool InitSanityCheck |
( |
| ) |
|
|
static |
Sanity checks Ensure that Bitcoin is running in a usable environment with all necessary library support.
Definition at line 1454 of file init.cpp.
◆ Interrupt()
Interrupt threads.
Definition at line 157 of file init.cpp.
◆ LicenseInfo()
std::string LicenseInfo |
( |
| ) |
|
Returns licensing information (for -version)
Definition at line 1245 of file init.cpp.
◆ LockDataDirectory()
static bool LockDataDirectory |
( |
bool |
probeOnly | ) |
|
|
static |
◆ new_handler_terminate()
static void new_handler_terminate |
( |
| ) |
|
|
static |
◆ OnRPCStarted()
static void OnRPCStarted |
( |
| ) |
|
|
static |
◆ OnRPCStopped()
static void OnRPCStopped |
( |
| ) |
|
|
static |
◆ registerSignalHandler()
static void registerSignalHandler |
( |
int |
signal, |
|
|
void(*)(int) |
handler |
|
) |
| |
|
static |
◆ SetupServerArgs()
◆ Shutdown()
Note: Shutdown() must be able to handle cases in which initialization failed part of the way, for example if the data directory was found to be locked. Be sure that anything that writes files or flushes caches only does this if the respective module was initialized.
Definition at line 178 of file init.cpp.
◆ ThreadImport()
◆ BITCOIN_PID_FILENAME
const char* BITCOIN_PID_FILENAME = "bitcoind.pid" |
|
static |
The PID file facilities.
Definition at line 106 of file init.cpp.
◆ DEFAULT_ASMAP_FILENAME
const char* DEFAULT_ASMAP_FILENAME = "ip_asn.map" |
|
static |
◆ DEFAULT_PROXYRANDOMIZE
const bool DEFAULT_PROXYRANDOMIZE = true |
|
static |
◆ DEFAULT_REST_ENABLE
const bool DEFAULT_REST_ENABLE = false |
|
static |
◆ DEFAULT_STOPAFTERBLOCKIMPORT
const bool DEFAULT_STOPAFTERBLOCKIMPORT = false |
|
static |
◆ fHaveGenesis
bool fHaveGenesis = false |
|
static |
◆ g_genesis_wait_cv
std::condition_variable g_genesis_wait_cv |
|
static |
◆ g_genesis_wait_mutex
Mutex g_genesis_wait_mutex |
|
static |
◆ globalVerifyHandle
◆ rpc_notify_block_change_connection
boost::signals2::connection rpc_notify_block_change_connection |
|
static |
◆ threadGroup
boost::thread_group threadGroup |
|
static |