Class Config
- java.lang.Object
-
- org.hyperledger.fabric.sdk.helper.Config
-
public class Config extends java.lang.ObjectConfig 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.StringASYMMETRIC_KEY_TYPEstatic java.lang.StringCERTIFICATE_FORMATstatic java.lang.StringCHANNEL_CONFIG_WAIT_TIMEstatic java.lang.StringCLIENT_THREAD_EXECUTOR_COREPOOLSIZEDefault HFClient thread executor settings.static java.lang.StringCLIENT_THREAD_EXECUTOR_KEEPALIVETIMEstatic java.lang.StringCLIENT_THREAD_EXECUTOR_KEEPALIVETIMEUNITstatic java.lang.StringCLIENT_THREAD_EXECUTOR_MAXIMUMPOOLSIZEstatic java.lang.StringCONN_SSL_NEGTYPEstatic java.lang.StringCONN_SSL_PROVIDERConnections settingsstatic java.lang.StringDEFAULT_CRYPTO_SUITE_FACTORYCrypto configuration settings -- settings should not be changed.static java.lang.StringDIAGNOTISTIC_FILE_DIRECTORYstatic java.lang.StringEVENTHUB_CONNECTION_WAIT_TIMEstatic java.lang.StringEVENTHUB_RECONNECTION_WARNING_RATEstatic java.lang.StringEXTRALOGLEVELstatic java.lang.StringGENESISBLOCK_WAIT_TIMEstatic java.lang.StringHASH_ALGORITHMstatic java.lang.StringLOGGERLEVELstatic java.lang.StringMAX_LOG_STRING_LENGTHLogging settingsstatic java.lang.StringORDERER_RETRY_WAIT_TIMEstatic java.lang.StringORDERER_WAIT_TIMEstatic java.lang.StringORG_HYPERLEDGER_FABRIC_SDK_CONFIGURATIONstatic java.lang.StringPEER_EVENT_RECONNECTION_WARNING_RATEstatic java.lang.StringPEER_EVENT_REGISTRATION_WAIT_TIMEstatic java.lang.StringPEER_EVENT_RETRY_WAIT_TIMEstatic java.lang.StringPROPOSAL_CONSISTENCY_VALIDATIONMiscellaneous settingsstatic java.lang.StringPROPOSAL_WAIT_TIMETimeout settingsstatic java.lang.StringSECURITY_CURVE_MAPPINGstatic java.lang.StringSECURITY_LEVELstatic java.lang.StringSECURITY_PROVIDER_CLASS_NAMEstatic java.lang.StringSERVICE_DISCOVER_FREQ_SECONDSstatic java.lang.StringSERVICE_DISCOVER_WAIT_TIMEstatic java.lang.StringSIGNATURE_ALGORITHMstatic java.lang.StringTRANSACTION_CLEANUP_UP_TIMEOUT_WAIT_TIME
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanextraLogLevel(int val)java.lang.StringgetAsymmetricKeyType()java.lang.StringgetCertificateFormat()longgetChannelConfigWaitTime()Time to wait for channel to be configured.intgetClientThreadExecutorCorePoolSize()The number of threads to keep in the pool, even if they are idle, unlessallowCoreThreadTimeOutis setlonggetClientThreadExecutorKeepAliveTime()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.TimeUnitgetClientThreadExecutorKeepAliveTimeUnit()the time unit for the argumentintgetClientThreadExecutorMaxiumPoolSize()maximumPoolSize the maximum number of threads to allow in the poolstatic ConfiggetConfig()getConfig return back singleton for SDK configuration.java.lang.StringgetDefaultCryptoSuiteFactory()java.lang.StringgetDefaultSSLNegotiationType()The default ssl negotiation typejava.lang.StringgetDefaultSSLProvider()The default ssl provider for grpc connectionDiagnosticFileDumpergetDiagnosticFileDumper()The directory where diagnostic dumps are to be place, null if none should be done.longgetEventHubConnectionWaitTime()longgetEventHubReconnectionWarningRate()The number of failed attempts to reissue a warning.longgetGenesisBlockWaitTime()Get the configured time to wait for genesis block.java.lang.StringgetHashAlgorithm()Get the name of the configured hash algorithm, used for digital signatures.java.lang.StringgetNextID()longgetOrdererRetryWaitTime()Time to wait before retrying an operation.longgetOrdererWaitTime()longgetPeerEventReconnectionWarningRate()longgetPeerEventRegistrationWaitTime()getPeerEventRegistrationWaitTimelonggetPeerRetryWaitTime()getPeerEventRegistrationWaitTimebooleangetProposalConsistencyValidation()getProposalConsistencyValidation determine if validation of the proposals should be done before sending to the orderer.longgetProposalWaitTime()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.intgetSecurityLevel()Get the configured security level.java.lang.StringgetSecurityProviderClassName()Get the configured security provider.intgetServiceDiscoveryFreqSeconds()How often serviced discovery is preformed in seconds.intgetServiceDiscoveryWaitTime()Time to wait for service discovery to complete.java.lang.StringgetSignatureAlgorithm()longgetTransactionListenerCleanUpTimeout()This does NOT trigger futures time out and must be kept WELL above any expected future timeout for transactions sent to the OrdererintmaxLogStringLength()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, unlessallowCoreThreadTimeOutis set- Returns:
- The number of threads to keep in the pool, even if they are idle, unless
allowCoreThreadTimeOutis 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:
-
-