|
|
|
@ -1186,11 +1186,13 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
// Need to create vertx after cmdline has been parsed, such that metricsSystem is configurable
|
|
|
|
|
vertx = createVertx(createVertxOptions(metricsSystem.get())); |
|
|
|
|
|
|
|
|
|
final BesuCommand controller = validateOptions().configure().controller(); |
|
|
|
|
validateOptions(); |
|
|
|
|
configure(); |
|
|
|
|
initController(); |
|
|
|
|
startPlugins(); |
|
|
|
|
preSynchronization(); |
|
|
|
|
startSynchronization(); |
|
|
|
|
|
|
|
|
|
preSynchronizationTaskRunner.runTasks(controller.besuController); |
|
|
|
|
|
|
|
|
|
controller.startPlugins().startSynchronization(); |
|
|
|
|
} catch (final Exception e) { |
|
|
|
|
throw new ParameterException(this.commandLine, e.getMessage(), e); |
|
|
|
|
} |
|
|
|
@ -1335,6 +1337,10 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void preSynchronization() { |
|
|
|
|
preSynchronizationTaskRunner.runTasks(besuController); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void startSynchronization() { |
|
|
|
|
synchronize( |
|
|
|
|
besuController, |
|
|
|
@ -1355,7 +1361,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
pidPath); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private BesuCommand startPlugins() { |
|
|
|
|
private void startPlugins() { |
|
|
|
|
besuPluginContext.addService( |
|
|
|
|
BesuEvents.class, |
|
|
|
|
new BesuEventsImpl( |
|
|
|
@ -1366,7 +1372,6 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
besuPluginContext.addService(MetricsSystem.class, getMetricsSystem()); |
|
|
|
|
besuController.getAdditionalPluginServices().appendPluginServices(besuPluginContext); |
|
|
|
|
besuPluginContext.startPlugins(); |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void configureLogging(final boolean announce) { |
|
|
|
@ -1394,7 +1399,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private BesuCommand validateOptions() { |
|
|
|
|
private void validateOptions() { |
|
|
|
|
issueOptionWarnings(); |
|
|
|
|
|
|
|
|
|
validateP2PInterface(p2pInterface); |
|
|
|
@ -1402,8 +1407,6 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
validateNatParams(); |
|
|
|
|
validateNetStatsParams(); |
|
|
|
|
validateDnsOptionsParams(); |
|
|
|
|
|
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@SuppressWarnings("ConstantConditions") |
|
|
|
@ -1535,7 +1538,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private BesuCommand configure() throws Exception { |
|
|
|
|
private void configure() throws Exception { |
|
|
|
|
checkPortClash(); |
|
|
|
|
|
|
|
|
|
syncMode = |
|
|
|
@ -1580,7 +1583,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
metricsConfiguration = metricsConfiguration(); |
|
|
|
|
|
|
|
|
|
logger.info("Security Module: {}", securityModuleName); |
|
|
|
|
return this; |
|
|
|
|
instantiateSignatureAlgorithmFactory(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private GoQuorumPrivacyParameters configureGoQuorumPrivacy( |
|
|
|
@ -1639,9 +1642,8 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private BesuCommand controller() { |
|
|
|
|
private void initController() { |
|
|
|
|
besuController = buildController(); |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public BesuController buildController() { |
|
|
|
@ -2256,8 +2258,6 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
|
|
|
|
|
checkNotNull(runnerBuilder); |
|
|
|
|
|
|
|
|
|
permissioningConfiguration.ifPresent(runnerBuilder::permissioningConfiguration); |
|
|
|
|
|
|
|
|
|
final ObservableMetricsSystem metricsSystem = this.metricsSystem.get(); |
|
|
|
|
final Runner runner = |
|
|
|
|
runnerBuilder |
|
|
|
@ -2269,6 +2269,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
.natMethodFallbackEnabled(unstableNatOptions.getNatMethodFallbackEnabled()) |
|
|
|
|
.discovery(peerDiscoveryEnabled) |
|
|
|
|
.ethNetworkConfig(ethNetworkConfig) |
|
|
|
|
.permissioningConfiguration(permissioningConfiguration) |
|
|
|
|
.p2pAdvertisedHost(p2pAdvertisedHost) |
|
|
|
|
.p2pListenInterface(p2pListenInterface) |
|
|
|
|
.p2pListenPort(p2pListenPort) |
|
|
|
|