consensus

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: AGPL-3.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithMaxInterval

func WithMaxInterval(maxInterval time.Duration) func(*Config)

func WithMaxSealCount

func WithMaxSealCount(maxSealCount uint) func(*Config)

func WithMinInterval

func WithMinInterval(minInterval time.Duration) func(*Config)

Types

type Builder

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

Builder is the builder for consensus block payloads. Upon providing a payload hash, it also memorizes which entities were included into the payload.

func NewBuilder

func NewBuilder(
	metrics module.MempoolMetrics,
	db *badger.DB,
	state protocol.State,
	headers storage.Headers,
	seals storage.Seals,
	index storage.Index,
	guarPool mempool.Guarantees,
	sealPool mempool.Seals,
	tracer module.Tracer,
	options ...func(*Config),
) *Builder

NewBuilder creates a new block builder.

func (*Builder) BuildOn

func (b *Builder) BuildOn(parentID flow.Identifier, setter func(*flow.Header) error) (*flow.Header, error)

BuildOn creates a new block header build on the provided parent, using the given view and applying the custom setter function to allow the caller to make changes to the header before storing it.

type Config

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

Jump to

Keyboard shortcuts

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