Package io.nem.symbol.catapult.builders
Class BlockHeaderBuilder
- java.lang.Object
-
- io.nem.symbol.catapult.builders.BlockHeaderBuilder
-
- All Implemented Interfaces:
Serializer
public class BlockHeaderBuilder extends java.lang.Object implements Serializer
Binary layout for a block header
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBlockHeaderBuilder(SignatureDto signature, KeyDto signerPublicKey, byte version, NetworkTypeDto network, EntityTypeDto type, HeightDto height, TimestampDto timestamp, DifficultyDto difficulty, VrfProofBuilder generationHashProof, Hash256Dto previousBlockHash, Hash256Dto transactionsHash, Hash256Dto receiptsHash, Hash256Dto stateHash, KeyDto beneficiaryPublicKey, BlockFeeMultiplierDto feeMultiplier)Constructor.protectedBlockHeaderBuilder(java.io.DataInputStream stream)Constructor - Creates an object from stream.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BlockHeaderBuildercreate(SignatureDto signature, KeyDto signerPublicKey, byte version, NetworkTypeDto network, EntityTypeDto type, HeightDto height, TimestampDto timestamp, DifficultyDto difficulty, VrfProofBuilder generationHashProof, Hash256Dto previousBlockHash, Hash256Dto transactionsHash, Hash256Dto receiptsHash, Hash256Dto stateHash, KeyDto beneficiaryPublicKey, BlockFeeMultiplierDto feeMultiplier)Creates an instance of BlockHeaderBuilder.KeyDtogetBeneficiaryPublicKey()Gets beneficiary public key designated by harvester.intgetBlockHeader_Reserved1()Gets reserved padding to align end of BlockHeader on 8-byte boundary.DifficultyDtogetDifficulty()Gets block difficulty.intgetEntityBody_Reserved1()Gets reserved padding to align end of EntityBody on 8-byte boundary.BlockFeeMultiplierDtogetFeeMultiplier()Gets fee multiplier applied to block transactions.VrfProofBuildergetGenerationHashProof()Gets generation hash proof.HeightDtogetHeight()Gets block height.NetworkTypeDtogetNetwork()Gets entity network.Hash256DtogetPreviousBlockHash()Gets previous block hash.Hash256DtogetReceiptsHash()Gets hash of the receipts generated by this block.SignatureDtogetSignature()Gets entity signature.KeyDtogetSignerPublicKey()Gets entity signer's public key.intgetSize()Gets the size of the object.Hash256DtogetStateHash()Gets hash of the global chain state at this block.intgetStreamSize()Gets entity size.TimestampDtogetTimestamp()Gets number of milliseconds elapsed since creation of nemesis block.Hash256DtogetTransactionsHash()Gets hash of the transactions in this block.EntityTypeDtogetType()Gets entity type.intgetVerifiableEntityHeader_Reserved1()Gets reserved padding to align Signature on 8-byte boundary.bytegetVersion()Gets entity version.static BlockHeaderBuilderloadFromBinary(java.io.DataInputStream stream)Creates an instance of BlockHeaderBuilder from a stream.byte[]serialize()Serializes an object to bytes.
-
-
-
Constructor Detail
-
BlockHeaderBuilder
protected BlockHeaderBuilder(java.io.DataInputStream stream)
Constructor - Creates an object from stream.- Parameters:
stream- Byte stream to use to serialize the object.
-
BlockHeaderBuilder
protected BlockHeaderBuilder(SignatureDto signature, KeyDto signerPublicKey, byte version, NetworkTypeDto network, EntityTypeDto type, HeightDto height, TimestampDto timestamp, DifficultyDto difficulty, VrfProofBuilder generationHashProof, Hash256Dto previousBlockHash, Hash256Dto transactionsHash, Hash256Dto receiptsHash, Hash256Dto stateHash, KeyDto beneficiaryPublicKey, BlockFeeMultiplierDto feeMultiplier)
Constructor.- Parameters:
signature- Entity signature.signerPublicKey- Entity signer's public key.version- Entity version.network- Entity network.type- Entity type.height- Block height.timestamp- Number of milliseconds elapsed since creation of nemesis block.difficulty- Block difficulty.generationHashProof- Generation hash proof.previousBlockHash- Previous block hash.transactionsHash- Hash of the transactions in this block.receiptsHash- Hash of the receipts generated by this block.stateHash- Hash of the global chain state at this block.beneficiaryPublicKey- Beneficiary public key designated by harvester.feeMultiplier- Fee multiplier applied to block transactions.
-
-
Method Detail
-
loadFromBinary
public static BlockHeaderBuilder loadFromBinary(java.io.DataInputStream stream)
Creates an instance of BlockHeaderBuilder from a stream.- Parameters:
stream- Byte stream to use to serialize the object.- Returns:
- Instance of BlockHeaderBuilder.
-
create
public static BlockHeaderBuilder create(SignatureDto signature, KeyDto signerPublicKey, byte version, NetworkTypeDto network, EntityTypeDto type, HeightDto height, TimestampDto timestamp, DifficultyDto difficulty, VrfProofBuilder generationHashProof, Hash256Dto previousBlockHash, Hash256Dto transactionsHash, Hash256Dto receiptsHash, Hash256Dto stateHash, KeyDto beneficiaryPublicKey, BlockFeeMultiplierDto feeMultiplier)
Creates an instance of BlockHeaderBuilder.- Parameters:
signature- Entity signature.signerPublicKey- Entity signer's public key.version- Entity version.network- Entity network.type- Entity type.height- Block height.timestamp- Number of milliseconds elapsed since creation of nemesis block.difficulty- Block difficulty.generationHashProof- Generation hash proof.previousBlockHash- Previous block hash.transactionsHash- Hash of the transactions in this block.receiptsHash- Hash of the receipts generated by this block.stateHash- Hash of the global chain state at this block.beneficiaryPublicKey- Beneficiary public key designated by harvester.feeMultiplier- Fee multiplier applied to block transactions.- Returns:
- Instance of BlockHeaderBuilder.
-
getStreamSize
public int getStreamSize()
Gets entity size.- Returns:
- Entity size.
-
getVerifiableEntityHeader_Reserved1
public int getVerifiableEntityHeader_Reserved1()
Gets reserved padding to align Signature on 8-byte boundary.- Returns:
- Reserved padding to align Signature on 8-byte boundary.
-
getSignature
public SignatureDto getSignature()
Gets entity signature.- Returns:
- Entity signature.
-
getSignerPublicKey
public KeyDto getSignerPublicKey()
Gets entity signer's public key.- Returns:
- Entity signer's public key.
-
getEntityBody_Reserved1
public int getEntityBody_Reserved1()
Gets reserved padding to align end of EntityBody on 8-byte boundary.- Returns:
- Reserved padding to align end of EntityBody on 8-byte boundary.
-
getVersion
public byte getVersion()
Gets entity version.- Returns:
- Entity version.
-
getNetwork
public NetworkTypeDto getNetwork()
Gets entity network.- Returns:
- Entity network.
-
getType
public EntityTypeDto getType()
Gets entity type.- Returns:
- Entity type.
-
getHeight
public HeightDto getHeight()
Gets block height.- Returns:
- Block height.
-
getTimestamp
public TimestampDto getTimestamp()
Gets number of milliseconds elapsed since creation of nemesis block.- Returns:
- Number of milliseconds elapsed since creation of nemesis block.
-
getDifficulty
public DifficultyDto getDifficulty()
Gets block difficulty.- Returns:
- Block difficulty.
-
getGenerationHashProof
public VrfProofBuilder getGenerationHashProof()
Gets generation hash proof.- Returns:
- Generation hash proof.
-
getPreviousBlockHash
public Hash256Dto getPreviousBlockHash()
Gets previous block hash.- Returns:
- Previous block hash.
-
getTransactionsHash
public Hash256Dto getTransactionsHash()
Gets hash of the transactions in this block.- Returns:
- Hash of the transactions in this block.
-
getReceiptsHash
public Hash256Dto getReceiptsHash()
Gets hash of the receipts generated by this block.- Returns:
- Hash of the receipts generated by this block.
-
getStateHash
public Hash256Dto getStateHash()
Gets hash of the global chain state at this block.- Returns:
- Hash of the global chain state at this block.
-
getBeneficiaryPublicKey
public KeyDto getBeneficiaryPublicKey()
Gets beneficiary public key designated by harvester.- Returns:
- Beneficiary public key designated by harvester.
-
getFeeMultiplier
public BlockFeeMultiplierDto getFeeMultiplier()
Gets fee multiplier applied to block transactions.- Returns:
- Fee multiplier applied to block transactions.
-
getBlockHeader_Reserved1
public int getBlockHeader_Reserved1()
Gets reserved padding to align end of BlockHeader on 8-byte boundary.- Returns:
- Reserved padding to align end of BlockHeader on 8-byte boundary.
-
getSize
public int getSize()
Gets the size of the object.- Specified by:
getSizein interfaceSerializer- Returns:
- Size in bytes.
-
serialize
public byte[] serialize()
Serializes an object to bytes.- Specified by:
serializein interfaceSerializer- Returns:
- Serialized bytes.
-
-