consensus

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2019 License: GPL-3.0 Imports: 3 Imported by: 0

README

Consensus

Tetris source code here is incomplete, just for demo and poc purpose!

The complete core consensus package will be open sourced after mainnet release.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	// lifecycle controls
	Start() error
	Stop() error

	// engine event output channel
	ChanEventSend() <-chan []byte
	ChanEventReq() <-chan common.Hash

	// engine output channel
	Output() <-chan *Output

	// send event raw bytes to engine
	SendEvent([]byte)
	SendParentEvent([]byte)

	// send tx hash to engine
	SendTx(common.Hash)

	// inform engine txs has been sealed in block
	OnTxSealed(uint64, []common.Hash)
	// inform engine txs has been dropped
	OnTxDropped([]common.Hash)
}

Engine defines what a consensus engine provides

type Output

type Output struct {
	Txs    []common.Hash
	H      uint64
	T      time.Time
	Output string
}

output of consensus to generate a block at height H, with txs Txs

func (Output) String

func (o Output) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL