|
|
|
@ -12,6 +12,7 @@ |
|
|
|
|
*/ |
|
|
|
|
package tech.pegasys.pantheon.cli; |
|
|
|
|
|
|
|
|
|
import static com.google.common.base.Preconditions.checkNotNull; |
|
|
|
|
import static tech.pegasys.pantheon.controller.KeyPairUtil.loadKeyPair; |
|
|
|
|
|
|
|
|
|
import tech.pegasys.pantheon.config.GenesisConfigFile; |
|
|
|
@ -105,6 +106,16 @@ public class PantheonControllerBuilder { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public PantheonController<?> build() throws IOException { |
|
|
|
|
checkNotNull(nodePrivateKeyFile, "Missing node private key file"); |
|
|
|
|
checkNotNull(synchronizerConfiguration, "Missing synchronizer configuration"); |
|
|
|
|
checkNotNull(rocksDbConfiguration, "Missing rocksdb configuration"); |
|
|
|
|
checkNotNull(homePath, "Missing home path"); |
|
|
|
|
checkNotNull(ethNetworkConfig, "Missing Ethereum network config"); |
|
|
|
|
checkNotNull(miningParameters, "Missing mining parameters"); |
|
|
|
|
checkNotNull(metricsSystem, "Missing metrics system"); |
|
|
|
|
checkNotNull(privacyParameters, "Missing privacy parameters"); |
|
|
|
|
checkNotNull(ethereumWireProtocolConfiguration, "Missing Ethereum wire protocol config"); |
|
|
|
|
|
|
|
|
|
// instantiate a controller with mainnet config if no genesis file is defined
|
|
|
|
|
// otherwise use the indicated genesis file
|
|
|
|
|
final KeyPair nodeKeys = loadKeyPair(nodePrivateKeyFile); |
|
|
|
@ -120,7 +131,7 @@ public class PantheonControllerBuilder { |
|
|
|
|
final String genesisConfig = ethNetworkConfig.getGenesisConfig(); |
|
|
|
|
genesisConfigFile = GenesisConfigFile.fromConfig(genesisConfig); |
|
|
|
|
} |
|
|
|
|
Clock clock = Clock.systemUTC(); |
|
|
|
|
final Clock clock = Clock.systemUTC(); |
|
|
|
|
return PantheonController.fromConfig( |
|
|
|
|
genesisConfigFile, |
|
|
|
|
synchronizerConfiguration, |
|
|
|
|