Bitcoin ABC  0.26.3
P2P Digital Currency
Namespaces | Functions | Variables
init.h File Reference
#include <util/system.h>
#include <memory>
#include <string>
Include dependency graph for init.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 interfaces
 
 node
 

Functions

void Interrupt (node::NodeContext &node)
 Interrupt threads. More...
 
void Shutdown (node::NodeContext &node)
 
void InitLogging (const ArgsManager &args)
 Initialize the logging infrastructure. More...
 
void InitParameterInteraction (ArgsManager &args)
 Parameter interaction: change current parameters depending on various rules. More...
 
bool AppInitBasicSetup (const ArgsManager &args)
 Initialize bitcoin: Basic context setup. More...
 
bool AppInitParameterInteraction (Config &config, const ArgsManager &args)
 Initialization: parameter interaction. More...
 
bool AppInitSanityChecks ()
 Initialization sanity checks: ecc init, sanity checks, dir lock. More...
 
bool AppInitLockDataDirectory ()
 Lock bitcoin data directory. More...
 
bool AppInitInterfaces (node::NodeContext &node)
 Initialize node and wallet interface pointers. More...
 
bool AppInitMain (Config &config, RPCServer &rpcServer, HTTPRPCRequestProcessor &httpRPCRequestProcessor, node::NodeContext &node, interfaces::BlockAndHeaderTipInfo *tip_info=nullptr)
 Bitcoin main initialization. More...
 
void SetupServerArgs (node::NodeContext &node)
 Register all arguments with the ArgsManager. More...
 
std::string LicenseInfo ()
 Returns licensing information (for -version) More...
 

Variables

static constexpr bool DEFAULT_DAEMON = false
 Default value for -daemon option. More...
 
static constexpr bool DEFAULT_DAEMONWAIT = false
 Default value for -daemonwait option. More...
 

Function Documentation

◆ AppInitBasicSetup()

bool AppInitBasicSetup ( const ArgsManager args)

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 1668 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AppInitInterfaces()

bool AppInitInterfaces ( node::NodeContext node)

Initialize node and wallet interface pointers.

Has no prerequisites or side effects besides allocating memory.

Definition at line 2044 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 2032 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AppInitMain()

bool AppInitMain ( Config config,
RPCServer rpcServer,
HTTPRPCRequestProcessor httpRPCRequestProcessor,
node::NodeContext node,
interfaces::BlockAndHeaderTipInfo tip_info = nullptr 
)

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 2054 of file init.cpp.

Here is the caller graph for this function:

◆ AppInitParameterInteraction()

bool AppInitParameterInteraction ( Config config,
const ArgsManager args 
)

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 1715 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 2014 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitLogging()

void InitLogging ( const ArgsManager args)

Initialize the logging infrastructure.

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 1641 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitParameterInteraction()

void InitParameterInteraction ( ArgsManager args)

Parameter interaction: change current parameters depending on various rules.

Definition at line 1507 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Interrupt()

void Interrupt ( node::NodeContext node)

Interrupt threads.

Definition at line 192 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LicenseInfo()

std::string LicenseInfo ( )

Returns licensing information (for -version)

Definition at line 1426 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetupServerArgs()

void SetupServerArgs ( node::NodeContext node)

Register all arguments with the ArgsManager.

Definition at line 414 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Shutdown()

void Shutdown ( node::NodeContext node)

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 216 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ DEFAULT_DAEMON

constexpr bool DEFAULT_DAEMON = false
staticconstexpr

Default value for -daemon option.

Definition at line 16 of file init.h.

◆ DEFAULT_DAEMONWAIT

constexpr bool DEFAULT_DAEMONWAIT = false
staticconstexpr

Default value for -daemonwait option.

Definition at line 18 of file init.h.