Module io.hotmoka.node.api
Package io.hotmoka.node.api.nodes
Interface ConsensusConfig<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
public interface ConsensusConfig<C extends ConsensusConfig<C,B>,B extends ConsensusConfigBuilder<C,B>>
A specification of the consensus parameters of a Hotmoka node. This information
is typically contained in the manifest of the node.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanYields true if and only if the use of the faucet of the gamete is allowed without a valid signature.booleanYields the chain identifier of the node.Yields the final supply of coins in the node.Yields the gas cost model used for the instrumentation of the jars installed in the node.Yields the genesis time, UTC.Yields the height from which coins are not minted anymore.Yields the initial gas price.Yields the initial supply of coins in the node.longYields the maximal cumulative size (in bytes) of the instrumented jars of the dependencies of a transaction.intYields the maximal number of dependencies in the classpath of a transaction.Yields the maximal amount of gas that a non-view transaction can consume.longYields the maximum size of a request; larger requests will be rejected.longYields how quickly the gas consumed at previous rewards is forgotten: 0 means never, 1_000_000 means immediately.Yields the public key of the gamete account.Yields the Base64-encoded public key of the gamete account.io.hotmoka.crypto.api.SignatureAlgorithmYields the signature algorithm for signing requests.Yields the units of gas that are aimed to be rewarded at each reward.Yields the amount of coins to pay to start a new poll amount the voters, for instance in order to change a consensus parameter.longYields the version of the verification module to use.inthashCode()booleanYields true if and only if the node ignores the minimum gas price.booleanYields true if and only if the static verification of the classes of the jars installed in the node must be skipped.Yields a builder initialized with the information in this object.toString()toToml()Yields a TOML representation of this configuration.
-
Method Details
-
getGenesisTime
LocalDateTime getGenesisTime()Yields the genesis time, UTC.- Returns:
- the genesis time
-
getChainId
String getChainId()Yields the chain identifier of the node.- Returns:
- the chain identifier
-
getMaxDependencies
int getMaxDependencies()Yields the maximal number of dependencies in the classpath of a transaction.- Returns:
- the maximal number of dependencies
-
getMaxCumulativeSizeOfDependencies
long getMaxCumulativeSizeOfDependencies()Yields the maximal cumulative size (in bytes) of the instrumented jars of the dependencies of a transaction.- Returns:
- the maximal cumulative size (in bytes)
-
getMaxRequestSize
long getMaxRequestSize()Yields the maximum size of a request; larger requests will be rejected.- Returns:
- the maximum size of a request
-
allowsUnsignedFaucet
boolean allowsUnsignedFaucet()Yields true if and only if the use of the faucet of the gamete is allowed without a valid signature.- Returns:
- true if and only if the condition holds
-
skipsVerification
boolean skipsVerification()Yields true if and only if the static verification of the classes of the jars installed in the node must be skipped.- Returns:
- true if and only if the condition holds
-
getPublicKeyOfGamete
PublicKey getPublicKeyOfGamete()Yields the public key of the gamete account.- Returns:
- the public key
-
getPublicKeyOfGameteBase64
String getPublicKeyOfGameteBase64()Yields the Base64-encoded public key of the gamete account.- Returns:
- the Base64-encoded public key
-
getInitialGasPrice
BigInteger getInitialGasPrice()Yields the initial gas price.- Returns:
- the initial gas price
-
getMaxGasPerTransaction
BigInteger getMaxGasPerTransaction()Yields the maximal amount of gas that a non-view transaction can consume.- Returns:
- the maximal amount of gas that a non-view transaction can consume
-
ignoresGasPrice
boolean ignoresGasPrice()Yields true if and only if the node ignores the minimum gas price. Hence requests that specify a lower gas price than the current gas price of the node are executed anyway. This is mainly useful for testing.- Returns:
- true if and only if the gas price must be ignored
-
getTargetGasAtReward
BigInteger getTargetGasAtReward()Yields 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.- Returns:
- the units of gas that are aimed to be rewarded at each reward
-
getOblivion
long getOblivion()Yields 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. A value of 0 means that the gas price is constant.- Returns:
- how quickly the gas consumed at previous rewards is forgotten: 0 means never, 1_000_000 means immediately
-
getVerificationVersion
long getVerificationVersion()Yields the version of the verification module to use.- Returns:
- the version of the verification module to use
-
getInitialSupply
BigInteger getInitialSupply()Yields the initial supply of coins in the node.- Returns:
- the initial supply of coins in the node
-
getFinalSupply
BigInteger getFinalSupply()Yields the final supply of coins in the node. Once the current supply reaches this final amount, it remains constant.- Returns:
- the final supply of coins in the node
-
getHeightAtFinalSupply
BigInteger getHeightAtFinalSupply()Yields the height from which coins are not minted anymore. That is exactly the moment when the final supply gets reached. From there, validators only earn coins from the gas consumed by the committed transactions.- Returns:
- the height from which coins are not minted anymore
-
getTicketForNewPoll
BigInteger getTicketForNewPoll()Yields the amount of coins to pay to start a new poll amount the voters, for instance in order to change a consensus parameter.- Returns:
- the amount of coins to pay to start a new poll
-
getSignatureForRequests
io.hotmoka.crypto.api.SignatureAlgorithm getSignatureForRequests()Yields the signature algorithm for signing requests.- Returns:
- the signature algorithm
-
getGasCostModel
GasCostModel getGasCostModel()Yields the gas cost model used for the instrumentation of the jars installed in the node.- Returns:
- the gas cost model
-
toToml
String toToml()Yields a TOML representation of this configuration.- Returns:
- the TOML representation, as a string
-
toBuilder
B toBuilder()Yields a builder initialized with the information in this object.- Returns:
- the builder
-
equals
-
hashCode
int hashCode() -
toString
String toString()
-