Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SimpleBlock ¶
SimpleBlock defines a basic block structure composed of blockheight and previous block hash.
func (*SimpleBlock) MarshalBinary ¶
func (b *SimpleBlock) MarshalBinary() ([]byte, error)
MarshalBinary implements the BinaryMarshaler interface for SimpleBlock
func (*SimpleBlock) UnmarshalBinary ¶
func (b *SimpleBlock) UnmarshalBinary(marshaled []byte) error
UnmarshalBinary implements the BinaryUnmarshaler interface for SimpleBlock
type SimpleLedger ¶
SimpleLedger implements `RequestConsumer` interface. It defines a queue of delivered messages as the `blockchain` and simply print out the new message.
func NewSimpleLedger ¶
func NewSimpleLedger() *SimpleLedger
NewSimpleLedger initializes an object of SimpleLedger
func (*SimpleLedger) Deliver ¶
func (l *SimpleLedger) Deliver(msg []byte) <-chan []byte
Deliver implements the RequestConsumer interface. It forwards the committed transaction message to the processing queue and returns the result
func (*SimpleLedger) GetLength ¶
func (l *SimpleLedger) GetLength() uint64
GetLength returns the number of the blocks in the ledger
func (*SimpleLedger) StateDigest ¶
func (l *SimpleLedger) StateDigest() []byte
StateDigest returns the hash of the latest block as the digest of the system state