6 #if defined(HAVE_CONFIG_H)
40 static bool AppInit(
int argc,
char* argv[])
63 strUsage +=
"\nUsage: bitcoind [options] Start " PACKAGE_NAME "\n";
83 }
catch (
const std::exception& e) {
88 for (
int i = 1; i < argc; i++) {
120 #pragma GCC diagnostic push
121 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
130 #pragma GCC diagnostic pop
134 #endif // HAVE_DECL_DAEMON
144 catch (
const std::exception& e) {
161 int main(
int argc,
char* argv[])
164 util::WinCmdLineArgs winArgs;
165 std::tie(argc, argv) = winArgs.get();
172 return (
AppInit(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE);
NODISCARD bool ReadConfigFiles(std::string &error, bool ignore_invalid_keys=false)
std::string FormatParagraph(const std::string &in, size_t width, size_t indent)
Format a paragraph of text to a fixed width, adding spaces for indentation to any added line...
void InitLogging(const ArgsManager &args)
Initialize global loggers.
bool SoftSetBoolArg(const std::string &strArg, bool fValue)
Set a boolean argument if it doesn't already have a value.
void Shutdown(NodeContext &node)
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
bilingual_str Untranslated(std::string original)
Mark a bilingual_str as untranslated.
NODISCARD bool ParseParameters(int argc, const char *const argv[], std::string &error)
void noui_connect()
Connect all bitcoind signal handlers.
const std::function< std::string(const char *)> G_TRANSLATION_FUN
Translate string to current locale using Qt.
std::string LicenseInfo()
Returns licensing information (for -version)
void SetupServerArgs(NodeContext &node)
Register all arguments with the ArgsManager.
int main(int argc, char *argv[])
bool CheckDataDirOption()
bool IsArgSet(const std::string &strArg) const
Return true if the given argument has been manually set.
bool AppInitSanityChecks()
Initialization sanity checks: ecc init, sanity checks, dir lock.
bool error(const char *fmt, const Args &...args)
NodeContext struct containing references to chain state and connection state.
void Interrupt(NodeContext &node)
Interrupt threads.
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given chain name.
bool HelpRequested(const ArgsManager &args)
bool InitError(const bilingual_str &str)
Show error message.
static bool AppInit(int argc, char *argv[])
void PrintExceptionContinue(const std::exception *pex, const char *pszThread)
std::string FormatFullVersion()
Type-safe dynamic reference.
void ThreadSetInternalName(std::string &&)
Set the internal (in-memory) name of the current thread only.
bool AppInitParameterInteraction(const ArgsManager &args)
Initialization: parameter interaction.
bool InitSettings(std::string &error)
Read and update settings file with saved settings.
void UninterruptibleSleep(const std::chrono::microseconds &n)
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
std::string GetHelpMessage() const
Get the help string.
bool AppInitBasicSetup(ArgsManager &args)
Initialize bitcoin core: Basic context setup.
std::string GetChainName() const
Returns the appropriate chain name from the program arguments.
bool IsSwitchChar(char c)
bool AppInitInterfaces(NodeContext &node)
Initialize node and wallet interface pointers.
bool AppInitLockDataDirectory()
Lock bitcoin core data directory.
bool AppInitMain(const util::Ref &context, NodeContext &node, interfaces::BlockAndHeaderTipInfo *tip_info)
Bitcoin core main initialization.
static void WaitForShutdown(NodeContext &node)
UrlDecodeFn *const URL_DECODE
void InitParameterInteraction(ArgsManager &args)
Parameter interaction: change current parameters depending on various rules.
#define Assert(val)
Identity function.
std::string(const std::string &url_encoded) UrlDecodeFn