|
|
@ -84,8 +84,9 @@ void help() |
|
|
|
<< " --json-rpc-port Specify JSON-RPC server port (implies '-j', default: 8080)." << endl |
|
|
|
#endif |
|
|
|
<< " -K,--kill-blockchain First kill the blockchain." << endl |
|
|
|
<< " -l,--listen <port> Listen on the given port for incoming connected (default: 30303)." << endl |
|
|
|
<< " -L,--local-networking Use peers whose addresses are local." << endl |
|
|
|
<< " --listen-ip <ip> Listen on the given IP for incoming connections (default: 0.0.0.0)." << endl |
|
|
|
<< " -l,--listen <port> Listen on the given port for incoming connections (default: 30303)." << endl |
|
|
|
<< " -u,--public-ip <ip> Force public ip to given (default; auto)." << endl |
|
|
|
<< " -m,--mining <on/off> Enable mining (default: off)" << endl |
|
|
|
<< " -n,--upnp <on/off> Use upnp for NAT (default: on)." << endl |
|
|
|
<< " -o,--mode <full/peer> Start a full node or a peer node (Default: full)." << endl |
|
|
@ -94,7 +95,6 @@ void help() |
|
|
|
<< " -r,--remote <host> Connect to remote host (default: none)." << endl |
|
|
|
<< " -s,--secret <secretkeyhex> Set the secret key for use with send command (default: auto)." << endl |
|
|
|
<< " -t,--miners <number> Number of mining threads to start (Default: " << thread::hardware_concurrency() << ")" << endl |
|
|
|
<< " -u,--public-ip <ip> Force public ip to given (default; auto)." << endl |
|
|
|
<< " -v,--verbosity <0..9> Set the log verbosity from 0 to 9 (tmp forced to 1)." << endl |
|
|
|
<< " -x,--peers <number> Attempt to connect to given number of peers (default: 5)." << endl |
|
|
|
<< " -V,--version Show the version and exit." << endl |
|
|
@ -321,7 +321,9 @@ enum class NodeMode |
|
|
|
|
|
|
|
int main(int argc, char** argv) |
|
|
|
{ |
|
|
|
string listenIP; |
|
|
|
unsigned short listenPort = 30303; |
|
|
|
string publicIP; |
|
|
|
string remoteHost; |
|
|
|
unsigned short remotePort = 30303; |
|
|
|
string dbPath; |
|
|
@ -332,10 +334,8 @@ int main(int argc, char** argv) |
|
|
|
#if ETH_JSONRPC |
|
|
|
int jsonrpc = 8080; |
|
|
|
#endif |
|
|
|
string publicIP; |
|
|
|
bool bootstrap = false; |
|
|
|
bool upnp = true; |
|
|
|
bool useLocal = false; |
|
|
|
bool forceMining = false; |
|
|
|
bool killChain = false; |
|
|
|
bool jit = false; |
|
|
@ -371,7 +371,9 @@ int main(int argc, char** argv) |
|
|
|
for (int i = 1; i < argc; ++i) |
|
|
|
{ |
|
|
|
string arg = argv[i]; |
|
|
|
if ((arg == "-l" || arg == "--listen" || arg == "--listen-port") && i + 1 < argc) |
|
|
|
if (arg == "--listen-ip" && i + 1 < argc) |
|
|
|
listenIP = argv[++i]; |
|
|
|
else if ((arg == "-l" || arg == "--listen" || arg == "--listen-port") && i + 1 < argc) |
|
|
|
listenPort = (short)atoi(argv[++i]); |
|
|
|
else if ((arg == "-u" || arg == "--public-ip" || arg == "--public") && i + 1 < argc) |
|
|
|
publicIP = argv[++i]; |
|
|
@ -392,8 +394,6 @@ int main(int argc, char** argv) |
|
|
|
return -1; |
|
|
|
} |
|
|
|
} |
|
|
|
else if (arg == "-L" || arg == "--local-networking") |
|
|
|
useLocal = true; |
|
|
|
else if (arg == "-K" || arg == "--kill-blockchain") |
|
|
|
killChain = true; |
|
|
|
else if ((arg == "-c" || arg == "--client-name") && i + 1 < argc) |
|
|
@ -535,6 +535,8 @@ int main(int argc, char** argv) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!clientName.empty()) |
|
|
|
clientName += "/"; |
|
|
|
|
|
|
@ -542,7 +544,7 @@ int main(int argc, char** argv) |
|
|
|
|
|
|
|
StructuredLogger::get().initialize(structuredLogging, structuredLoggingFormat); |
|
|
|
VMFactory::setKind(jit ? VMKind::JIT : VMKind::Interpreter); |
|
|
|
NetworkPreferences netPrefs(listenPort, publicIP, upnp, useLocal); |
|
|
|
NetworkPreferences netPrefs(publicIP, listenIP ,listenPort, upnp); |
|
|
|
auto nodesState = contents((dbPath.size() ? dbPath : getDataDir()) + "/network.rlp"); |
|
|
|
std::string clientImplString = "NEthereum(++)/" + clientName + "v" + dev::Version + "/" DEV_QUOTED(ETH_BUILD_TYPE) "/" DEV_QUOTED(ETH_BUILD_PLATFORM) + (jit ? "/JIT" : ""); |
|
|
|
dev::WebThreeDirect web3( |
|
|
@ -687,7 +689,9 @@ int main(int argc, char** argv) |
|
|
|
{ |
|
|
|
unsigned port; |
|
|
|
iss >> port; |
|
|
|
web3.setNetworkPreferences(NetworkPreferences((short)port, publicIP, upnp)); |
|
|
|
if (port) |
|
|
|
netPrefs.listenPort = port; |
|
|
|
web3.setNetworkPreferences(netPrefs); |
|
|
|
web3.startNetwork(); |
|
|
|
} |
|
|
|
else if (cmd == "connect") |
|
|
|