From 468a06d35af9244fee8661129362eaac3299a822 Mon Sep 17 00:00:00 2001 From: Patrick Salami Date: Fri, 1 May 2015 23:12:29 -0700 Subject: [PATCH] adding --network-id option to eth cli --- eth/main.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/eth/main.cpp b/eth/main.cpp index d4ad085297f..985e74e594d 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -146,6 +146,7 @@ void help() << " --listen Listen on the given port for incoming connections (default: 30303)." << endl << " -r,--remote (:) Connect to remote host (default: none)." << endl << " --port Connect to remote port (default: 30303)." << endl + << " --network-id Only connect to other hosts with this network id (default:0)." << endl << " --upnp Use UPnP for NAT (default: on)." << endl #if ETH_JSONRPC || !ETH_TRUE << "Work farming mode:" << endl @@ -515,6 +516,7 @@ int main(int argc, char** argv) unsigned short remotePort = 30303; unsigned peers = 5; bool bootstrap = false; + unsigned networkId = 0; /// Mining params unsigned mining = 0; @@ -668,6 +670,15 @@ int main(int argc, char** argv) return -1; } } + else if (arg == "--network-id" && i + 1 < argc) + try { + networkId = stol(argv[++i]); + } + catch (...) + { + cerr << "Bad " << arg << " option: " << argv[i] << endl; + return -1; + } else if (arg == "--benchmark-warmup" && i + 1 < argc) try { benchmarkWarmup = stol(argv[++i]); @@ -1034,6 +1045,7 @@ int main(int argc, char** argv) c->setForceMining(forceMining); c->setTurboMining(minerType == MinerType::GPU); c->setAddress(coinbase); + c->setNetworkId(networkId); } cout << "Transaction Signer: " << sigKey.address() << endl;