8 #if defined(HAVE_CONFIG_H)
68 strUsage +=
"\nUsage: pivxd [options] Start " PACKAGE_NAME " Daemon\n";
72 fprintf(stdout,
"%s", strUsage.c_str());
78 fprintf(stderr,
"Error: Specified data directory \"%s\" does not exist.\n",
gArgs.
GetArg(
"-datadir",
"").c_str());
83 }
catch (
const std::exception& e) {
84 fprintf(stderr,
"Error reading configuration file: %s\n", e.what());
90 }
catch(
const std::exception& e) {
91 fprintf(stderr,
"Error: %s\n", e.what());
96 for (
int i = 1; i < argc; i++) {
98 fprintf(stderr,
"Error: Command line contains unexpected token '%s', see pivxd -h for a list of options.\n",
argv[i]);
123 fprintf(stdout,
"PIVX server starting\n");
128 fprintf(stderr,
"Error: fork() returned %d errno %d\n", pid, errno);
137 pid_t sid = setsid();
139 fprintf(stderr,
"Error: setsid() returned %d errno %d\n", sid, errno);
145 }
catch (
const std::exception& e) {
164 util::WinCmdLineArgs winArgs;
165 std::tie(argc,
argv) = winArgs.get();
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given chain name.
void ReadConfigFile(const std::string &confPath)
void ParseParameters(int argc, const char *const argv[])
bool IsArgSet(const std::string &strArg) const
Return true if the given argument has been manually set.
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
bool SoftSetBoolArg(const std::string &strArg, bool fValue)
Set a boolean argument if it doesn't already have a value.
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
std::string GetChainName() const
Looks for -regtest, -testnet and returns the appropriate BIP70 chain name.
std::string FormatFullVersion()
void InitParameterInteraction()
Parameter interaction: change current parameters depending on various rules.
bool AppInitMain()
Bitcoin core main initialization.
std::string HelpMessage(HelpMessageMode mode)
Help for options shared between UI and daemon (for -help)
bool AppInitParameterInteraction()
Initialization: parameter interaction.
bool AppInitBasicSetup()
Initialize PIVX core: Basic context setup.
bool AppInitSanityChecks()
Initialization sanity checks: ecc init, sanity checks, dir lock.
void InitLogging()
Initialize the logging infrastructure.
void Interrupt()
Interrupt threads.
std::string LicenseInfo()
Returns licensing information (for -version)
int main(int argc, char *argv[])
bool AppInit(int argc, char *argv[])
const char *const PIVX_CONF_FILENAME
bool CheckDataDirOption()
void PrintExceptionContinue(const std::exception *pex, const char *pszThread)
bool IsSwitchChar(char c)
void MilliSleep(int64_t n)