consensus

package
v0.0.23-etha Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	VanguardHeaderHashDB      iface.VanHeaderAccessDatabase
	PandoraHeaderHashDB       iface.PanHeaderAccessDatabase
	RealmDB                   iface.RealmAccessDatabase
	VanguardHeadersChan       chan *types.HeaderHash
	VanguardConsensusInfoChan chan *types.MinimalEpochConsensusInfo
	PandoraHeadersChan        chan *types.HeaderHash
	// contains filtered or unexported fields
}

Service This part could be moved to other place during refactor, might be registered as a service

func New

func New(
	ctx context.Context,
	database db.Database,
	vanguardHeadersChan chan *types.HeaderHash,
	vanguardConsensusInfoChan chan *types.MinimalEpochConsensusInfo,
	pandoraHeadersChan chan *types.HeaderHash,
) (service *Service)

func (*Service) Canonicalize

func (service *Service) Canonicalize(
	fromSlot uint64,
	batchLimit uint64,
) (
	vanguardErr error,
	pandoraErr error,
	realmErr error,
)

Canonicalize must be called numerous of times with different from slot new slots may arrive after canonicalization, so Canonicalize must be invoked again function must be working only on started service

func (*Service) Start

func (service *Service) Start()

Start service should be registered only after Pandora and Vanguard notified about: - consensus info (Vanguard) - pendingHeaders (Vanguard) - pendingHeaders (Pandora) In current implementation we use debounce to determine state of syncing

func (*Service) Status

func (service *Service) Status() error

func (*Service) Stop

func (service *Service) Stop() error

Jump to

Keyboard shortcuts

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