Class Block
A block from the Hiero block stream: the unit of consensus output containing events, transactions, results, state changes and traces for one consensus round, framed by a header, footer and proof.
Implements
Inherited Members
Namespace: Hiero.BlockNode
Assembly: Hiero.dll
Syntax
[Experimental("HIERO001", UrlFormat = "https://github.com/bugbytesinc/Hiero/blob/main/docs/blocknode-client-plan.md")]
public sealed record Block : IEquatable<Block>
Remarks
The universally-needed header fields (number, timestamp, versions) and the footer/proof are promoted to typed properties; everything else is available in wire order through Items, each item exposing the underlying protobuf via ToProtobuf(). The full block round-trips losslessly through ToProtobuf() and FromProtobuf(Block).
Properties
| Edit this page View SourceFooter
The block footer carrying the chaining merkle roots, or
null
when absent (e.g. a filtered or still incomplete block).
Declaration
public BlockFooter? Footer { get; }
Property Value
| Type | Description |
|---|---|
| BlockFooter |
HapiVersion
The version of the HAPI protobuf specification the block was produced under.
Declaration
public SemanticVersion HapiVersion { get; }
Property Value
| Type | Description |
|---|---|
| SemanticVersion |
Items
All block items in wire order (header first; footer and proof last when present).
Declaration
public IReadOnlyList<BlockItem> Items { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<BlockItem> |
Number
The block number (monotonically increasing from genesis).
Declaration
public ulong Number { get; }
Property Value
| Type | Description |
|---|---|
| ulong |
Proof
The block proof, or
null
when the block is not yet proven or the proof was filtered out.
Declaration
public BlockProof? Proof { get; }
Property Value
| Type | Description |
|---|---|
| BlockProof |
SoftwareVersion
The version of the consensus node software that produced the block.
Declaration
public SemanticVersion SoftwareVersion { get; }
Property Value
| Type | Description |
|---|---|
| SemanticVersion |
Timestamp
The consensus timestamp of the start of this block.
Declaration
public ConsensusTimeStamp Timestamp { get; }
Property Value
| Type | Description |
|---|---|
| ConsensusTimeStamp |
VerifiedRootHash
The SHA-384 merkle root hash this client computed for the block; populated only when the block was obtained with HashChain verification (or an explicitly verified query), empty otherwise. Persist together with Number as a BlockStreamCheckpoint to resume verified streaming across process restarts.
Declaration
public ReadOnlyMemory<byte> VerifiedRootHash { get; }
Property Value
| Type | Description |
|---|---|
| ReadOnlyMemory<byte> |
Methods
| Edit this page View SourceFromProtobuf(Block)
Constructs a
Block
from a raw block stream protobuf (round-trip counterpart of ToProtobuf(); also the entry point for constructing blocks to publish).
Declaration
public static Block FromProtobuf(Block block)
Parameters
| Type | Name | Description |
|---|---|---|
| Block | block | The protobuf block to wrap. |
Returns
| Type | Description |
|---|---|
| Block |
exposing the protobuf's content. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | If the block is null. |
ToProtobuf()
Returns the underlying block stream protobuf — the lossless escape hatch to the complete block structure.
Declaration
public Block ToProtobuf()
Returns
| Type | Description |
|---|---|
| Block |