header

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 5 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 {
	// contains filtered or unexported fields
}

Service represents the header service that can be started / stopped on a node. Service's main function is to manage its sub-services. Service can contain several sub-services, such as Exchange, ExchangeServer, Syncer, and so forth.

func NewHeaderService

func NewHeaderService(
	syncer *sync.Syncer,
	sub header.Subscriber,
	p2pServer *p2p.ExchangeServer,
	ex header.Exchange,
	store header.Store) *Service

NewHeaderService creates a new instance of header Service.

func (*Service) GetByHeight added in v0.3.0

func (s *Service) GetByHeight(ctx context.Context, height uint64) (*header.ExtendedHeader, error)

GetByHeight returns the ExtendedHeader at the given height, blocking until header has been processed by the store or context deadline is exceeded.

func (*Service) Head added in v0.3.0

func (s *Service) Head(ctx context.Context) (*header.ExtendedHeader, error)

Head returns the ExtendedHeader of the chain head.

func (*Service) IsSyncing added in v0.2.0

func (s *Service) IsSyncing() bool

IsSyncing returns the status of sync

func (*Service) Start

func (s *Service) Start(context.Context) error

Start starts the header Service.

func (*Service) Stop

func (s *Service) Stop(context.Context) error

Stop stops the header Service.

Jump to

Keyboard shortcuts

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