Class ConsensusParams

java.lang.Object
io.hotmoka.nodes.ConsensusParams

public class ConsensusParams extends Object
A specification of the consensus parameters of a node. This information is typically contained in the manifest of a node.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final boolean
    True if and only if the gamete of the node can 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.
    final boolean
    True if and only if the use of the @@SelfCharged annotation is allowed.
    final boolean
    True if and only if the use of the faucet of the gamete is allowed without a valid signature.
    final int
    Extra tax paid when a validator acquires the shares of another validator (in percent of the offer cost).
    final String
    The chain identifier of the node.
    The final supply of coins in the node.
    final String
    The genesis time, UTC, in ISO8601 pattern.
    final boolean
    True if and only if the node ignores the minimum gas price.
    The initial gas price.
    final long
    The initial inflation applied to the gas consumed by transactions before it gets sent as reward to the validators.
    The initial supply of red coins in the node.
    The initial supply of coins in the node.
    final long
    The maximal cumulative size (in bytes) of the instrumented jars of the dependencies of a transaction.
    final int
    The maximal number of dependencies in the classpath of a transaction.
    final int
    The maximal length of the error message kept in the store of the node.
    The maximal amount of gas that a non-view transaction can consume.
    final long
    How quick the gas consumed at previous rewards is forgotten: 0 means never, 1_000_000 means immediately.
    final int
    The amount of validators' rewards that gets staked.
    final String
    The Base64-encoded public key of the gamete account.
    final String
    The name of the signature algorithm for signing requests.
    final boolean
    True if and only if the static verification of the classes of the jars installed in the node must be skipped.
    final int
    The percent of stake that gets slashed for each misbehaving validator.
    final int
    The percent of stake that gets slashed for validators that do not behave (or do not vote).
    The units of gas that are aimed to be rewarded at each reward.
    The amount of coin to pay to start a new poll amount the validators, for instance in order to change a consensus parameter.
    final int
    The version of the verification module to use.
  • Method Summary

    Modifier and Type
    Method
    Description
    Chain a builder initialized with the information in this object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • genesisTime

      public final String genesisTime
      The genesis time, UTC, in ISO8601 pattern. It defaults to the time of construction of the builder of this object.
    • chainId

      public final String chainId
      The chain identifier of the node. It defaults to the empty string.
    • maxErrorLength

      public final int maxErrorLength
      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.
    • maxDependencies

      public final int maxDependencies
      The maximal number of dependencies in the classpath of a transaction. It defaults to 20.
    • maxCumulativeSizeOfDependencies

      public final long maxCumulativeSizeOfDependencies
      The maximal cumulative size (in bytes) of the instrumented jars of the dependencies of a transaction. It defaults to 10,000,000.
    • allowsSelfCharged

      public final boolean allowsSelfCharged
      True if and only if the use of the @@SelfCharged annotation is allowed. It defaults to false.
    • allowsUnsignedFaucet

      public final boolean allowsUnsignedFaucet
      True if and only if the use of the faucet of the gamete is allowed without a valid signature. It defaults to false.
    • allowsMintBurnFromGamete

      public final boolean allowsMintBurnFromGamete
      True if and only if the gamete of the node can 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.
    • skipsVerification

      public final boolean skipsVerification
      True if and only if the static verification of the classes of the jars installed in the node must be skipped. It defaults to false.
    • publicKeyOfGamete

      public final String publicKeyOfGamete
      The Base64-encoded public key of the gamete account.
    • initialGasPrice

      public final BigInteger initialGasPrice
      The initial gas price. It defaults to 100.
    • maxGasPerTransaction

      public final BigInteger maxGasPerTransaction
      The maximal amount of gas that a non-view transaction can consume. It defaults to 1_000_000_000.
    • ignoresGasPrice

      public final boolean ignoresGasPrice
      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. It defaults to false.
    • targetGasAtReward

      public final BigInteger targetGasAtReward
      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. This defaults to 1_000_000.
    • oblivion

      public final long oblivion
      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. A value of 0 means that the gas price is constant. It defaults to 250_000L.
    • initialInflation

      public final long initialInflation
      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%. This defaults to 10,000 (that is, inflation is 0.1% by default).
    • verificationVersion

      public final int verificationVersion
      The version of the verification module to use. It defaults to 0.
    • initialSupply

      public final BigInteger initialSupply
      The initial supply of coins in the node.
    • finalSupply

      public final BigInteger finalSupply
      The final supply of coins in the node. Once the current supply reaches this final amount, it remains constant.
    • initialRedSupply

      public final BigInteger initialRedSupply
      The initial supply of red coins in the node.
    • ticketForNewPoll

      public final BigInteger ticketForNewPoll
      The amount of coin to pay to start a new poll amount the validators, for instance in order to change a consensus parameter.
    • signature

      public final String signature
      The name of the signature algorithm for signing requests. It defaults to "ed25519".
    • percentStaked

      public final int percentStaked
      The amount of validators' rewards that gets staked. The rest is sent to the validators immediately. 1000000 = 1%. It defaults to 75%.
    • buyerSurcharge

      public final int buyerSurcharge
      Extra tax paid when a validator acquires the shares of another validator (in percent of the offer cost). 1000000 = 1%. It defaults to 50%.
    • slashingForMisbehaving

      public final int slashingForMisbehaving
      The percent of stake that gets slashed for each misbehaving validator. 1000000 means 1%. It defaults to 1%.
    • slashingForNotBehaving

      public final int slashingForNotBehaving
      The percent of stake that gets slashed for validators that do not behave (or do not vote). 1000000 means 1%. It defaults to 0.5%.
  • Method Details

    • toBuilder

      public ConsensusParams.Builder toBuilder()
      Chain a builder initialized with the information in this object.
      Returns:
      the builder