6 #if defined(HAVE_CONFIG_H) 46 static void WaitForShutdown()
59 static bool AppInit(
int argc,
char* argv[])
70 fprintf(stderr,
"Error parsing command line arguments: %s\n",
error.c_str());
84 strUsage +=
"\nUsage: bsha3d [options] Start " PACKAGE_NAME " Daemon\n";
88 fprintf(stdout,
"%s", strUsage.c_str());
96 fprintf(stderr,
"Error: Specified data directory \"%s\" does not exist.\n",
gArgs.
GetArg(
"-datadir",
"").c_str());
100 fprintf(stderr,
"Error reading configuration file: %s\n",
error.c_str());
106 }
catch (
const std::exception& e) {
107 fprintf(stderr,
"Error: %s\n", e.what());
112 for (
int i = 1; i < argc; i++) {
114 fprintf(stderr,
"Error: Command line contains unexpected token '%s', see bsha3d -h for a list of options.\n", argv[i]);
143 #pragma GCC diagnostic push 144 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 146 fprintf(stdout,
"BSHA3 server starting\n");
150 fprintf(stderr,
"Error: daemon() failed: %s\n", strerror(errno));
154 #pragma GCC diagnostic pop 157 fprintf(stderr,
"Error: -daemon is not supported on this operating system\n");
159 #endif // HAVE_DECL_DAEMON 169 catch (
const std::exception& e) {
186 int main(
int argc,
char* argv[])
189 util::WinCmdLineArgs winArgs;
190 std::tie(argc, argv) = winArgs.get();
197 return (AppInit(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE);
bool ReadConfigFiles(std::string &error, bool ignore_invalid_keys=false)
bool HelpRequested(const ArgsManager &args)
bool IsArgSet(const std::string &strArg) const
Return true if the given argument has been manually set.
void InitLogging()
Initialize global loggers.
void MilliSleep(int64_t n)
bool SoftSetBoolArg(const std::string &strArg, bool fValue)
Set a boolean argument if it doesn't already have a value.
bool AppInitMain()
Bitcoin core main initialization.
void Interrupt()
Interrupt threads.
void PrintExceptionContinue(const std::exception *pex, const char *pszThread)
bool ParseParameters(int argc, const char *const argv[], std::string &error)
void noui_connect()
Connect all bsha3d signal handlers.
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
bool AppInitBasicSetup()
Initialize bitcoin core: Basic context setup.
std::string LicenseInfo()
Returns licensing information (for -version)
std::string GetHelpMessage() const
Get the help string.
void InitParameterInteraction()
Parameter interaction: change current parameters depending on various rules.
int main(int argc, char *argv[])
bool AppInitSanityChecks()
Initialization sanity checks: ecc init, sanity checks, dir lock.
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given BIP70 chain name.
const std::function< std::string(const char *)> G_TRANSLATION_FUN
Translate a message to the native language of the user.
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...
std::string FormatFullVersion()
bool AppInitParameterInteraction()
Initialization: parameter interaction.
bool IsSwitchChar(char c)
void SetupServerArgs()
Setup the arguments for gArgs.
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
bool error(const char *fmt, const Args &... args)
std::string GetChainName() const
Looks for -regtest, -testnet and returns the appropriate BIP70 chain name.
const fs::path & GetDataDir(bool fNetSpecific)
bool AppInitLockDataDirectory()
Lock bitcoin core data directory.