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

Remove --private option from aleth #5531

@halfalicious

Description

@halfalicious

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:

addClientOption("private", po::value<string>()->value_name("<name>"), "Use a private chain");

The private option is parsed here:

aleth/aleth/main.cpp

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:

aleth/aleth/main.cpp

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:

aleth/aleth/main.cpp

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;
}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions