|
|
|
@ -146,14 +146,6 @@ public class PantheonCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
// CLI options defined by user at runtime.
|
|
|
|
|
// Options parsing is done with CLI library Picocli https://picocli.info/
|
|
|
|
|
|
|
|
|
|
@Option( |
|
|
|
|
names = {"--node-private-key-file"}, |
|
|
|
|
paramLabel = MANDATORY_PATH_FORMAT_HELP, |
|
|
|
|
description = |
|
|
|
|
"the path to the node's private key file (default: a file named \"key\" in the Pantheon data folder)" |
|
|
|
|
) |
|
|
|
|
private final File nodePrivateKeyFile = null; |
|
|
|
|
|
|
|
|
|
// Completely disables p2p within Pantheon.
|
|
|
|
|
@Option( |
|
|
|
|
names = {"--p2p-enabled"}, |
|
|
|
@ -633,7 +625,7 @@ public class PantheonCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
.miningParameters( |
|
|
|
|
new MiningParameters(coinbase, minTransactionGasPrice, extraData, isMiningEnabled)) |
|
|
|
|
.devMode(NetworkName.DEV.equals(getNetwork())) |
|
|
|
|
.nodePrivateKeyFile(getNodePrivateKeyFile()) |
|
|
|
|
.nodePrivateKeyFile(nodePrivateKeyFile()) |
|
|
|
|
.metricsSystem(metricsSystem) |
|
|
|
|
.privacyParameters(orionConfiguration()) |
|
|
|
|
.build(); |
|
|
|
@ -644,12 +636,6 @@ public class PantheonCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private File getNodePrivateKeyFile() { |
|
|
|
|
return nodePrivateKeyFile != null |
|
|
|
|
? nodePrivateKeyFile |
|
|
|
|
: KeyPairUtil.getDefaultKeyFile(dataDir()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JsonRpcConfiguration jsonRpcConfiguration() { |
|
|
|
|
|
|
|
|
|
CommandLineUtils.checkOptionDependencies( |
|
|
|
@ -942,6 +928,17 @@ public class PantheonCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private File nodePrivateKeyFile() { |
|
|
|
|
File nodePrivateKeyFile = null; |
|
|
|
|
if (isFullInstantiation()) { |
|
|
|
|
nodePrivateKeyFile = standaloneCommands.nodePrivateKeyFile; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return nodePrivateKeyFile != null |
|
|
|
|
? nodePrivateKeyFile |
|
|
|
|
: KeyPairUtil.getDefaultKeyFile(dataDir()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean isFullInstantiation() { |
|
|
|
|
return !isDocker; |
|
|
|
|
} |
|
|
|
|