Documentation ¶
Index ¶
- type Service
- func (s *Service) GetByHeight(ctx context.Context, height uint64) (*header.ExtendedHeader, error)
- func (s *Service) Head(ctx context.Context) (*header.ExtendedHeader, error)
- func (s *Service) IsSyncing() bool
- func (s *Service) Start(context.Context) error
- func (s *Service) Stop(context.Context) error
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
GetByHeight returns the ExtendedHeader at the given height, blocking until header has been processed by the store or context deadline is exceeded.
Click to show internal directories.
Click to hide internal directories.