|
|
@ -168,6 +168,9 @@ void help() |
|
|
|
<< " --port <port> Connect to remote port (default: 30303)." << endl |
|
|
|
<< " --network-id <n> Only connect to other hosts with this network id (default:0)." << endl |
|
|
|
<< " --upnp <on/off> Use UPnP for NAT (default: on)." << endl |
|
|
|
<< " --no-discovery Disable Node discovery. (experimental)" << endl |
|
|
|
<< " --pin Only connect to required (trusted) peers. (experimental)" << endl |
|
|
|
// << " --require-peers <peers.json> List of required (trusted) peers. (experimental)" << endl
|
|
|
|
<< endl; |
|
|
|
MinerCLI::streamHelp(cout); |
|
|
|
cout |
|
|
@ -304,6 +307,8 @@ int main(int argc, char** argv) |
|
|
|
unsigned short remotePort = 30303; |
|
|
|
unsigned peers = 11; |
|
|
|
bool bootstrap = false; |
|
|
|
bool disableDiscovery = false; |
|
|
|
bool pinning = false; |
|
|
|
unsigned networkId = 0; |
|
|
|
|
|
|
|
/// Mining params
|
|
|
@ -592,6 +597,16 @@ int main(int argc, char** argv) |
|
|
|
} |
|
|
|
else if (arg == "-b" || arg == "--bootstrap") |
|
|
|
bootstrap = true; |
|
|
|
else if (arg == "--no-discovery") |
|
|
|
if (bootstrap) |
|
|
|
{ |
|
|
|
cerr << "-b/--bootstrap cannot be used with --no-discovery." << endl; |
|
|
|
return -1; |
|
|
|
} |
|
|
|
else |
|
|
|
disableDiscovery = true; |
|
|
|
else if (arg == "--pin") |
|
|
|
pinning = true; |
|
|
|
else if (arg == "-f" || arg == "--force-mining") |
|
|
|
forceMining = true; |
|
|
|
else if (arg == "-i" || arg == "--interactive") |
|
|
@ -684,6 +699,8 @@ int main(int argc, char** argv) |
|
|
|
StructuredLogger::get().initialize(structuredLogging, structuredLoggingFormat, structuredLoggingURL); |
|
|
|
VMFactory::setKind(jit ? VMKind::JIT : VMKind::Interpreter); |
|
|
|
auto netPrefs = publicIP.empty() ? NetworkPreferences(listenIP ,listenPort, upnp) : NetworkPreferences(publicIP, listenIP ,listenPort, upnp); |
|
|
|
netPrefs.discovery = !disableDiscovery; |
|
|
|
netPrefs.pin = pinning; |
|
|
|
auto nodesState = contents((dbPath.size() ? dbPath : getDataDir()) + "/network.rlp"); |
|
|
|
std::string clientImplString = "++eth/" + clientName + "v" + dev::Version + "-" + string(DEV_QUOTED(ETH_COMMIT_HASH)).substr(0, 8) + (ETH_CLEAN_REPO ? "" : "*") + "/" DEV_QUOTED(ETH_BUILD_TYPE) "/" DEV_QUOTED(ETH_BUILD_PLATFORM) + (jit ? "/JIT" : ""); |
|
|
|
dev::WebThreeDirect web3( |
|
|
|