Class Block.Builder

  • Enclosing class:
    Block

    public abstract static class Block.Builder
    extends Object
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • blockHash

        public abstract Block.Builder blockHash​(HashCode hash)
        Sets the hash of the block binary representation.
      • proposerId

        public abstract Block.Builder proposerId​(int proposerId)
        Sets the identifier of the leader node which has proposed the block.
      • height

        public abstract Block.Builder height​(long height)
        Sets the block height, which is the distance between the block and the genesis block, which has zero height. Must be non-negative.
      • numTransactions

        public abstract Block.Builder numTransactions​(int numTransactions)
        Sets the number of transactions in this block. Must be non-negative.
      • previousBlockHash

        public abstract Block.Builder previousBlockHash​(HashCode previousBlockHash)
        Sets the hash of the previous block in the hash chain. The previous block is the block with the height, that is equal to this minus one. Genesis block has a previous hash of zeroes.
      • stateHash

        public abstract Block.Builder stateHash​(HashCode blockchainStateHash)
        Sets the blockchain state hash at the moment this block was committed. The blockchain state hash reflects the state of each service in the database.
        See Also:
        Schema.getStateHashes()
      • build

        public Block build()
        Creates a new block with the set arguments.
        Throws:
        IllegalStateException - if some of the arguments were not set or aren't valid