Class Config
- java.lang.Object
-
- org.hyperledger.fabric.sdk.helper.Config
-
public class Config extends java.lang.Object
Config allows for a global config of the toolkit. Central location for all toolkit configuration defaults. Has a local config file that can override any property defaults. Config file can be relocated via a system property "org.hyperledger.fabric.sdk.configuration". Any property can be overridden with environment variable and then overridden with a java system property. Property hierarchy goes System property overrides environment variable which overrides config file for default values specified here.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ASYMMETRIC_KEY_TYPE
static java.lang.String
CERTIFICATE_FORMAT
static java.lang.String
CHANNEL_CONFIG_WAIT_TIME
static java.lang.String
CLIENT_THREAD_EXECUTOR_COREPOOLSIZE
Default HFClient thread executor settings.static java.lang.String
CLIENT_THREAD_EXECUTOR_KEEPALIVETIME
static java.lang.String
CLIENT_THREAD_EXECUTOR_KEEPALIVETIMEUNIT
static java.lang.String
CLIENT_THREAD_EXECUTOR_MAXIMUMPOOLSIZE
static java.lang.String
CONN_SSL_NEGTYPE
static java.lang.String
CONN_SSL_PROVIDER
Connections settingsstatic java.lang.String
DEFAULT_CRYPTO_SUITE_FACTORY
Crypto configuration settings -- settings should not be changed.static java.lang.String
DIAGNOTISTIC_FILE_DIRECTORY
static java.lang.String
EVENTHUB_CONNECTION_WAIT_TIME
static java.lang.String
EVENTHUB_RECONNECTION_WARNING_RATE
static java.lang.String
EXTRALOGLEVEL
static java.lang.String
GENESISBLOCK_WAIT_TIME
static java.lang.String
HASH_ALGORITHM
static java.lang.String
LOGGERLEVEL
static java.lang.String
MAX_LOG_STRING_LENGTH
Logging settingsstatic java.lang.String
ORDERER_RETRY_WAIT_TIME
static java.lang.String
ORDERER_WAIT_TIME
static java.lang.String
ORG_HYPERLEDGER_FABRIC_SDK_CONFIGURATION
static java.lang.String
PEER_EVENT_RECONNECTION_WARNING_RATE
static java.lang.String
PEER_EVENT_REGISTRATION_WAIT_TIME
static java.lang.String
PEER_EVENT_RETRY_WAIT_TIME
static java.lang.String
PROPOSAL_CONSISTENCY_VALIDATION
Miscellaneous settingsstatic java.lang.String
PROPOSAL_WAIT_TIME
Timeout settingsstatic java.lang.String
SECURITY_CURVE_MAPPING
static java.lang.String
SECURITY_LEVEL
static java.lang.String
SECURITY_PROVIDER_CLASS_NAME
static java.lang.String
SERVICE_DISCOVER_FREQ_SECONDS
static java.lang.String
SERVICE_DISCOVER_WAIT_TIME
static java.lang.String
SIGNATURE_ALGORITHM
static java.lang.String
TRANSACTION_CLEANUP_UP_TIMEOUT_WAIT_TIME
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
extraLogLevel(int val)
java.lang.String
getAsymmetricKeyType()
java.lang.String
getCertificateFormat()
long
getChannelConfigWaitTime()
Time to wait for channel to be configured.int
getClientThreadExecutorCorePoolSize()
The number of threads to keep in the pool, even if they are idle, unlessallowCoreThreadTimeOut
is setlong
getClientThreadExecutorKeepAliveTime()
keepAliveTime when the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.java.util.concurrent.TimeUnit
getClientThreadExecutorKeepAliveTimeUnit()
the time unit for the argumentint
getClientThreadExecutorMaxiumPoolSize()
maximumPoolSize the maximum number of threads to allow in the poolstatic Config
getConfig()
getConfig return back singleton for SDK configuration.java.lang.String
getDefaultCryptoSuiteFactory()
java.lang.String
getDefaultSSLNegotiationType()
The default ssl negotiation typejava.lang.String
getDefaultSSLProvider()
The default ssl provider for grpc connectionDiagnosticFileDumper
getDiagnosticFileDumper()
The directory where diagnostic dumps are to be place, null if none should be done.long
getEventHubConnectionWaitTime()
long
getEventHubReconnectionWarningRate()
The number of failed attempts to reissue a warning.long
getGenesisBlockWaitTime()
Get the configured time to wait for genesis block.java.lang.String
getHashAlgorithm()
Get the name of the configured hash algorithm, used for digital signatures.java.lang.String
getNextID()
long
getOrdererRetryWaitTime()
Time to wait before retrying an operation.long
getOrdererWaitTime()
long
getPeerEventReconnectionWarningRate()
long
getPeerEventRegistrationWaitTime()
getPeerEventRegistrationWaitTimelong
getPeerRetryWaitTime()
getPeerEventRegistrationWaitTimeboolean
getProposalConsistencyValidation()
getProposalConsistencyValidation determine if validation of the proposals should be done before sending to the orderer.long
getProposalWaitTime()
Get the timeout for a single proposal request to endorser.java.util.Map<java.lang.Integer,java.lang.String>
getSecurityCurveMapping()
Get a mapping from strength to curve desired.int
getSecurityLevel()
Get the configured security level.java.lang.String
getSecurityProviderClassName()
Get the configured security provider.int
getServiceDiscoveryFreqSeconds()
How often serviced discovery is preformed in seconds.int
getServiceDiscoveryWaitTime()
Time to wait for service discovery to complete.java.lang.String
getSignatureAlgorithm()
long
getTransactionListenerCleanUpTimeout()
This does NOT trigger futures time out and must be kept WELL above any expected future timeout for transactions sent to the Ordererint
maxLogStringLength()
static java.util.Map<java.lang.Integer,java.lang.String>
parseSecurityCurveMappings(java.lang.String property)
-
-
-
Field Detail
-
ORG_HYPERLEDGER_FABRIC_SDK_CONFIGURATION
public static final java.lang.String ORG_HYPERLEDGER_FABRIC_SDK_CONFIGURATION
- See Also:
- Constant Field Values
-
PROPOSAL_WAIT_TIME
public static final java.lang.String PROPOSAL_WAIT_TIME
Timeout settings- See Also:
- Constant Field Values
-
CHANNEL_CONFIG_WAIT_TIME
public static final java.lang.String CHANNEL_CONFIG_WAIT_TIME
- See Also:
- Constant Field Values
-
TRANSACTION_CLEANUP_UP_TIMEOUT_WAIT_TIME
public static final java.lang.String TRANSACTION_CLEANUP_UP_TIMEOUT_WAIT_TIME
- See Also:
- Constant Field Values
-
ORDERER_RETRY_WAIT_TIME
public static final java.lang.String ORDERER_RETRY_WAIT_TIME
- See Also:
- Constant Field Values
-
ORDERER_WAIT_TIME
public static final java.lang.String ORDERER_WAIT_TIME
- See Also:
- Constant Field Values
-
PEER_EVENT_REGISTRATION_WAIT_TIME
public static final java.lang.String PEER_EVENT_REGISTRATION_WAIT_TIME
- See Also:
- Constant Field Values
-
PEER_EVENT_RETRY_WAIT_TIME
public static final java.lang.String PEER_EVENT_RETRY_WAIT_TIME
- See Also:
- Constant Field Values
-
EVENTHUB_CONNECTION_WAIT_TIME
public static final java.lang.String EVENTHUB_CONNECTION_WAIT_TIME
- See Also:
- Constant Field Values
-
EVENTHUB_RECONNECTION_WARNING_RATE
public static final java.lang.String EVENTHUB_RECONNECTION_WARNING_RATE
- See Also:
- Constant Field Values
-
PEER_EVENT_RECONNECTION_WARNING_RATE
public static final java.lang.String PEER_EVENT_RECONNECTION_WARNING_RATE
- See Also:
- Constant Field Values
-
GENESISBLOCK_WAIT_TIME
public static final java.lang.String GENESISBLOCK_WAIT_TIME
- See Also:
- Constant Field Values
-
DEFAULT_CRYPTO_SUITE_FACTORY
public static final java.lang.String DEFAULT_CRYPTO_SUITE_FACTORY
Crypto configuration settings -- settings should not be changed.- See Also:
- Constant Field Values
-
SECURITY_LEVEL
public static final java.lang.String SECURITY_LEVEL
- See Also:
- Constant Field Values
-
SECURITY_PROVIDER_CLASS_NAME
public static final java.lang.String SECURITY_PROVIDER_CLASS_NAME
- See Also:
- Constant Field Values
-
SECURITY_CURVE_MAPPING
public static final java.lang.String SECURITY_CURVE_MAPPING
- See Also:
- Constant Field Values
-
HASH_ALGORITHM
public static final java.lang.String HASH_ALGORITHM
- See Also:
- Constant Field Values
-
ASYMMETRIC_KEY_TYPE
public static final java.lang.String ASYMMETRIC_KEY_TYPE
- See Also:
- Constant Field Values
-
CERTIFICATE_FORMAT
public static final java.lang.String CERTIFICATE_FORMAT
- See Also:
- Constant Field Values
-
SIGNATURE_ALGORITHM
public static final java.lang.String SIGNATURE_ALGORITHM
- See Also:
- Constant Field Values
-
MAX_LOG_STRING_LENGTH
public static final java.lang.String MAX_LOG_STRING_LENGTH
Logging settings- See Also:
- Constant Field Values
-
EXTRALOGLEVEL
public static final java.lang.String EXTRALOGLEVEL
- See Also:
- Constant Field Values
-
LOGGERLEVEL
public static final java.lang.String LOGGERLEVEL
- See Also:
- Constant Field Values
-
DIAGNOTISTIC_FILE_DIRECTORY
public static final java.lang.String DIAGNOTISTIC_FILE_DIRECTORY
- See Also:
- Constant Field Values
-
CONN_SSL_PROVIDER
public static final java.lang.String CONN_SSL_PROVIDER
Connections settings- See Also:
- Constant Field Values
-
CONN_SSL_NEGTYPE
public static final java.lang.String CONN_SSL_NEGTYPE
- See Also:
- Constant Field Values
-
CLIENT_THREAD_EXECUTOR_COREPOOLSIZE
public static final java.lang.String CLIENT_THREAD_EXECUTOR_COREPOOLSIZE
Default HFClient thread executor settings.- See Also:
- Constant Field Values
-
CLIENT_THREAD_EXECUTOR_MAXIMUMPOOLSIZE
public static final java.lang.String CLIENT_THREAD_EXECUTOR_MAXIMUMPOOLSIZE
- See Also:
- Constant Field Values
-
CLIENT_THREAD_EXECUTOR_KEEPALIVETIME
public static final java.lang.String CLIENT_THREAD_EXECUTOR_KEEPALIVETIME
- See Also:
- Constant Field Values
-
CLIENT_THREAD_EXECUTOR_KEEPALIVETIMEUNIT
public static final java.lang.String CLIENT_THREAD_EXECUTOR_KEEPALIVETIMEUNIT
- See Also:
- Constant Field Values
-
PROPOSAL_CONSISTENCY_VALIDATION
public static final java.lang.String PROPOSAL_CONSISTENCY_VALIDATION
Miscellaneous settings- See Also:
- Constant Field Values
-
SERVICE_DISCOVER_FREQ_SECONDS
public static final java.lang.String SERVICE_DISCOVER_FREQ_SECONDS
- See Also:
- Constant Field Values
-
SERVICE_DISCOVER_WAIT_TIME
public static final java.lang.String SERVICE_DISCOVER_WAIT_TIME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getNextID
public java.lang.String getNextID()
-
getConfig
public static Config getConfig()
getConfig return back singleton for SDK configuration.- Returns:
- Global configuration
-
getSecurityLevel
public int getSecurityLevel()
Get the configured security level. The value determines the elliptic curve used to generate keys.- Returns:
- the security level.
-
getSecurityProviderClassName
public java.lang.String getSecurityProviderClassName()
Get the configured security provider. This is the security provider used for the default SDK crypto suite factory.- Returns:
- the security provider.
-
getHashAlgorithm
public java.lang.String getHashAlgorithm()
Get the name of the configured hash algorithm, used for digital signatures.- Returns:
- the hash algorithm name.
-
getDefaultSSLProvider
public java.lang.String getDefaultSSLProvider()
The default ssl provider for grpc connection- Returns:
- The default ssl provider for grpc connection
-
getDefaultSSLNegotiationType
public java.lang.String getDefaultSSLNegotiationType()
The default ssl negotiation type- Returns:
- The default ssl negotiation type
-
getSecurityCurveMapping
public java.util.Map<java.lang.Integer,java.lang.String> getSecurityCurveMapping()
Get a mapping from strength to curve desired.- Returns:
- mapping from strength to curve name to use.
-
parseSecurityCurveMappings
public static java.util.Map<java.lang.Integer,java.lang.String> parseSecurityCurveMappings(java.lang.String property)
-
getProposalWaitTime
public long getProposalWaitTime()
Get the timeout for a single proposal request to endorser.- Returns:
- the timeout in milliseconds.
-
getGenesisBlockWaitTime
public long getGenesisBlockWaitTime()
Get the configured time to wait for genesis block.- Returns:
- time in milliseconds.
-
getChannelConfigWaitTime
public long getChannelConfigWaitTime()
Time to wait for channel to be configured.- Returns:
-
getOrdererRetryWaitTime
public long getOrdererRetryWaitTime()
Time to wait before retrying an operation.- Returns:
-
getOrdererWaitTime
public long getOrdererWaitTime()
-
getPeerEventRegistrationWaitTime
public long getPeerEventRegistrationWaitTime()
getPeerEventRegistrationWaitTime- Returns:
- time in milliseconds to wait for peer eventing service to wait for event registration
-
getPeerRetryWaitTime
public long getPeerRetryWaitTime()
getPeerEventRegistrationWaitTime- Returns:
- time in milliseconds to wait for peer eventing service to wait for event registration
-
getEventHubReconnectionWarningRate
public long getEventHubReconnectionWarningRate()
The number of failed attempts to reissue a warning. Or -1 for none.- Returns:
- The number of failed attempts to reissue a warning.
-
getPeerEventReconnectionWarningRate
public long getPeerEventReconnectionWarningRate()
-
getServiceDiscoveryFreqSeconds
public int getServiceDiscoveryFreqSeconds()
How often serviced discovery is preformed in seconds.- Returns:
-
getServiceDiscoveryWaitTime
public int getServiceDiscoveryWaitTime()
Time to wait for service discovery to complete.- Returns:
-
getEventHubConnectionWaitTime
public long getEventHubConnectionWaitTime()
-
getAsymmetricKeyType
public java.lang.String getAsymmetricKeyType()
-
getCertificateFormat
public java.lang.String getCertificateFormat()
-
getSignatureAlgorithm
public java.lang.String getSignatureAlgorithm()
-
getDefaultCryptoSuiteFactory
public java.lang.String getDefaultCryptoSuiteFactory()
-
maxLogStringLength
public int maxLogStringLength()
-
getProposalConsistencyValidation
public boolean getProposalConsistencyValidation()
getProposalConsistencyValidation determine if validation of the proposals should be done before sending to the orderer.- Returns:
- if true proposals will be checked they are consistent with each other before sending to the Orderer
-
extraLogLevel
public boolean extraLogLevel(int val)
-
getDiagnosticFileDumper
public DiagnosticFileDumper getDiagnosticFileDumper()
The directory where diagnostic dumps are to be place, null if none should be done.- Returns:
- The directory where diagnostic dumps are to be place, null if none should be done.
-
getTransactionListenerCleanUpTimeout
public long getTransactionListenerCleanUpTimeout()
This does NOT trigger futures time out and must be kept WELL above any expected future timeout for transactions sent to the Orderer- Returns:
-
getClientThreadExecutorCorePoolSize
public int getClientThreadExecutorCorePoolSize()
The number of threads to keep in the pool, even if they are idle, unlessallowCoreThreadTimeOut
is set- Returns:
- The number of threads to keep in the pool, even if they are idle, unless
allowCoreThreadTimeOut
is set
-
getClientThreadExecutorMaxiumPoolSize
public int getClientThreadExecutorMaxiumPoolSize()
maximumPoolSize the maximum number of threads to allow in the pool- Returns:
- maximumPoolSize the maximum number of threads to allow in the pool
-
getClientThreadExecutorKeepAliveTime
public long getClientThreadExecutorKeepAliveTime()
keepAliveTime when the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.- Returns:
- The keep alive time.
-
getClientThreadExecutorKeepAliveTimeUnit
public java.util.concurrent.TimeUnit getClientThreadExecutorKeepAliveTimeUnit()
the time unit for the argument- Returns:
-
-