6 #if defined(HAVE_CONFIG_H) 23 #include <boost/thread.hpp> 55 threadGroup->join_all();
65 boost::thread_group threadGroup;
87 strUsage +=
"\n" +
_(
"Usage:") +
"\n" +
93 fprintf(stdout,
"%s", strUsage.c_str());
101 fprintf(stderr,
"Error: Specified data directory \"%s\" does not exist.\n",
gArgs.
GetArg(
"-datadir",
"").c_str());
107 }
catch (
const std::exception&
e) {
108 fprintf(stderr,
"Error reading configuration file: %s\n", e.what());
114 }
catch (
const std::exception& e) {
115 fprintf(stderr,
"Error: %s\n", e.what());
120 for (
int i = 1; i < argc; i++) {
122 fprintf(stderr,
"Error: Command line contains unexpected token '%s', see fabcoind -h for a list of options.\n", argv[i]);
150 fprintf(stdout,
"Fabcoin server starting\n");
154 fprintf(stderr,
"Error: daemon() failed: %s\n", strerror(errno));
158 fprintf(stderr,
"Error: -daemon is not supported on this operating system\n");
160 #endif // HAVE_DECL_DAEMON 170 catch (
const std::exception&
e) {
179 threadGroup.join_all();
188 int main(
int argc,
char* argv[])
195 return (
AppInit(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE);
void ParseParameters(int argc, const char *const argv[])
void InitLogging()
Initialize the logging infrastructure.
void MilliSleep(int64_t n)
bool IsArgSet(const std::string &strArg)
Return true if the given argument has been manually set.
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)
Return boolean argument or default value.
int main(int argc, char *argv[])
void PrintExceptionContinue(const std::exception *pex, const char *pszThread)
bool AppInitBasicSetup()
Initialize fabcoin core: Basic context setup.
std::string LicenseInfo()
Returns licensing information (for -version)
void ReadConfigFile(const std::string &confPath)
std::string HelpMessage(HelpMessageMode mode)
Help for options shared between UI and daemon (for -help)
void InitParameterInteraction()
Parameter interaction: change current parameters depending on various rules.
bool AppInitSanityChecks()
Initialization sanity checks: ecc init, sanity checks, dir lock.
const char *const FABCOIN_CONF_FILENAME
void Interrupt(boost::thread_group &threadGroup)
Interrupt threads.
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given BIP70 chain name.
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 AppInit(int argc, char *argv[])
bool IsSwitchChar(char c)
std::string GetArg(const std::string &strArg, const std::string &strDefault)
Return string argument or default value.
std::string ChainNameFromCommandLine()
Looks for -regtest, -testnet and returns the appropriate BIP70 chain name.
void WaitForShutdown(boost::thread_group *threadGroup)
const fs::path & GetDataDir(bool fNetSpecific)
bool AppInitLockDataDirectory()
Lock fabcoin core data directory.
bool AppInitMain(boost::thread_group &threadGroup, CScheduler &scheduler)
Fabcoin core main initialization.
std::string _(const char *psz)
Translation function: Call Translate signal on UI interface, which returns a boost::optional result...