| 135 | } |
| 136 | |
| 137 | static bool ProcessInitCommands(interfaces::Init& init, ArgsManager& args) |
| 138 | { |
| 139 | // Process help and version before taking care about datadir |
| 140 | if (HelpRequested(args) || args.GetBoolArg("-version", false)) { |
| 141 | std::string strUsage = CLIENT_NAME " daemon version " + FormatFullVersion(); |
| 142 | if (const char* exe_name{init.exeName()}) { |
| 143 | strUsage += " "; |
| 144 | strUsage += exe_name; |
| 145 | } |
| 146 | strUsage += "\n"; |
| 147 | |
| 148 | if (args.GetBoolArg("-version", false)) { |
| 149 | strUsage += FormatParagraph(LicenseInfo()); |
| 150 | } else { |
| 151 | strUsage += "\n" |
| 152 | "The " CLIENT_NAME " daemon (bitcoind) is a headless program that connects to the Bitcoin network to validate and relay transactions and blocks, as well as relaying addresses.\n\n" |
| 153 | "It provides the backbone of the Bitcoin network and its RPC, REST and ZMQ services can provide various transaction, block and address-related services.\n\n" |
| 154 | "There is an optional wallet component which provides transaction services.\n\n" |
| 155 | "It can be used in a headless environment or as part of a server setup.\n" |
| 156 | "\n" |
| 157 | "Usage: bitcoind [options]\n" |
| 158 | "\n"; |
| 159 | strUsage += args.GetHelpMessage(); |
| 160 | } |
| 161 | |
| 162 | tfm::format(std::cout, "%s", strUsage); |
| 163 | return true; |
| 164 | } |
| 165 | |
| 166 | return false; |
| 167 | } |
| 168 | |
| 169 | static bool AppInit(NodeContext& node) |
| 170 | { |
no test coverage detected