Struct BlockHeader
Block header containing information about Block<T>s except transactions.
Namespace: Libplanet.Blocks
Assembly: Libplanet.dll
Syntax
public struct BlockHeader
Constructors
| Improve this Doc View SourceBlockHeader(Bencodex.Types.Dictionary)
Declaration
public BlockHeader(Bencodex.Types.Dictionary dict)
Parameters
Type | Name | Description |
---|---|---|
Bencodex.Types.Dictionary | dict |
BlockHeader(Int64, String, ImmutableArray<Byte>, ImmutableArray<Byte>, Int64, ImmutableArray<Byte>, ImmutableArray<Byte>, ImmutableArray<Byte>)
Creates a BlockHeader instance.
Declaration
public BlockHeader(long index, string timestamp, ImmutableArray<byte> nonce, ImmutableArray<byte> miner, long difficulty, ImmutableArray<byte> previousHash, ImmutableArray<byte> txHash, ImmutableArray<byte> hash)
Parameters
Type | Name | Description |
---|---|---|
Int64 | index | The height of the block. Goes to the Index. |
String | timestamp | The time this block is created. Goes to the Timestamp. |
ImmutableArray<Byte> | nonce | The nonce which satisfy the given |
ImmutableArray<Byte> | miner | An optional address refers to who mines this block. Goes to the Miner. |
Int64 | difficulty | The mining difficulty that |
ImmutableArray<Byte> | previousHash | The previous block's Hash. If it's a genesis
block (i.e., |
ImmutableArray<Byte> | txHash | The result of hashing the transactions the block has. Goes to the TxHash. |
ImmutableArray<Byte> | hash |
Properties
| Improve this Doc View SourceDifficulty
Declaration
public long Difficulty { get; }
Property Value
Type | Description |
---|---|
Int64 |
Hash
Declaration
public ImmutableArray<byte> Hash { get; }
Property Value
Type | Description |
---|---|
ImmutableArray<Byte> |
Index
Declaration
public long Index { get; }
Property Value
Type | Description |
---|---|
Int64 |
Miner
Declaration
public ImmutableArray<byte> Miner { get; }
Property Value
Type | Description |
---|---|
ImmutableArray<Byte> |
Nonce
Declaration
public ImmutableArray<byte> Nonce { get; }
Property Value
Type | Description |
---|---|
ImmutableArray<Byte> |
PreviousHash
Declaration
public ImmutableArray<byte> PreviousHash { get; }
Property Value
Type | Description |
---|---|
ImmutableArray<Byte> |
Timestamp
Declaration
public string Timestamp { get; }
Property Value
Type | Description |
---|---|
String |
TxHash
Declaration
public ImmutableArray<byte> TxHash { get; }
Property Value
Type | Description |
---|---|
ImmutableArray<Byte> |
Methods
| Improve this Doc View SourceDeserialize(Byte[])
Gets BlockHeader instance from serialized bytes
.
Declaration
public static BlockHeader Deserialize(byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | bytes | Serialized BlockHeader. |
Returns
Type | Description |
---|---|
BlockHeader | Deserialized BlockHeader. |
Serialize()
Gets serialized byte array of the BlockHeader.
Declaration
public byte[] Serialize()
Returns
Type | Description |
---|---|
Byte[] | Serialized byte array of BlockHeader. |
ToBencodex()
Gets
Declaration
public Bencodex.Types.Dictionary ToBencodex()
Returns
Type | Description |
---|---|
Bencodex.Types.Dictionary |