This repository was archived by the owner on Oct 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
This repository was archived by the owner on Oct 28, 2021. It is now read-only.
Remove --private option from aleth #5531
Copy link
Copy link
Closed
Description
Aleth's --private option is unnecessary and should be removed - it sets some chain parameters to certain values, but in order to use a private chain one must also specify a chain configuration json file (via the --config parameter) and this config file must also include values for those chain parameters.
The private option's usage is logged here:
Line 211 in 523c965
| addClientOption("private", po::value<string>()->value_name("<name>"), "Use a private chain"); |
The private option is parsed here:
Lines 626 to 635 in ad6f54f
| if (vm.count("private")) | |
| try | |
| { | |
| privateChain = vm["private"].as<string>(); | |
| } | |
| catch (...) | |
| { | |
| cerr << "Bad " << "--private" << " option: " << vm["private"].as<string>() << "\n"; | |
| return AlethErrors::BadPrivateOption; | |
| } |
Chain parameters are then set to certain values (based on whether or not --private was supplied) here:
Lines 698 to 703 in ad6f54f
| if (!privateChain.empty()) | |
| { | |
| chainParams.extraData = sha3(privateChain).asBytes(); | |
| chainParams.difficulty = chainParams.minimumDifficulty; | |
| chainParams.gasLimit = u256(1) << 32; | |
| } |
The chain configuration file is processed here:
Lines 681 to 694 in ad6f54f
| if (!configJSON.empty()) | |
| { | |
| try | |
| { | |
| chainParams = chainParams.loadConfig(configJSON, {}, configPath); | |
| chainConfigIsSet = true; | |
| } | |
| catch (...) | |
| { | |
| cerr << "provided configuration is not well formatted\n"; | |
| cerr << "sample: \n" << genesisInfo(eth::Network::MainNetworkTest) << "\n"; | |
| return AlethErrors::Success; | |
| } | |
| } |
Reactions are currently unavailable