7#include <chainparams.h>
21 tfm::format(std::cerr,
"Error parsing command line arguments: %s\n",
26 std::string strUsage =
30 "\nUsage: bitcoin-seeder -host=<host> -ns=<ns> "
31 "[-mbox=<mbox>] [-threads=<threads>] [-port=<port>]\n\n" +
44 "Error: -dumpinterval argument expects only positive integers\n");
52 "Error: -threads argument expects only positive integers\n");
57 if (nPort < 0 || nPort > 65535) {
58 tfm::format(std::cerr,
"Error: -port argument expects only positive "
59 "integers in the range 0 - 65535\n");
68 "Error: -dnsthreads argument expects only positive integers\n");
85 if (
ip_addr.find(
':') == std::string::npos) {
92 size_t flagstartpos = 0;
93 while (flagstartpos < flagString.size()) {
94 size_t flagendpos = flagString.find_first_of(
',', flagstartpos);
96 flagString.substr(flagstartpos, (flagendpos - flagstartpos)));
98 if (flagendpos == std::string::npos) {
101 flagstartpos = flagendpos + 1;
117 "-help-debug",
"Show all debugging options (usage: --help -help-debug)",
129 "E-Mail address reported in SOA records",
132 "-dumpinterval=<seconds>",
133 strprintf(
"Number of seconds between each database dump (default: %d)",
137 "-threads=<threads>",
138 strprintf(
"Number of crawlers to run in parallel (default: %d)",
142 strprintf(
"Number of DNS server threads (default: %d)",
146 strprintf(
"Address to listen on (default: '%s')",
156 "If set, only use the specified DNS seed when "
157 "querying for peer addresses via DNS lookup->",
164 "Allow these flag combinations as filters",
bool HelpRequested(const ArgsManager &args)
void SetupHelpOptions(ArgsManager &args)
Add help options to the args manager.
void SelectParams(const ChainType chain)
Sets the params returned by Params() to those for the given BIP70 chain name.
void SetupChainParamsBaseOptions(ArgsManager &argsman)
Set the arguments for chainparams.
@ ALLOW_ANY
disable validation
ChainType GetChainType() const
Looks for -regtest, -testnet and returns the appropriate BIP70 chain name.
bool ParseParameters(int argc, const char *const argv[], std::string &error)
std::string GetHelpMessage() const
Get the help string.
bool IsArgSet(const std::string &strArg) const
Return true if the given argument has been manually set.
int64_t GetIntArg(const std::string &strArg, int64_t nDefault) const
Return integer argument or default value.
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
void AddArg(const std::string &name, const std::string &help, unsigned int flags, const OptionsCategory &cat)
Add argument.
std::chrono::seconds dumpInterval
int ParseCommandLine(int argc, const char **argv)
std::set< uint64_t > filter_whitelist
ArgsManager * argsManager
std::string FormatFullVersion()
bool error(const char *fmt, const Args &...args)
static const bool DEFAULT_WIPE_BAN
static const int CONTINUE_EXECUTION
static const std::string DEFAULT_IPV4_PROXY
static const int DEFAULT_NUM_DNS_THREADS
static const std::string DEFAULT_IPV6_PROXY
static const int DEFAULT_DUMP_INTERVAL_SECONDS
static const std::string DEFAULT_HOST
static const std::string DEFAULT_LISTEN_ADDRESS
static const bool DEFAULT_WIPE_IGNORE
static const int DEFAULT_NUM_THREADS
static const std::string DEFAULT_EMAIL
static const std::string DEFAULT_TOR_PROXY
static const int DEFAULT_PORT
static const std::string DEFAULT_NAMESERVER
int64_t atoi64(const std::string &str)