tetris

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: 10 Imported by: 1

Documentation

Index

Constants

View Source
const COMMITTABLE_UNDECIDED = -1
View Source
const ROUND_UNDECIDED = -1

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsensusOutput

type ConsensusOutput struct {
	Tx []string
	// contains filtered or unexported fields
}

type ConsensusOutput string

type Event

type Event struct {
	Body EventBody
	// contains filtered or unexported fields
}

func NewEvent

func NewEvent(height uint64, member uint, sequenceNumber uint64) Event

func NewPulse

func NewPulse(member uint) Event

func (*Event) Hash

func (e *Event) Hash() []byte

func (*Event) Hex

func (e *Event) Hex() string

func (*Event) Marshal

func (e *Event) Marshal() []byte

func (*Event) Unmarshal

func (e *Event) Unmarshal(data []byte)

type EventBody

type EventBody struct {
	H  uint64   //Block Height
	M  uint     //MemberID
	N  uint64   //Sequence Number, M和N唯一决定一个Event
	T  int64    //Timestamps, 用unixNano时间, 一秒等于10的9次方nano,只能表示到1678-2262年
	Tx []string //Transactions List
	E  []string //Parents Events, 0 for self parent
	F  []string //Fork Events, as Invalid
	// contains filtered or unexported fields
}

type ICore

type ICore interface {
}

type Metrics

type Metrics struct {
}

type Params

type Params struct {
	// contains filtered or unexported fields
}

type SyncRequest

type SyncRequest struct {
	// contains filtered or unexported fields
}

type Tetris

type Tetris struct {
	EventCh       chan Event
	ParentEventCh chan Event
	TxsCh         chan string

	OutputCh       chan ConsensusOutput
	SendEventCh    chan Event
	RequestEventCh chan string
	// contains filtered or unexported fields
}

func NewTetris

func NewTetris(core ICore, members map[string]uint, blockHeight uint64, mid string) (*Tetris, error)

func (*Tetris) MajorityBeatTime

func (c *Tetris) MajorityBeatTime() (ok bool, duration time.Duration)

func (*Tetris) MemberRotate

func (c *Tetris) MemberRotate(joins []string, quits []string)

func (*Tetris) Start

func (t *Tetris) Start() error

func (*Tetris) Stop

func (t *Tetris) Stop() error

Jump to

Keyboard shortcuts

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