builder

package
v0.0.0-...-3f8a4bd Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: BSD-3-Clause Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	Run()
	TriggerBuild()
	HandleGenerateBlock()
	Done() // wait after stop
}

type Manual

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

func NewManual

func NewManual(vm VM) *Manual

func (*Manual) Done

func (b *Manual) Done()

func (*Manual) HandleGenerateBlock

func (*Manual) HandleGenerateBlock()

func (*Manual) Run

func (b *Manual) Run()

func (*Manual) TriggerBuild

func (b *Manual) TriggerBuild()

type Time

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

Time tells the engine when to build blocks and gossip transactions

func NewTime

func NewTime(vm VM, cfg *TimeConfig) *Time

func (*Time) Done

func (b *Time) Done()

func (*Time) HandleGenerateBlock

func (b *Time) HandleGenerateBlock()

HandleGenerateBlock should be called immediately after [BuildBlock]. [HandleGenerateBlock] invocation could lead to quiesence, building a block with some delay, or attempting to build another block immediately.

func (*Time) Run

func (b *Time) Run()

func (*Time) TriggerBuild

func (b *Time) TriggerBuild()

type TimeConfig

type TimeConfig struct {
	PreferredBlocksPerSecond uint64
	BuildInterval            time.Duration
}

func DefaultTimeConfig

func DefaultTimeConfig() *TimeConfig

type VM

type VM interface {
	StopChan() chan struct{}
	EngineChan() chan<- common.Message
	PreferredBlock(context.Context) (*chain.StatelessBlock, error)
	Logger() logging.Logger
	Mempool() chain.Mempool
}

Jump to

Keyboard shortcuts

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