Bitcoin Core 32.99.0
P2P Digital Currency
Namespaces | Functions | Variables
init.h File Reference
#include <atomic>
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

namespace  interfaces
 
namespace  kernel
 
namespace  node
 

Functions

void InitContext (node::NodeContext &node)
 Initialize node context shutdown and args variables. More...
 
bool ShutdownRequested (node::NodeContext &node)
 Return whether node shutdown was requested. More...
 
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, std::atomic< int > &exit_status)
 Initialize bitcoin core: Basic context setup. More...
 
bool AppInitParameterInteraction (const ArgsManager &args)
 Initialization: parameter interaction. More...
 
bool AppInitSanityChecks (const kernel::Context &kernel)
 Initialization sanity checks. More...
 
bool AppInitLockDirectories ()
 Lock bitcoin core critical directories. More...
 
bool AppInitInterfaces (node::NodeContext &node)
 Initialize node and wallet interface pointers. More...
 
bool AppInitMain (node::NodeContext &node, interfaces::BlockAndHeaderTipInfo *tip_info=nullptr)
 Bitcoin core main initialization. More...
 
void SetupServerArgs (ArgsManager &argsman, bool can_listen_ipc=false)
 Register all arguments with the ArgsManager. More...
 
bool StartIndexBackgroundSync (node::NodeContext &node)
 Validates requirements to run the indexes and spawns each index initial sync thread. More...
 

Variables

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

Function Documentation

◆ AppInitBasicSetup()

bool AppInitBasicSetup ( const ArgsManager &  args,
std::atomic< int > &  exit_status 
)

Initialize bitcoin core: 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 909 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 1303 of file init.cpp.

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

◆ AppInitLockDirectories()

bool AppInitLockDirectories ( )

Lock bitcoin core critical directories.

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

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

◆ AppInitMain()

bool AppInitMain ( node::NodeContext &  node,
interfaces::BlockAndHeaderTipInfo *  tip_info = nullptr 
)

Bitcoin core main initialization.

Note
This should only be done after daemonization. Call Shutdown() if this function fails.
Precondition
Parameters should be parsed and config file should be read, AppInitLockDirectories should have been called.

Definition at line 1519 of file init.cpp.

Here is the caller graph for this function:

◆ AppInitParameterInteraction()

bool AppInitParameterInteraction ( 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 946 of file init.cpp.

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

◆ AppInitSanityChecks()

bool AppInitSanityChecks ( const kernel::Context &  kernel)

Initialization sanity checks.

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

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

◆ InitContext()

void InitContext ( node::NodeContext &  node)

Initialize node context shutdown and args variables.

Definition at line 233 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 880 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 791 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 288 of file init.cpp.

Here is the call graph for this function:

◆ SetupServerArgs()

void SetupServerArgs ( ArgsManager &  argsman,
bool  can_listen_ipc = false 
)

Register all arguments with the ArgsManager.

Definition at line 479 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 310 of file init.cpp.

Here is the call graph for this function:

◆ ShutdownRequested()

bool ShutdownRequested ( node::NodeContext &  node)

Return whether node shutdown was requested.

Definition at line 270 of file init.cpp.

◆ StartIndexBackgroundSync()

bool StartIndexBackgroundSync ( node::NodeContext &  node)

Validates requirements to run the indexes and spawns each index initial sync thread.

Definition at line 2455 of file init.cpp.

Here is the call graph for this function:

Variable Documentation

◆ DEFAULT_DAEMON

constexpr bool DEFAULT_DAEMON = false
inlineconstexpr

Default value for -daemon option.

Definition at line 12 of file init.h.

◆ DEFAULT_DAEMONWAIT

constexpr bool DEFAULT_DAEMONWAIT = false
inlineconstexpr

Default value for -daemonwait option.

Definition at line 14 of file init.h.