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. |
dict |
BlockHeader(Int64, String, ImmutableArray<Byte>, ImmutableArray<Byte>, Int64, ImmutableArray<Byte>, ImmutableArray<Byte>, ImmutableArray<Byte>)
Creates a Block
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. |
Immutable |
nonce | The nonce which satisfy the given |
Immutable |
miner | An optional address refers to who mines this block. Goes to the Miner. |
Int64 | difficulty | The mining difficulty that |
Immutable |
previousHash | The previous block's Hash. If it's a genesis
block (i.e., |
Immutable |
txHash | The result of hashing the transactions the block has.
Goes to the Tx |
Immutable |
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 |
---|---|
Immutable |
Index
Declaration
public long Index { get; }
Property Value
Type | Description |
---|---|
Int64 |
Miner
Declaration
public ImmutableArray<byte> Miner { get; }
Property Value
Type | Description |
---|---|
Immutable |
Nonce
Declaration
public ImmutableArray<byte> Nonce { get; }
Property Value
Type | Description |
---|---|
Immutable |
PreviousHash
Declaration
public ImmutableArray<byte> PreviousHash { get; }
Property Value
Type | Description |
---|---|
Immutable |
Timestamp
Declaration
public string Timestamp { get; }
Property Value
Type | Description |
---|---|
String |
TxHash
Declaration
public ImmutableArray<byte> TxHash { get; }
Property Value
Type | Description |
---|---|
Immutable |
Methods
| Improve this Doc View SourceDeserialize(Byte[])
Gets Blockbytes
.
Declaration
public static BlockHeader Deserialize(byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | bytes | Serialized Block |
Returns
Type | Description |
---|---|
Block |
Deserialized Block |
Serialize()
Gets serialized byte array of the Block
Declaration
public byte[] Serialize()
Returns
Type | Description |
---|---|
Byte[] | Serialized byte array of Block |
ToBencodex()
Gets
Declaration
public Bencodex.Types.Dictionary ToBencodex()
Returns
Type | Description |
---|---|
Bencodex. |