Added --mini command line option to connect to p2pool-mini
This commit is contained in:
@@ -44,11 +44,14 @@ static void usage()
|
||||
"--out-peers N Maximum number of outgoing connections for p2p server (any value between 10 and 1000)\n"
|
||||
"--in-peers N Maximum number of incoming connections for p2p server (any value between 10 and 1000)\n"
|
||||
"--start-mining N Start built-in miner using N threads (any value between 1 and 64)\n"
|
||||
"--mini Connect to p2pool-mini sidechain. Note that it will also change default p2p port from %d to %d.\n"
|
||||
"--help Show this help message\n\n"
|
||||
"Example command line:\n\n"
|
||||
"%s --host 127.0.0.1 --rpc-port 18081 --zmq-port 18083 --wallet YOUR_WALLET_ADDRESS --stratum 0.0.0.0:%d --p2p 0.0.0.0:%d\n\n",
|
||||
p2pool::VERSION,
|
||||
p2pool::log::MAX_GLOBAL_LOG_LEVEL,
|
||||
p2pool::DEFAULT_P2P_PORT,
|
||||
p2pool::DEFAULT_P2P_PORT_MINI,
|
||||
#ifdef _WIN32
|
||||
"p2pool.exe"
|
||||
#else
|
||||
|
||||
@@ -111,7 +111,7 @@ p2pool::p2pool(int argc, char* argv[])
|
||||
|
||||
m_api = m_params->m_apiPath.empty() ? nullptr : new p2pool_api(m_params->m_apiPath, m_params->m_localStats);
|
||||
|
||||
m_sideChain = new SideChain(this, type);
|
||||
m_sideChain = new SideChain(this, type, m_params->m_mini ? "mini" : nullptr);
|
||||
|
||||
if (m_params->m_p2pAddresses.empty()) {
|
||||
const int p2p_port = m_sideChain->is_mini() ? DEFAULT_P2P_PORT_MINI : DEFAULT_P2P_PORT;
|
||||
|
||||
@@ -97,6 +97,10 @@ Params::Params(int argc, char* argv[])
|
||||
if ((strcmp(argv[i], "--start-mining") == 0) && (i + 1 < argc)) {
|
||||
m_minerThreads = std::min(std::max(strtoul(argv[++i], nullptr, 10), 1UL), 64UL);
|
||||
}
|
||||
|
||||
if (strcmp(argv[i], "--mini") == 0) {
|
||||
m_mini = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_stratumAddresses.empty()) {
|
||||
|
||||
@@ -43,6 +43,7 @@ struct Params
|
||||
uint32_t m_maxOutgoingPeers = 10;
|
||||
uint32_t m_maxIncomingPeers = 1000;
|
||||
uint32_t m_minerThreads = 0;
|
||||
bool m_mini = false;
|
||||
};
|
||||
|
||||
} // namespace p2pool
|
||||
|
||||
Reference in New Issue
Block a user