vanguardchain

package
v0.1.0-develop Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: Apache-2.0 Imports: 33 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

  • maintains connection with vanguard chain
  • handles vanguard subscription for consensus info.
  • sends new consensus info to all pandora subscribers.
  • maintains consensusInfoDB to store the coming consensus info from vanguard.

func NewService

func NewService(
	ctx context.Context,
	vanGRPCEndpoint string,
	db db.Database,
	cache cache.VanguardShardCache,
) (*Service, error)

NewService creates new service with vanguard endpoint, vanguard namespace and consensusInfoDB

func (*Service) ReSubscribeBlocksEvent

func (s *Service) ReSubscribeBlocksEvent() error

ReSubscribeBlocksEvent method re-subscribe to vanguard block api.

func (*Service) Start

func (s *Service) Start()

Start a consensus info fetcher service's main event loop.

func (*Service) Status

func (s *Service) Status() error

func (*Service) Stop

func (s *Service) Stop() error

func (*Service) StopSubscription

func (s *Service) StopSubscription()

func (*Service) SubscribeMinConsensusInfoEvent

func (s *Service) SubscribeMinConsensusInfoEvent(ch chan<- *types.MinimalEpochConsensusInfoV2) event.Subscription

SubscribeMinConsensusInfoEvent registers a subscription of ChainHeadEvent.

func (*Service) SubscribeShardInfoEvent

func (s *Service) SubscribeShardInfoEvent(ch chan<- *types.VanguardShardInfo) event.Subscription

func (*Service) SubscribeShutdownSignalEvent

func (s *Service) SubscribeShutdownSignalEvent(ch chan<- *types.Reorg) event.Subscription

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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