follower

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: AGPL-3.0 Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BootstrapNodeInfo

type BootstrapNodeInfo struct {
	Host             string // ip or hostname
	Port             uint
	NetworkPublicKey crypto.PublicKey // the network public key of the bootstrap peer
}

BootstrapNodeInfo contains the details about the upstream bootstrap peer the consensus follower uses

type Config

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

Config contains the configurable fields for a `ConsensusFollower`.

type ConsensusFollower

type ConsensusFollower interface {
	component.Component
	// Run starts the consensus follower.
	Run(context.Context)
	// AddOnBlockFinalizedConsumer adds a new block finalization subscriber.
	AddOnBlockFinalizedConsumer(pubsub.OnBlockFinalizedConsumer)
}

ConsensusFollower is a standalone module run by third parties which provides a mechanism for observing the block chain. It maintains a set of subscribers and delivers block proposals broadcasted by the consensus nodes to each one.

type ConsensusFollowerImpl

type ConsensusFollowerImpl struct {
	component.Component
	*cmd.NodeConfig
	// contains filtered or unexported fields
}

func NewConsensusFollower

func NewConsensusFollower(
	networkPrivKey crypto.PrivateKey,
	bindAddr string,
	bootstapIdentities []BootstrapNodeInfo,
	opts ...Option,
) (*ConsensusFollowerImpl, error)

NewConsensusFollower creates a new consensus follower.

func (*ConsensusFollowerImpl) AddOnBlockFinalizedConsumer

func (cf *ConsensusFollowerImpl) AddOnBlockFinalizedConsumer(consumer pubsub.OnBlockFinalizedConsumer)

AddOnBlockFinalizedConsumer adds a new block finalization subscriber.

func (*ConsensusFollowerImpl) Run

func (cf *ConsensusFollowerImpl) Run(ctx context.Context)

Run starts the consensus follower. This may also be implemented directly in a calling library to take advantage of error recovery possible with the irrecoverable error handling.

type Option

type Option func(c *Config)

func WithBootstrapDir

func WithBootstrapDir(bootstrapDir string) Option

func WithDB added in v0.21.1

func WithDB(db *badger.DB) Option

WithDB sets the underlying database that will be used to store the chain state WithDB takes precedence over WithDataDir and datadir will be set to empty if DB is set using this option

func WithDataDir

func WithDataDir(dataDir string) Option

WithDataDir sets the underlying directory to be used to store the database If a database is supplied, then data directory will be set to empty string

func WithExposeMetrics added in v0.24.7

func WithExposeMetrics(expose bool) Option

func WithLogLevel added in v0.21.1

func WithLogLevel(level string) Option

func WithSyncCoreConfig added in v0.26.0

func WithSyncCoreConfig(config *synchronization.Config) Option

Jump to

Keyboard shortcuts

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