Module io.hotmoka.node.api
Package io.hotmoka.node.api.nodes
Interface ConsensusConfigBuilder<C extends ConsensusConfig<C,B>,B extends ConsensusConfigBuilder<C,B>>
- Type Parameters:
C- the concrete type of the configurationB- the concrete type of the builder
- All Known Subinterfaces:
ValidatorsConsensusConfigBuilder<C,B>
public interface ConsensusConfigBuilder<C extends ConsensusConfig<C,B>,B extends ConsensusConfigBuilder<C,B>>
The builder of a configuration object.
-
Method Summary
Modifier and TypeMethodDescriptionallowUnsignedFaucet(boolean allowsUnsignedFaucet) Specifies to allow thefaucet()methods of the gametes without a valid signature.build()Builds the configuration.ignoreGasPrice(boolean ignoresGasPrice) Specifies that the minimum gas price for transactions is 0, so that the current gas price is not relevant for the execution of the transactions.setChainId(String chainId) Sets the chain identifier of the node.setFinalSupply(BigInteger finalSupply) Sets the final supply of coins of the node.setGenesisTime(LocalDateTime genesisTime) Sets the genesis time, UTC.setHeightAtFinalSupply(BigInteger heightAtFinalSupply) Sets the height at the final supply.setInitialGasPrice(BigInteger initialGasPrice) Sets the initial gas price.setInitialSupply(BigInteger initialSupply) Sets the initial supply of coins of the node.setMaxCumulativeSizeOfDependencies(long maxCumulativeSizeOfDependencies) Sets the maximal cumulative size (in bytes) of the instrumented jars of the dependencies of a transaction.setMaxDependencies(int maxDependencies) Sets the maximal number of dependencies in the classpath of a transaction.setMaxGasPerTransaction(BigInteger maxGasPerTransaction) Sets the maximal amount of gas that a non-view transaction can consume.setMaxRequestSize(long maxRequestSize) Sets the maximal size (in bytes) of a request; larger requests will be rejected.setOblivion(long oblivion) Sets how quickly the gas consumed at previous rewards is forgotten: 0 means never, 1_000_000 means immediately.setPublicKeyOfGamete(PublicKey publicKeyOfGamete) Sets the public key for the gamete account.setSignatureForRequests(io.hotmoka.crypto.api.SignatureAlgorithm signature) Specifies the signature algorithm to use to sign the requests sent to the node.setTargetGasAtReward(BigInteger targetGasAtReward) Sets the units of gas that are aimed to be rewarded at each reward.setTicketForNewPoll(BigInteger ticketForNewPoll) Sets the amount of coins that must be paid to start a new poll amount to validators, for instance to change a consensus parameter.setVerificationVersion(long verificationVersion) Sets the version of the verification module to use.skipVerification(boolean skipsVerification) Requires to skip the verification of the classes of the jars installed in the node.
-
Method Details
-
setGenesisTime
Sets the genesis time, UTC.- Parameters:
genesisTime- the genesis time, UTC- Returns:
- this builder
-
setChainId
Sets the chain identifier of the node.- Parameters:
chainId- the chain identifier- Returns:
- this builder
-
setMaxDependencies
Sets the maximal number of dependencies in the classpath of a transaction.- Parameters:
maxDependencies- the maximal number of dependencies in the classpath of a transaction- Returns:
- this builder
-
setMaxCumulativeSizeOfDependencies
Sets the maximal cumulative size (in bytes) of the instrumented jars of the dependencies of a transaction.- Parameters:
maxCumulativeSizeOfDependencies- the maximal cumulative size (in bytes) of the instrumented jars of the dependencies of a transaction- Returns:
- this builder
-
setMaxRequestSize
Sets the maximal size (in bytes) of a request; larger requests will be rejected.- Parameters:
maxRequestSize- the maximal size (in bytes) of a request- Returns:
- this builder
-
allowUnsignedFaucet
Specifies to allow thefaucet()methods of the gametes without a valid signature. This is only useful for testing networks, where users can freely fill their accounts at the faucet.- Parameters:
allowsUnsignedFaucet- true if and only if the faucet of the gametes can be used without a valid signature- Returns:
- this builder
-
setSignatureForRequests
Specifies the signature algorithm to use to sign the requests sent to the node. It defaults to ed25519;- Parameters:
signature- the signature algorithm- Returns:
- this builder
-
setInitialGasPrice
Sets the initial gas price.- Parameters:
initialGasPrice- the initial gas price to set.- Returns:
- this builder
-
setMaxGasPerTransaction
Sets the maximal amount of gas that a non-view transaction can consume.- Parameters:
maxGasPerTransaction- the maximal amount of gas to set- Returns:
- this builder
-
setTargetGasAtReward
Sets the units of gas that are aimed to be rewarded at each reward. If the actual reward is smaller, the price of gas must decrease. If it is larger, the price of gas must increase. It defaults to 1_000_000.- Parameters:
targetGasAtReward- the units of gas to set- Returns:
- this builder
-
setOblivion
Sets how quickly the gas consumed at previous rewards is forgotten: 0 means never, 1_000_000 means immediately. Hence a smaller level means that the latest rewards are heavier in the determination of the gas price. Use 0 to keep the gas price constant. It defaults to 250_000L.- Parameters:
oblivion- the value to set- Returns:
- this builder
-
ignoreGasPrice
Specifies that the minimum gas price for transactions is 0, so that the current gas price is not relevant for the execution of the transactions. It defaults to false.- Parameters:
ignoresGasPrice- true if and only if the minimum gas price must be ignored- Returns:
- this builder
-
skipVerification
Requires to skip the verification of the classes of the jars installed in the node. It defaults to false.- Parameters:
skipsVerification- true if and only if the verification must be disabled- Returns:
- this builder
-
setVerificationVersion
Sets the version of the verification module to use. It defaults to 0.- Parameters:
verificationVersion- the version of the verification module- Returns:
- this builder
-
setInitialSupply
Sets the initial supply of coins of the node. It defaults to 0.- Parameters:
initialSupply- the initial supply of coins of the node- Returns:
- this builder
-
setPublicKeyOfGamete
Sets the public key for the gamete account. It defaults to a public key with empty entropy and empty password.- Parameters:
publicKeyOfGamete- the public key of the gamete account- Returns:
- this builder
- Throws:
InvalidKeyException- ifpublicKeyOfGameteis invalid
-
setFinalSupply
Sets the final supply of coins of the node.- Parameters:
finalSupply- the final supply of coins of the node- Returns:
- this builder
-
setHeightAtFinalSupply
Sets the height at the final supply.- Parameters:
heightAtFinalSupply- the height at the final supply, after which coins are not minted anymore and the current supply reaches the final supply- Returns:
- this builder
-
setTicketForNewPoll
Sets the amount of coins that must be paid to start a new poll amount to validators, for instance to change a consensus parameter.- Parameters:
ticketForNewPoll- the amount of coins to set- Returns:
- this builder
-
build
C build()Builds the configuration.- Returns:
- the configuration
-