6 #if defined(HAVE_CONFIG_H)
7 #include "config/bitcoin-config.h"
22 #include <boost/algorithm/string/predicate.hpp>
23 #include <boost/filesystem.hpp>
24 #include <boost/thread.hpp>
56 threadGroup->join_all();
66 boost::thread_group threadGroup;
88 strUsage +=
"\n" +
_(
"Usage:") +
"\n" +
89 " dogecoind [options] " +
strprintf(
_(
"Start %s Daemon"),
_(PACKAGE_NAME)) +
"\n";
94 fprintf(stdout,
"%s", strUsage.c_str());
100 if (!boost::filesystem::is_directory(
GetDataDir(
false)))
102 fprintf(stderr,
"Error: Specified data directory \"%s\" does not exist.\n",
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 bool fCommandLine =
false;
122 for (
int i = 1; i < argc; i++)
123 if (!
IsSwitchChar(argv[i][0]) && !boost::algorithm::istarts_with(argv[i],
"dogecoin:"))
128 fprintf(stderr,
"Error: There is no RPC client functionality in dogecoind anymore. Use the dogecoin-cli utility instead.\n");
154 fprintf(stdout,
"Dogecoin server starting\n");
158 fprintf(stderr,
"Error: daemon() failed: %s\n", strerror(errno));
162 fprintf(stderr,
"Error: -daemon is not supported on this operating system\n");
169 catch (
const std::exception& e) {
189 int main(
int argc,
char* argv[])
196 return (
AppInit(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE);
int main(int argc, char *argv[])
void WaitForShutdown(boost::thread_group *threadGroup)
bool AppInit(int argc, char *argv[])
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given BIP70 chain name.
std::string ChainNameFromCommandLine()
Looks for -regtest, -testnet and returns the appropriate BIP70 chain name.
std::string FormatFullVersion()
bool AppInitMain(boost::thread_group &threadGroup, CScheduler &scheduler)
Bitcoin core main initialization.
void InitParameterInteraction()
Parameter interaction: change current parameters depending on various rules.
std::string HelpMessage(HelpMessageMode mode)
Help for options shared between UI and daemon (for -help)
bool AppInitParameterInteraction()
Initialization: parameter interaction.
bool AppInitBasicSetup()
Initialize bitcoin core: Basic context setup.
bool AppInitSanityChecks()
Initialization sanity checks: ecc init, sanity checks, dir lock.
void InitLogging()
Initialize the logging infrastructure.
std::string LicenseInfo()
Returns licensing information (for -version)
void Interrupt(boost::thread_group &threadGroup)
Interrupt threads.
std::string GetArg(const std::string &strArg, const std::string &strDefault)
Return string argument or default value.
void ParseParameters(int argc, const char *const argv[])
void ReadConfigFile(const std::string &confPath)
bool GetBoolArg(const std::string &strArg, bool fDefault)
Return boolean argument or default value.
void PrintExceptionContinue(const std::exception *pex, const char *pszThread)
const boost::filesystem::path & GetDataDir(bool fNetSpecific)
const char *const BITCOIN_CONF_FILENAME
bool SoftSetBoolArg(const std::string &strArg, bool fValue)
Set a boolean argument if it doesn't already have a value.
bool IsArgSet(const std::string &strArg)
Return true if the given argument has been manually set.
std::string _(const char *psz)
Translation function: Call Translate signal on UI interface, which returns a boost::optional result.
bool IsSwitchChar(char c)
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 MilliSleep(int64_t n)