Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
adding --network-id option to eth cli
Browse files Browse the repository at this point in the history
  • Loading branch information
psalami committed May 2, 2015
1 parent 976c990 commit 468a06d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions eth/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ void help()
<< " --listen <port> Listen on the given port for incoming connections (default: 30303)." << endl
<< " -r,--remote <host>(:<port>) Connect to remote host (default: none)." << endl
<< " --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
#if ETH_JSONRPC || !ETH_TRUE
<< "Work farming mode:" << endl
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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;
Expand Down

1 comment on commit 468a06d

@bobsummerwill
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @psalami!

Please could you let me know an e-mail address for you?

It is in relation to this cpp-ethereum re-licensing effort!

You contributed 3 small changes. Thanks!

ethereum/webthree-umbrella#530

Please sign in to comment.