java.lang.Object
io.hotmoka.nodes.ConsensusParams.Builder
- Enclosing class:
ConsensusParams
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowMintBurnFromGamete(boolean allowsMintBurnFromGamete) Specifies to allow the gamete of the node to call, for free, the add method of the accounts ledger and the mint/burn methods of the accounts, without paying gas and without paying for the minted coins.allowSelfCharged(boolean allowsSelfCharged) Specifies to allow the@@SelfChargedannotation in the Takamaka code that runs in the node.allowUnsignedFaucet(boolean allowsUnsignedFaucet) Specifies to allow thefaucet()methods of the gametes without a valid signature.build()Builds the parameters.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.setBuyerSurcharge(int buyerSurcharge) Sets the extra tax paid when a validator acquires the shares of another validator (in percent of the offer cost).setChainId(String chainId) Specifies the chain identifier that will be set for the node.setFinalSupply(BigInteger finalSupply) Sets the final supply of coins of the node.setGenesisTime(String genesisTime) Specifies the genesis time that will be set for the node.setInitialGasPrice(BigInteger initialGasPrice) Sets the initial gas price.setInitialInflation(long initialInflation) Sets the initial inflation applied to the gas consumed by transactions before it gets sent as reward to the validators.setInitialRedSupply(BigInteger initialRedSupply) Sets the initial supply of red coins of the node.setInitialSupply(BigInteger initialSupply) Sets the initial supply of coins of the node.setMaxCumulativeSizeOfDependencies(long maxSizeOfDependencies) Sets the maximal cumulative size of the dependencies per transaction.setMaxDependencies(int maxDependencies) Sets the maximal number of dependencies per transaction.setMaxErrorLength(int maxErrorLength) Sets the maximal length of the error message kept in the store of the node.setMaxGasPerTransaction(BigInteger maxGasPerTransaction) Sets the maximal amount of gas that a non-view transaction can consume.setOblivion(long oblivion) Sets how quick the gas consumed at previous rewards is forgotten: 0 means never, 1_000_000 means immediately.setPercentStaked(int percentStaked) Sets the amount of validators' rewards that gets staked.setPublicKeyOfGamete(String publicKeyOfGamete) Sets the public key for the gamete account.setSlashingForMisbehaving(int slashingForMisbehaving) Sets the percent of stake that gets slashed for each misbehaving validator.setSlashingForNotBehaving(int slashingForNotBehaving) Sets the percent of stake that gets slashed for each not behaving (not voting) validator.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 payed to start a new poll amount to validators, for instance to change a consensus parameter.setVerificationVersion(int verificationVersion) Sets the version of the verification module to use.signRequestsWith(String signature) Specifies to signature algorithm to use to sign the requests sent to the node.skipVerification(boolean skipsVerification) Requires to skip the verification of the classes of the jars installed in the node.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Builds the parameters.- Returns:
- the parameters
-
setChainId
Specifies the chain identifier that will be set for the node. This defaults to the empty string.- Parameters:
chainId- the chain identifier- Returns:
- this same builder
-
setGenesisTime
Specifies the genesis time that will be set for the node. This defaults to the time of creation of this object.- Parameters:
genesisTime- the genesis time, UTC, in ISO8601 pattern- Returns:
- this same builder
-
setMaxErrorLength
Sets the maximal length of the error message kept in the store of the node. Beyond this threshold, the message gets truncated. It defaults to 300 characters.- Parameters:
maxErrorLength- the maximal error length- Returns:
- this builder
-
setMaxDependencies
Sets the maximal number of dependencies per transaction. These are the jars that form the class path of a transaction. It defaults to 20.- Parameters:
maxDependencies- the maximal number of dependencies- Returns:
- this builder
-
setMaxCumulativeSizeOfDependencies
Sets the maximal cumulative size of the dependencies per transaction. These are the number of bytes of the instrumented jars that form the class path of a transaction. It defaults to 10,000,000.- Parameters:
maxSizeOfDependencies- the maximal number of dependencies- Returns:
- this builder
-
allowSelfCharged
Specifies to allow the@@SelfChargedannotation in the Takamaka code that runs in the node.- Parameters:
allowsSelfCharged- true if and only if the annotation is allowed- 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
-
allowMintBurnFromGamete
Specifies to allow the gamete of the node to call, for free, the add method of the accounts ledger and the mint/burn methods of the accounts, without paying gas and without paying for the minted coins.- Parameters:
allowsMintBurnFromGamete- true if and only if the gamete is allowed- Returns:
- this builder
-
signRequestsWith
Specifies to signature algorithm to use to sign the requests sent to the node. It defaults to "ed25519";- Parameters:
signature- the name of the signature algorithm. Currently, this includes "ed25519", "ed25519det", "sha256dsa", "empty", "qtesla1" and "qtesla3"- Returns:
- this builder
-
setInitialGasPrice
Sets the initial gas price. It defaults to 100.- Parameters:
initialGasPrice- the initial gas price to set.
-
setMaxGasPerTransaction
Sets the maximal amount of gas that a non-view transaction can consume. It defaults to 1_000_000_000. -
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. -
setOblivion
Sets how quick 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. -
setInitialInflation
Sets the initial inflation applied to the gas consumed by transactions before it gets sent as reward to the validators. 1,000,000 means 1%. Inflation can be negative. For instance, -300,000 means -0.3%. It defaults to 100,000 (that is, inflation is 0.1% by default). -
setPercentStaked
Sets the amount of validators' rewards that gets staked. The rest is sent to the validators immediately. 1000000 = 1%. It defaults to 75%.- Parameters:
percentStaked- the buyer surcharge to set- Returns:
- this builder
-
setBuyerSurcharge
Sets the extra tax paid when a validator acquires the shares of another validator (in percent of the offer cost). 1000000 = 1%. It defaults to 50%.- Parameters:
buyerSurcharge- the buyer surcharge to set- Returns:
- this builder
-
setSlashingForMisbehaving
Sets the percent of stake that gets slashed for each misbehaving validator. 1000000 means 1%. It defaults to 1%.- Parameters:
slashingForMisbehaving- the slashing for misbehaving validators- Returns:
- this builder
-
setSlashingForNotBehaving
Sets the percent of stake that gets slashed for each not behaving (not voting) validator. 1000000 means 1%. It defaults to 1%.- Parameters:
slashingForNotBehaving- the slashing for not behaving validators- 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
-
setInitialRedSupply
Sets the initial supply of red coins of the node. It defaults to 0.- Parameters:
initialRedSupply- the initial supply of red coins of the node- Returns:
- this builder
-
setPublicKeyOfGamete
Sets the public key for the gamete account. It defaults to "" (hence a non-existent key).- Parameters:
publicKeyOfGamete- the Base64-encoded public key of the gamete account- Returns:
- this builder
-
setFinalSupply
Sets the final supply of coins of the node. It defaults to 0.- Parameters:
finalSupply- the final supply of coins of the node- Returns:
- this builder
-
setTicketForNewPoll
Sets the amount of coins that must be payed to start a new poll amount to validators, for instance to change a consensus parameter. It defaults to 100.
-