consensus

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: LGPL-3.0 Imports: 0 Imported by: 0

README

consensus

Src of consensus algorithm, obviously.

Documentation

Index

Constants

View Source
const (
	NetMessageEvent = "event.netmessage"
	NewBlockEvent   = "event.newblock"
	CanMiningEvent  = "event.canmining"
)

EventType list

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseEvent

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

BaseEvent is a kind of event structure

func (*BaseEvent) Data

func (e *BaseEvent) Data() interface{}

Data of an event instance

func (*BaseEvent) EventType

func (e *BaseEvent) EventType() EventType

EventType of an event instance

type Event

type Event interface {
	EventType() EventType
	Data() interface{}
}

Event in Consensus State-Machine

func NewBaseEvent

func NewBaseEvent(t EventType, data interface{}) Event

NewBaseEvent creates an event

type EventType

type EventType string

EventType of Events in Consensus State-Machine

type State

type State interface {
	Event(e Event) (bool, State)
	Enter(data interface{})
	Leave(data interface{})
}

State in Consensus State-Machine

Directories

Path Synopsis
Package consensuspb is a generated protocol buffer package.
Package consensuspb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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