- java.lang.Object
-
- io.hotmoka.local.Config.Builder<T>
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Configbuild()Builds the configuration.protected abstract TgetThis()Standard design pattern.TsetDir(Path dir)Sets the directory where the node's data will be persisted.TsetMaxGasPerViewTransaction(BigInteger maxGasPerViewTransaction)Sets the maximal amount of gas that a view transaction can consume.TsetMaxPollingAttempts(int maxPollingAttempts)Sets the maximal number of polling attempts, in milliseconds, while waiting for the result of a posted transaction.TsetPollingDelay(int pollingDelay)Sets the delay of two subsequent polling attempts, in milliseconds, while waiting for the result of a posted transaction.TsetRequestCacheSize(int requestCacheSize)Sets size of the cache for theNode.getRequest(TransactionReference)method.TsetResponseCacheSize(int responseCacheSize)Sets size of the cache for theNode.getResponse(TransactionReference)method.
-
-
-
Method Detail
-
getThis
protected abstract T getThis()
Standard design pattern. See http://www.angelikalanger.com/GenericsFAQ/FAQSections/ProgrammingIdioms.html#FAQ205
-
setMaxGasPerViewTransaction
public T setMaxGasPerViewTransaction(BigInteger maxGasPerViewTransaction)
Sets the maximal amount of gas that a view transaction can consume. It defaults to 100_000_000.
-
setDir
public T setDir(Path dir)
Sets the directory where the node's data will be persisted. It defaults tochainin the current directory.- Parameters:
dir- the directory- Returns:
- this builder
-
setMaxPollingAttempts
public T setMaxPollingAttempts(int maxPollingAttempts)
Sets the maximal number of polling attempts, in milliseconds, while waiting for the result of a posted transaction. It defaults to 60.- Parameters:
maxPollingAttempts- the the maximal number of polling attempts- Returns:
- this builder
-
setPollingDelay
public T setPollingDelay(int pollingDelay)
Sets the delay of two subsequent polling attempts, in milliseconds, while waiting for the result of a posted transaction. This delay is then increased by 10% at each subsequent attempt. It defaults to 10.- Parameters:
pollingDelay- the delay- Returns:
- this builder
-
setRequestCacheSize
public T setRequestCacheSize(int requestCacheSize)
Sets size of the cache for theNode.getRequest(TransactionReference)method. It defaults to 1,000.- Parameters:
requestCacheSize- the cache size- Returns:
- this builder
-
setResponseCacheSize
public T setResponseCacheSize(int responseCacheSize)
Sets size of the cache for theNode.getResponse(TransactionReference)method. It defaults to 1,000.- Parameters:
responseCacheSize- the cache size- Returns:
- this builder
-
build
public Config build()
Builds the configuration.- Returns:
- the configuration
-
-