dbft2

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBFT2Context

type DBFT2Context interface {
	GetView() int
	GetHeight() int
	GetBlockTime() int
	GetNumberOfNodes() int
}

func NewDBFT2Context

func NewDBFT2Context(view int, height int, blockTime int, numberOfNodes int) DBFT2Context

type DBFT2ContextService

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

func (*DBFT2ContextService) GetBlockTime

func (d *DBFT2ContextService) GetBlockTime() int

func (*DBFT2ContextService) GetHeight

func (d *DBFT2ContextService) GetHeight() int

func (*DBFT2ContextService) GetNumberOfNodes

func (d *DBFT2ContextService) GetNumberOfNodes() int

func (*DBFT2ContextService) GetView

func (d *DBFT2ContextService) GetView() int

type DBFT2Machine

type DBFT2Machine interface {
	// superclass TimedStateMachine
	// get / set
	GetClock() timing.Clock
	GetMe() int
	GetName() string
	// methods
	OnEnterState(current single.State, param single.Param)
	BeforeUpdateState(current single.State, param single.Param) bool
	AfterUpdateState(current single.State, param single.Param, updated bool) bool
	UpdateState(current single.State, param single.Param) (single.State, bool, error)
	IsFinal(current single.State, param single.Param) bool
	Initialize(current single.State, param single.Param) single.State
	OnFinished(current single.State, param single.Param)
	Run(current single.State, param single.Param) (single.State, error)

	// get / set
	GetMachines() []machine.SingleTimerStateMachine
	GetScheduledEvents() []replicated.ScheduledEvent
	GetWatchdog() timing.Timer
	SetWatchdog(timer timing.Timer)
	AddScheduleEvent(countdown float64, machine int, name string, eventParams []string)
	RegisterMachine(machine machine.SingleTimerStateMachine)
	LaunchScheduleEvents(param replicated.MultiContext) error
	InitializeMulti(current replicated.MultiState, param replicated.MultiContext) (replicated.MultiState, error)
	IsFinalMulti(current replicated.MultiState, param replicated.MultiContext) bool
	UpdateStateMulti(current replicated.MultiState, param replicated.MultiContext) (replicated.MultiState, bool, error)
	OnEnterStateMulti(current replicated.MultiState, param replicated.MultiContext)
	BeforeUpdateStateMulti(current replicated.MultiState, param replicated.MultiContext) bool

	// get / set
	GetFaultyNodes() int
	// methods
	FillStatesForMachine(me int) error
	FillSimpleCycle(me int) error

	StringFormat(format string) string
	String() string
	// contains filtered or unexported methods
}

func NewDBFT2Machine

func NewDBFT2Machine(faultyNodes int, numberOfMachines int, clock timing.Clock, me int, name string) (DBFT2Machine, error)

func NewDBFT2MachineMachines

func NewDBFT2MachineMachines(faultyNodes int, machines []machine.SingleTimerStateMachine, clock timing.Clock, me int, name string) (DBFT2Machine, error)

func NewDefaultDBFT2Machine

func NewDefaultDBFT2Machine(faultyNodes int, numberOfMachines int, clock timing.Clock, me int, name string) (DBFT2Machine, error)

type DBFT2MachineService

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

func (*DBFT2MachineService) AddScheduleEvent

func (d *DBFT2MachineService) AddScheduleEvent(countdown float64, machine int, name string, eventParams []string)

func (*DBFT2MachineService) AfterUpdateState

func (d *DBFT2MachineService) AfterUpdateState(current single.State, param single.Param, updated bool) bool

func (*DBFT2MachineService) BeforeUpdateState

func (d *DBFT2MachineService) BeforeUpdateState(current single.State, param single.Param) bool

func (*DBFT2MachineService) BeforeUpdateStateMulti

func (d *DBFT2MachineService) BeforeUpdateStateMulti(current replicated.MultiState, param replicated.MultiContext) bool

func (*DBFT2MachineService) FillSimpleCycle

func (d *DBFT2MachineService) FillSimpleCycle(me int) error

func (*DBFT2MachineService) FillStatesForMachine

func (d *DBFT2MachineService) FillStatesForMachine(me int) error

func (*DBFT2MachineService) GetClock

func (d *DBFT2MachineService) GetClock() timing.Clock

func (*DBFT2MachineService) GetFaultyNodes

func (d *DBFT2MachineService) GetFaultyNodes() int

func (*DBFT2MachineService) GetMachines

func (*DBFT2MachineService) GetMe

func (d *DBFT2MachineService) GetMe() int

func (*DBFT2MachineService) GetName

func (d *DBFT2MachineService) GetName() string

func (*DBFT2MachineService) GetScheduledEvents

func (d *DBFT2MachineService) GetScheduledEvents() []replicated.ScheduledEvent

func (*DBFT2MachineService) GetWatchdog

func (d *DBFT2MachineService) GetWatchdog() timing.Timer

func (*DBFT2MachineService) Initialize

func (d *DBFT2MachineService) Initialize(current single.State, param single.Param) single.State

func (*DBFT2MachineService) InitializeMulti

func (*DBFT2MachineService) IsFinal

func (d *DBFT2MachineService) IsFinal(current single.State, param single.Param) bool

func (*DBFT2MachineService) IsFinalMulti

func (d *DBFT2MachineService) IsFinalMulti(current replicated.MultiState, param replicated.MultiContext) bool

func (*DBFT2MachineService) LaunchScheduleEvents

func (d *DBFT2MachineService) LaunchScheduleEvents(param replicated.MultiContext) error

func (*DBFT2MachineService) OnEnterState

func (d *DBFT2MachineService) OnEnterState(current single.State, param single.Param)

func (*DBFT2MachineService) OnEnterStateMulti

func (d *DBFT2MachineService) OnEnterStateMulti(current replicated.MultiState, param replicated.MultiContext)

func (*DBFT2MachineService) OnFinished

func (d *DBFT2MachineService) OnFinished(current single.State, param single.Param)

func (*DBFT2MachineService) RegisterMachine

func (d *DBFT2MachineService) RegisterMachine(machine machine.SingleTimerStateMachine)

func (*DBFT2MachineService) Run

func (d *DBFT2MachineService) Run(current single.State, param single.Param) (single.State, error)

func (*DBFT2MachineService) SetWatchdog

func (d *DBFT2MachineService) SetWatchdog(timer timing.Timer)

func (*DBFT2MachineService) String

func (d *DBFT2MachineService) String() string

func (*DBFT2MachineService) StringFormat

func (d *DBFT2MachineService) StringFormat(format string) string

func (*DBFT2MachineService) UpdateState

func (d *DBFT2MachineService) UpdateState(current single.State, param single.Param) (single.State, bool, error)

func (*DBFT2MachineService) UpdateStateMulti

Jump to

Keyboard shortcuts

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