@ -37,45 +37,43 @@ import org.hyperledger.besu.chainimport.RlpBlockImporter;
import org.hyperledger.besu.cli.config.EthNetworkConfig ;
import org.hyperledger.besu.cli.config.EthNetworkConfig ;
import org.hyperledger.besu.cli.config.NetworkName ;
import org.hyperledger.besu.cli.config.NetworkName ;
import org.hyperledger.besu.cli.config.ProfilesCompletionCandidates ;
import org.hyperledger.besu.cli.config.ProfilesCompletionCandidates ;
import org.hyperledger.besu.cli.converter.MetricCategoryConverter ;
import org.hyperledger.besu.cli.custom.JsonRPCAllowlistHostsProperty ;
import org.hyperledger.besu.cli.custom.JsonRPCAllowlistHostsProperty ;
import org.hyperledger.besu.cli.error.BesuExecutionExceptionHandler ;
import org.hyperledger.besu.cli.error.BesuExecutionExceptionHandler ;
import org.hyperledger.besu.cli.error.BesuParameterExceptionHandler ;
import org.hyperledger.besu.cli.error.BesuParameterExceptionHandler ;
import org.hyperledger.besu.cli.options.ApiConfigurationOptions ;
import org.hyperledger.besu.cli.options.ChainPruningOptions ;
import org.hyperledger.besu.cli.options.DnsOptions ;
import org.hyperledger.besu.cli.options.EngineRPCConfiguration ;
import org.hyperledger.besu.cli.options.EngineRPCOptions ;
import org.hyperledger.besu.cli.options.EthProtocolOptions ;
import org.hyperledger.besu.cli.options.EthstatsOptions ;
import org.hyperledger.besu.cli.options.EvmOptions ;
import org.hyperledger.besu.cli.options.GraphQlOptions ;
import org.hyperledger.besu.cli.options.InProcessRpcOptions ;
import org.hyperledger.besu.cli.options.IpcOptions ;
import org.hyperledger.besu.cli.options.JsonRpcHttpOptions ;
import org.hyperledger.besu.cli.options.LoggingLevelOption ;
import org.hyperledger.besu.cli.options.MetricsOptions ;
import org.hyperledger.besu.cli.options.MiningOptions ;
import org.hyperledger.besu.cli.options.MiningOptions ;
import org.hyperledger.besu.cli.options.NatOptions ;
import org.hyperledger.besu.cli.options.NativeLibraryOptions ;
import org.hyperledger.besu.cli.options.NetworkingOptions ;
import org.hyperledger.besu.cli.options.NodePrivateKeyFileOption ;
import org.hyperledger.besu.cli.options.P2PDiscoveryOptions ;
import org.hyperledger.besu.cli.options.P2PTLSConfigOptions ;
import org.hyperledger.besu.cli.options.PermissionsOptions ;
import org.hyperledger.besu.cli.options.PluginsConfigurationOptions ;
import org.hyperledger.besu.cli.options.PrivacyPluginOptions ;
import org.hyperledger.besu.cli.options.RPCOptions ;
import org.hyperledger.besu.cli.options.RpcWebsocketOptions ;
import org.hyperledger.besu.cli.options.SynchronizerOptions ;
import org.hyperledger.besu.cli.options.TransactionPoolOptions ;
import org.hyperledger.besu.cli.options.TransactionPoolOptions ;
import org.hyperledger.besu.cli.options.stable.ApiConfigurationOptions ;
import org.hyperledger.besu.cli.options.stable.EngineRPCConfiguration ;
import org.hyperledger.besu.cli.options.stable.EngineRPCOptions ;
import org.hyperledger.besu.cli.options.stable.EthstatsOptions ;
import org.hyperledger.besu.cli.options.stable.GraphQlOptions ;
import org.hyperledger.besu.cli.options.stable.JsonRpcHttpOptions ;
import org.hyperledger.besu.cli.options.stable.LoggingLevelOption ;
import org.hyperledger.besu.cli.options.stable.MetricsOptions ;
import org.hyperledger.besu.cli.options.stable.NodePrivateKeyFileOption ;
import org.hyperledger.besu.cli.options.stable.P2PDiscoveryOptions ;
import org.hyperledger.besu.cli.options.stable.PermissionsOptions ;
import org.hyperledger.besu.cli.options.stable.PluginsConfigurationOptions ;
import org.hyperledger.besu.cli.options.stable.RpcWebsocketOptions ;
import org.hyperledger.besu.cli.options.storage.DataStorageOptions ;
import org.hyperledger.besu.cli.options.storage.DataStorageOptions ;
import org.hyperledger.besu.cli.options.storage.DiffBasedSubStorageOptions ;
import org.hyperledger.besu.cli.options.storage.DiffBasedSubStorageOptions ;
import org.hyperledger.besu.cli.options.unstable.ChainPruningOptions ;
import org.hyperledger.besu.cli.options.unstable.DnsOptions ;
import org.hyperledger.besu.cli.options.unstable.EthProtocolOptions ;
import org.hyperledger.besu.cli.options.unstable.EvmOptions ;
import org.hyperledger.besu.cli.options.unstable.InProcessRpcOptions ;
import org.hyperledger.besu.cli.options.unstable.IpcOptions ;
import org.hyperledger.besu.cli.options.unstable.NatOptions ;
import org.hyperledger.besu.cli.options.unstable.NativeLibraryOptions ;
import org.hyperledger.besu.cli.options.unstable.NetworkingOptions ;
import org.hyperledger.besu.cli.options.unstable.P2PTLSConfigOptions ;
import org.hyperledger.besu.cli.options.unstable.PrivacyPluginOptions ;
import org.hyperledger.besu.cli.options.unstable.RPCOptions ;
import org.hyperledger.besu.cli.options.unstable.SynchronizerOptions ;
import org.hyperledger.besu.cli.presynctasks.PreSynchronizationTaskRunner ;
import org.hyperledger.besu.cli.presynctasks.PreSynchronizationTaskRunner ;
import org.hyperledger.besu.cli.presynctasks.PrivateDatabaseMigrationPreSyncTask ;
import org.hyperledger.besu.cli.presynctasks.PrivateDatabaseMigrationPreSyncTask ;
import org.hyperledger.besu.cli.subcommands.PasswordSubCommand ;
import org.hyperledger.besu.cli.subcommands.PasswordSubCommand ;
import org.hyperledger.besu.cli.subcommands.PublicKeySubCommand ;
import org.hyperledger.besu.cli.subcommands.PublicKeySubCommand ;
import org.hyperledger.besu.cli.subcommands.RetestethSubCommand ;
import org.hyperledger.besu.cli.subcommands.TxParseSubCommand ;
import org.hyperledger.besu.cli.subcommands.TxParseSubCommand ;
import org.hyperledger.besu.cli.subcommands.ValidateConfigSubCommand ;
import org.hyperledger.besu.cli.subcommands.ValidateConfigSubCommand ;
import org.hyperledger.besu.cli.subcommands.blocks.BlocksSubCommand ;
import org.hyperledger.besu.cli.subcommands.blocks.BlocksSubCommand ;
@ -115,7 +113,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.ipc.JsonRpcIpcConfiguration;
import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration ;
import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration ;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries ;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries ;
import org.hyperledger.besu.ethereum.chain.Blockchain ;
import org.hyperledger.besu.ethereum.chain.Blockchain ;
import org.hyperledger.besu.ethereum.core.MiningParameters ;
import org.hyperledger.besu.ethereum.core.MiningConfiguration ;
import org.hyperledger.besu.ethereum.core.MiningParametersMetrics ;
import org.hyperledger.besu.ethereum.core.MiningParametersMetrics ;
import org.hyperledger.besu.ethereum.core.PrivacyParameters ;
import org.hyperledger.besu.ethereum.core.PrivacyParameters ;
import org.hyperledger.besu.ethereum.core.VersionMetadata ;
import org.hyperledger.besu.ethereum.core.VersionMetadata ;
@ -170,8 +168,8 @@ import org.hyperledger.besu.plugin.services.TransactionPoolValidatorService;
import org.hyperledger.besu.plugin.services.TransactionSelectionService ;
import org.hyperledger.besu.plugin.services.TransactionSelectionService ;
import org.hyperledger.besu.plugin.services.TransactionSimulationService ;
import org.hyperledger.besu.plugin.services.TransactionSimulationService ;
import org.hyperledger.besu.plugin.services.exception.StorageException ;
import org.hyperledger.besu.plugin.services.exception.StorageException ;
import org.hyperledger.besu.plugin.services.metrics.MetricCategory ;
import org.hyperledger.besu.plugin.services.metrics.MetricCategoryRegistry ;
import org.hyperledger.besu.plugin.services.metrics.MetricCategoryRegistry ;
import org.hyperledger.besu.plugin.services.mining.MiningService ;
import org.hyperledger.besu.plugin.services.p2p.P2PService ;
import org.hyperledger.besu.plugin.services.p2p.P2PService ;
import org.hyperledger.besu.plugin.services.rlp.RlpConverterService ;
import org.hyperledger.besu.plugin.services.rlp.RlpConverterService ;
import org.hyperledger.besu.plugin.services.securitymodule.SecurityModule ;
import org.hyperledger.besu.plugin.services.securitymodule.SecurityModule ;
@ -184,6 +182,7 @@ import org.hyperledger.besu.services.BesuConfigurationImpl;
import org.hyperledger.besu.services.BesuEventsImpl ;
import org.hyperledger.besu.services.BesuEventsImpl ;
import org.hyperledger.besu.services.BesuPluginContextImpl ;
import org.hyperledger.besu.services.BesuPluginContextImpl ;
import org.hyperledger.besu.services.BlockchainServiceImpl ;
import org.hyperledger.besu.services.BlockchainServiceImpl ;
import org.hyperledger.besu.services.MiningServiceImpl ;
import org.hyperledger.besu.services.P2PServiceImpl ;
import org.hyperledger.besu.services.P2PServiceImpl ;
import org.hyperledger.besu.services.PermissioningServiceImpl ;
import org.hyperledger.besu.services.PermissioningServiceImpl ;
import org.hyperledger.besu.services.PicoCLIOptionsImpl ;
import org.hyperledger.besu.services.PicoCLIOptionsImpl ;
@ -332,7 +331,6 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
private final Map < String , String > environment ;
private final Map < String , String > environment ;
private final MetricCategoryRegistryImpl metricCategoryRegistry =
private final MetricCategoryRegistryImpl metricCategoryRegistry =
new MetricCategoryRegistryImpl ( ) ;
new MetricCategoryRegistryImpl ( ) ;
private final MetricCategoryConverter metricCategoryConverter = new MetricCategoryConverter ( ) ;
private final PreSynchronizationTaskRunner preSynchronizationTaskRunner =
private final PreSynchronizationTaskRunner preSynchronizationTaskRunner =
new PreSynchronizationTaskRunner ( ) ;
new PreSynchronizationTaskRunner ( ) ;
@ -342,7 +340,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
Suppliers . memoize ( this : : readGenesisConfigFile ) ;
Suppliers . memoize ( this : : readGenesisConfigFile ) ;
private final Supplier < GenesisConfigOptions > genesisConfigOptionsSupplier =
private final Supplier < GenesisConfigOptions > genesisConfigOptionsSupplier =
Suppliers . memoize ( this : : readGenesisConfigOptions ) ;
Suppliers . memoize ( this : : readGenesisConfigOptions ) ;
private final Supplier < MiningParameters > miningParametersSupplier =
private final Supplier < MiningConfiguration > miningParametersSupplier =
Suppliers . memoize ( this : : getMiningParameters ) ;
Suppliers . memoize ( this : : getMiningParameters ) ;
private RocksDBPlugin rocksDBPlugin ;
private RocksDBPlugin rocksDBPlugin ;
@ -509,77 +507,95 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
@CommandLine.ArgGroup ( validate = false , heading = "@|bold In-Process RPC Options|@%n" )
@CommandLine.ArgGroup ( validate = false , heading = "@|bold In-Process RPC Options|@%n" )
InProcessRpcOptions inProcessRpcOptions = InProcessRpcOptions . create ( ) ;
InProcessRpcOptions inProcessRpcOptions = InProcessRpcOptions . create ( ) ;
private static final String PRIVACY_DEPRECATION_PREFIX =
"Deprecated. Tessera-based privacy is deprecated. See CHANGELOG for alternative options. " ;
// Privacy Options Group
// Privacy Options Group
@CommandLine.ArgGroup ( validate = false , heading = "@|bold Privacy Options|@%n" )
@CommandLine.ArgGroup ( validate = false , heading = "@|bold (Deprecated) Privacy Options |@%n" )
PrivacyOptionGroup privacyOptionGroup = new PrivacyOptionGroup ( ) ;
PrivacyOptionGroup privacyOptionGroup = new PrivacyOptionGroup ( ) ;
static class PrivacyOptionGroup {
static class PrivacyOptionGroup {
@Option (
@Option (
names = { "--privacy-tls-enabled" } ,
names = { "--privacy-tls-enabled" } ,
paramLabel = MANDATORY_FILE_FORMAT_HELP ,
paramLabel = MANDATORY_FILE_FORMAT_HELP ,
description = "Enable TLS for connecting to privacy enclave (default: ${DEFAULT-VALUE})" )
description =
PRIVACY_DEPRECATION_PREFIX
+ "Enable TLS for connecting to privacy enclave (default: ${DEFAULT-VALUE})" )
private final Boolean isPrivacyTlsEnabled = false ;
private final Boolean isPrivacyTlsEnabled = false ;
@Option (
@Option (
names = "--privacy-tls-keystore-file" ,
names = "--privacy-tls-keystore-file" ,
paramLabel = MANDATORY_FILE_FORMAT_HELP ,
paramLabel = MANDATORY_FILE_FORMAT_HELP ,
description =
description =
"Path to a PKCS#12 formatted keystore; used to enable TLS on inbound connections." )
PRIVACY_DEPRECATION_PREFIX
+ "Path to a PKCS#12 formatted keystore; used to enable TLS on inbound connections." )
private final Path privacyKeyStoreFile = null ;
private final Path privacyKeyStoreFile = null ;
@Option (
@Option (
names = "--privacy-tls-keystore-password-file" ,
names = "--privacy-tls-keystore-password-file" ,
paramLabel = MANDATORY_FILE_FORMAT_HELP ,
paramLabel = MANDATORY_FILE_FORMAT_HELP ,
description = "Path to a file containing the password used to decrypt the keystore." )
description =
PRIVACY_DEPRECATION_PREFIX
+ "Path to a file containing the password used to decrypt the keystore." )
private final Path privacyKeyStorePasswordFile = null ;
private final Path privacyKeyStorePasswordFile = null ;
@Option (
@Option (
names = "--privacy-tls-known-enclave-file" ,
names = "--privacy-tls-known-enclave-file" ,
paramLabel = MANDATORY_FILE_FORMAT_HELP ,
paramLabel = MANDATORY_FILE_FORMAT_HELP ,
description =
description =
"Path to a file containing the fingerprints of the authorized privacy enclave." )
PRIVACY_DEPRECATION_PREFIX
+ "Path to a file containing the fingerprints of the authorized privacy enclave." )
private final Path privacyTlsKnownEnclaveFile = null ;
private final Path privacyTlsKnownEnclaveFile = null ;
@Option (
@Option (
names = { "--privacy-enabled" } ,
names = { "--privacy-enabled" } ,
description = "Enable private transactions (default: ${DEFAULT-VALUE})" )
description =
PRIVACY_DEPRECATION_PREFIX + "Enable private transactions (default: ${DEFAULT-VALUE})" )
private final Boolean isPrivacyEnabled = false ;
private final Boolean isPrivacyEnabled = false ;
@Option (
@Option (
names = { "--privacy-multi-tenancy-enabled" } ,
names = { "--privacy-multi-tenancy-enabled" } ,
description = "Enable multi-tenant private transactions (default: ${DEFAULT-VALUE})" )
description =
PRIVACY_DEPRECATION_PREFIX
+ "Enable multi-tenant private transactions (default: ${DEFAULT-VALUE})" )
private final Boolean isPrivacyMultiTenancyEnabled = false ;
private final Boolean isPrivacyMultiTenancyEnabled = false ;
@Option (
@Option (
names = { "--privacy-url" } ,
names = { "--privacy-url" } ,
description = "The URL on which the enclave is running" )
description = PRIVACY_DEPRECATION_PREFIX + "The URL on which the enclave is running" )
private final URI privacyUrl = PrivacyParameters . DEFAULT_ENCLAVE_URL ;
private final URI privacyUrl = PrivacyParameters . DEFAULT_ENCLAVE_URL ;
@Option (
@Option (
names = { "--privacy-public-key-file" } ,
names = { "--privacy-public-key-file" } ,
description = "The enclave's public key file" )
description = PRIVACY_DEPRECATION_PREFIX + "The enclave's public key file" )
private final File privacyPublicKeyFile = null ;
private final File privacyPublicKeyFile = null ;
@Option (
@Option (
names = { "--privacy-marker-transaction-signing-key-file" } ,
names = { "--privacy-marker-transaction-signing-key-file" } ,
description =
description =
"The name of a file containing the private key used to sign privacy marker transactions. If unset, each will be signed with a random key." )
PRIVACY_DEPRECATION_PREFIX
+ "The name of a file containing the private key used to sign privacy marker transactions. If unset, each will be signed with a random key." )
private final Path privateMarkerTransactionSigningKeyPath = null ;
private final Path privateMarkerTransactionSigningKeyPath = null ;
@Option (
@Option (
names = { "--privacy-enable-database-migration" } ,
names = { "--privacy-enable-database-migration" } ,
description = "Enable private database metadata migration (default: ${DEFAULT-VALUE})" )
description =
PRIVACY_DEPRECATION_PREFIX
+ "Enable private database metadata migration (default: ${DEFAULT-VALUE})" )
private final Boolean migratePrivateDatabase = false ;
private final Boolean migratePrivateDatabase = false ;
@Option (
@Option (
names = { "--privacy-flexible-groups-enabled" } ,
names = { "--privacy-flexible-groups-enabled" } ,
description = "Enable flexible privacy groups (default: ${DEFAULT-VALUE})" )
description =
PRIVACY_DEPRECATION_PREFIX
+ "Enable flexible privacy groups (default: ${DEFAULT-VALUE})" )
private final Boolean isFlexiblePrivacyGroupsEnabled = false ;
private final Boolean isFlexiblePrivacyGroupsEnabled = false ;
@Option (
@Option (
names = { "--privacy-nonce-always-increments" } ,
names = { "--privacy-nonce-always-increments" } ,
description =
description =
"Enable private nonce "
PRIVACY_DEPRECATION_PREFIX
+ "Enable private nonce "
+ "incrementation even if the transaction didn't succeeded (default: ${DEFAULT-VALUE})" )
+ "incrementation even if the transaction didn't succeeded (default: ${DEFAULT-VALUE})" )
private final Boolean isPrivateNonceAlwaysIncrementsEnabled = false ;
private final Boolean isPrivateNonceAlwaysIncrementsEnabled = false ;
}
}
@ -1108,7 +1124,6 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
PublicKeySubCommand . COMMAND_NAME , new PublicKeySubCommand ( commandLine . getOut ( ) ) ) ;
PublicKeySubCommand . COMMAND_NAME , new PublicKeySubCommand ( commandLine . getOut ( ) ) ) ;
commandLine . addSubcommand (
commandLine . addSubcommand (
PasswordSubCommand . COMMAND_NAME , new PasswordSubCommand ( commandLine . getOut ( ) ) ) ;
PasswordSubCommand . COMMAND_NAME , new PasswordSubCommand ( commandLine . getOut ( ) ) ) ;
commandLine . addSubcommand ( RetestethSubCommand . COMMAND_NAME , new RetestethSubCommand ( ) ) ;
commandLine . addSubcommand (
commandLine . addSubcommand (
RLPSubCommand . COMMAND_NAME , new RLPSubCommand ( commandLine . getOut ( ) , in ) ) ;
RLPSubCommand . COMMAND_NAME , new RLPSubCommand ( commandLine . getOut ( ) , in ) ) ;
commandLine . addSubcommand (
commandLine . addSubcommand (
@ -1136,10 +1151,6 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
commandLine . registerConverter ( Hash . class , Hash : : fromHexString ) ;
commandLine . registerConverter ( Hash . class , Hash : : fromHexString ) ;
commandLine . registerConverter ( Optional . class , Optional : : of ) ;
commandLine . registerConverter ( Optional . class , Optional : : of ) ;
commandLine . registerConverter ( Double . class , Double : : parseDouble ) ;
commandLine . registerConverter ( Double . class , Double : : parseDouble ) ;
metricCategoryConverter . addCategories ( BesuMetricCategory . class ) ;
metricCategoryConverter . addCategories ( StandardMetricCategory . class ) ;
commandLine . registerConverter ( MetricCategory . class , metricCategoryConverter ) ;
}
}
private void handleStableOptions ( ) {
private void handleStableOptions ( ) {
@ -1174,6 +1185,9 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
besuPluginContext . addService ( PicoCLIOptions . class , new PicoCLIOptionsImpl ( commandLine ) ) ;
besuPluginContext . addService ( PicoCLIOptions . class , new PicoCLIOptionsImpl ( commandLine ) ) ;
besuPluginContext . addService ( SecurityModuleService . class , securityModuleService ) ;
besuPluginContext . addService ( SecurityModuleService . class , securityModuleService ) ;
besuPluginContext . addService ( StorageService . class , storageService ) ;
besuPluginContext . addService ( StorageService . class , storageService ) ;
metricCategoryRegistry . addCategories ( BesuMetricCategory . class ) ;
metricCategoryRegistry . addCategories ( StandardMetricCategory . class ) ;
besuPluginContext . addService ( MetricCategoryRegistry . class , metricCategoryRegistry ) ;
besuPluginContext . addService ( MetricCategoryRegistry . class , metricCategoryRegistry ) ;
besuPluginContext . addService ( PermissioningService . class , permissioningService ) ;
besuPluginContext . addService ( PermissioningService . class , permissioningService ) ;
besuPluginContext . addService ( PrivacyPluginService . class , privacyPluginService ) ;
besuPluginContext . addService ( PrivacyPluginService . class , privacyPluginService ) ;
@ -1191,10 +1205,6 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
rocksDBPlugin . register ( besuPluginContext ) ;
rocksDBPlugin . register ( besuPluginContext ) ;
new InMemoryStoragePlugin ( ) . register ( besuPluginContext ) ;
new InMemoryStoragePlugin ( ) . register ( besuPluginContext ) ;
metricCategoryRegistry
. getMetricCategories ( )
. forEach ( metricCategoryConverter : : addRegistryCategory ) ;
// register default security module
// register default security module
securityModuleService . register (
securityModuleService . register (
DEFAULT_SECURITY_MODULE , Suppliers . memoize ( this : : defaultSecurityModule ) ) ;
DEFAULT_SECURITY_MODULE , Suppliers . memoize ( this : : defaultSecurityModule ) ) ;
@ -1243,7 +1253,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
private void startPlugins ( final Runner runner ) {
private void startPlugins ( final Runner runner ) {
blockchainServiceImpl . init (
blockchainServiceImpl . init (
besuController . getProtocolContext ( ) , besuController . getProtocolSchedule ( ) ) ;
besuController . getProtocolContext ( ) . getBlockchain ( ) , besuController . getProtocolSchedule ( ) ) ;
transactionSimulationServiceImpl . init (
transactionSimulationServiceImpl . init (
besuController . getProtocolContext ( ) . getBlockchain ( ) ,
besuController . getProtocolContext ( ) . getBlockchain ( ) ,
new TransactionSimulator (
new TransactionSimulator (
@ -1293,6 +1303,9 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
miningParametersSupplier . get ( ) ) ,
miningParametersSupplier . get ( ) ) ,
besuController . getProtocolSchedule ( ) ) ) ;
besuController . getProtocolSchedule ( ) ) ) ;
besuPluginContext . addService (
MiningService . class , new MiningServiceImpl ( besuController . getMiningCoordinator ( ) ) ) ;
besuController . getAdditionalPluginServices ( ) . appendPluginServices ( besuPluginContext ) ;
besuController . getAdditionalPluginServices ( ) . appendPluginServices ( besuPluginContext ) ;
besuPluginContext . startPlugins ( ) ;
besuPluginContext . startPlugins ( ) ;
}
}
@ -1303,6 +1316,8 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
// after start has been called on plugins
// after start has been called on plugins
if ( Boolean . TRUE . equals ( privacyOptionGroup . isPrivacyEnabled ) ) {
if ( Boolean . TRUE . equals ( privacyOptionGroup . isPrivacyEnabled ) ) {
logger . warn (
"--Xprivacy-plugin-enabled and related options are " + PRIVACY_DEPRECATION_PREFIX ) ;
if ( privacyOptionGroup . privateMarkerTransactionSigningKeyPath ! = null
if ( privacyOptionGroup . privateMarkerTransactionSigningKeyPath ! = null
& & privacyPluginService ! = null
& & privacyPluginService ! = null
@ -1342,7 +1357,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
private void setReleaseMetrics ( ) {
private void setReleaseMetrics ( ) {
besuComponent
besuComponent
. getMetricsSystem ( )
. getMetricsSystem ( )
. createLabelledGauge (
. createLabelledSupplied Gauge (
StandardMetricCategory . PROCESS , "release" , "Release information" , "version" )
StandardMetricCategory . PROCESS , "release" , "Release information" , "version" )
. labels ( ( ) - > 1 , BesuInfo . version ( ) ) ;
. labels ( ( ) - > 1 , BesuInfo . version ( ) ) ;
}
}
@ -1891,6 +1906,10 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
"--metrics-push-interval" ,
"--metrics-push-interval" ,
"--metrics-push-prometheus-job" ) ) ;
"--metrics-push-prometheus-job" ) ) ;
metricsOptions . setMetricCategoryRegistry ( metricCategoryRegistry ) ;
metricsOptions . validate ( commandLine ) ;
final MetricsConfiguration . Builder metricsConfigurationBuilder =
final MetricsConfiguration . Builder metricsConfigurationBuilder =
metricsOptions . toDomainObject ( ) ;
metricsOptions . toDomainObject ( ) ;
metricsConfigurationBuilder
metricsConfigurationBuilder
@ -1903,7 +1922,9 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
? p2PDiscoveryOptions . autoDiscoverDefaultIP ( ) . getHostAddress ( )
? p2PDiscoveryOptions . autoDiscoverDefaultIP ( ) . getHostAddress ( )
: metricsOptions . getMetricsPushHost ( ) )
: metricsOptions . getMetricsPushHost ( ) )
. hostsAllowlist ( hostsAllowlist ) ;
. hostsAllowlist ( hostsAllowlist ) ;
return metricsConfigurationBuilder . build ( ) ;
final var metricsConfiguration = metricsConfigurationBuilder . build ( ) ;
metricCategoryRegistry . setMetricsConfiguration ( metricsConfiguration ) ;
return metricsConfiguration ;
}
}
private PrivacyParameters privacyParameters ( ) {
private PrivacyParameters privacyParameters ( ) {
@ -1926,6 +1947,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
final PrivacyParameters . Builder privacyParametersBuilder = new PrivacyParameters . Builder ( ) ;
final PrivacyParameters . Builder privacyParametersBuilder = new PrivacyParameters . Builder ( ) ;
if ( Boolean . TRUE . equals ( privacyOptionGroup . isPrivacyEnabled ) ) {
if ( Boolean . TRUE . equals ( privacyOptionGroup . isPrivacyEnabled ) ) {
logger . warn ( "--privacy-enabled and related options are " + PRIVACY_DEPRECATION_PREFIX ) ;
final String errorSuffix = "cannot be enabled with privacy." ;
final String errorSuffix = "cannot be enabled with privacy." ;
if ( syncMode = = SyncMode . FAST ) {
if ( syncMode = = SyncMode . FAST ) {
throw new ParameterException ( commandLine , String . format ( "%s %s" , "Fast sync" , errorSuffix ) ) ;
throw new ParameterException ( commandLine , String . format ( "%s %s" , "Fast sync" , errorSuffix ) ) ;
@ -2121,7 +2143,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
return txPoolConfBuilder . build ( ) ;
return txPoolConfBuilder . build ( ) ;
}
}
private MiningParameters getMiningParameters ( ) {
private MiningConfiguration getMiningParameters ( ) {
miningOptions . setTransactionSelectionService ( transactionSelectionServiceImpl ) ;
miningOptions . setTransactionSelectionService ( transactionSelectionServiceImpl ) ;
final var miningParameters = miningOptions . toDomainObject ( ) ;
final var miningParameters = miningOptions . toDomainObject ( ) ;
getGenesisBlockPeriodSeconds ( genesisConfigOptionsSupplier . get ( ) )
getGenesisBlockPeriodSeconds ( genesisConfigOptionsSupplier . get ( ) )
@ -2173,8 +2195,8 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
return dataStorageConfiguration ;
return dataStorageConfiguration ;
}
}
private void initMiningParametersMetrics ( final MiningParameters miningParameters ) {
private void initMiningParametersMetrics ( final MiningConfiguration miningConfiguration ) {
new MiningParametersMetrics ( getMetricsSystem ( ) , miningParameters ) ;
new MiningParametersMetrics ( getMetricsSystem ( ) , miningConfiguration ) ;
}
}
private OptionalInt getGenesisBlockPeriodSeconds (
private OptionalInt getGenesisBlockPeriodSeconds (