7 #if defined(HAVE_CONFIG_H) 24 #include <boost/thread.hpp> 56 threadGroup->join_all();
66 boost::thread_group threadGroup;
88 strUsage +=
"\n" +
_(
"Usage:") +
"\n" +
94 fprintf(stdout,
"%s", strUsage.c_str());
102 fprintf(stderr,
"Error: Specified data directory \"%s\" does not exist.\n",
gArgs.
GetArg(
"-datadir",
"").c_str());
108 }
catch (
const std::exception& e) {
109 fprintf(stderr,
"Error reading configuration file: %s\n", e.what());
115 }
catch (
const std::exception& e) {
116 fprintf(stderr,
"Error: %s\n", e.what());
121 for (
int i = 1; i < argc; i++) {
123 fprintf(stderr,
"Error: Command line contains unexpected token '%s', see ravend -h for a list of options.\n", argv[i]);
152 #pragma GCC diagnostic push 153 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 155 fprintf(stdout,
"Raven server starting\n");
159 fprintf(stderr,
"Error: daemon() failed: %s\n", strerror(errno));
163 #pragma GCC diagnostic pop 166 fprintf(stderr,
"Error: -daemon is not supported on this operating system\n");
168 #endif // HAVE_DECL_DAEMON 178 catch (
const std::exception& e) {
187 threadGroup.join_all();
196 int main(
int argc,
char* argv[])
203 return (
AppInit(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE);
bool IsArgSet(const std::string &strArg) const
Return true if the given argument has been manually set.
const char *const RAVEN_CONF_FILENAME
void ParseParameters(int argc, const char *const argv[])
void InitLogging()
Initialize the logging infrastructure.
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.
int main(int argc, char *argv[])
void PrintExceptionContinue(const std::exception *pex, const char *pszThread)
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
bool AppInitBasicSetup()
Initialize raven core: Basic context setup.
std::string LicenseInfo()
Returns licensing information (for -version)
void ReadConfigFile(const std::string &confPath)
void WaitForShutdown(boost::thread_group *threadGroup)
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.
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.
void Shutdown()
Shutdown is split into 2 parts: Part 1: shut down everything but the main wallet instance (done in Pr...
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)
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
std::string ChainNameFromCommandLine()
Looks for -regtest, -testnet and returns the appropriate BIP70 chain name.
bool AppInit(int argc, char *argv[])
const fs::path & GetDataDir(bool fNetSpecific)
bool AppInitLockDataDirectory()
Lock raven core data directory.
bool AppInitMain(boost::thread_group &threadGroup, CScheduler &scheduler)
Raven core main initialization.
std::string _(const char *psz)
Translation function: Call Translate signal on UI interface, which returns a boost::optional result...