Documentation ¶
Index ¶
- Variables
- func SetupInProcServer(t *testing.T) (*rpc.Server, *pandoraChainService)
- type DialRPCFn
- type Service
- func (s *Service) OnNewPendingHeader(ctx context.Context, header *eth1Types.Header) error
- func (s *Service) Resubscribe()
- func (s *Service) Start()
- func (s *Service) Status() error
- func (s *Service) Stop() error
- func (s *Service) SubscribeHeaderInfoEvent(ch chan<- *types.PandoraHeaderInfo) event.Subscription
- func (s *Service) SubscribePendingHeaders(ctx context.Context, crit *types.PandoraPendingHeaderFilter, namespace string, ...) (*rpc.ClientSubscription, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
EmptyHash = common.HexToHash("0000000000000000000000000000000000000000000000000000000000000000")
)
time to wait before trying to reconnect.
Functions ¶
Types ¶
type DialRPCFn ¶
DialRPCFn dials to the given endpoint
func DialInProcClient ¶
DialInProcClient creates in process client for pandora mocked server
func DialRPCClient ¶
func DialRPCClient() DialRPCFn
DialRPCClient creates in process client for pandora rpc server
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service
- maintains connection with pandora chain
- maintains db and cache to store the in-coming headers from pandora.
func NewService ¶
func NewService( ctx context.Context, endpoint string, namespace string, db db.ROnlyVerifiedShardInfoDB, cache cache.PandoraHeaderCache, dialRPCFn DialRPCFn, ) (*Service, error)
NewService creates new service with pandora ws or ipc endpoint, pandora service namespace and db
func SetupPandoraSvc ¶
SetupPandoraSvc creates pandora chain service with mocked pandora chain interop
func (*Service) OnNewPendingHeader ¶
OnNewPendingHeader :
- cache and store header and header hash with status
- send to consensus service for checking header with vanguard header for confirmation
func (*Service) Resubscribe ¶
func (s *Service) Resubscribe()
func (*Service) Start ¶
func (s *Service) Start()
Start a consensus info fetcher service's main event loop.
func (*Service) SubscribeHeaderInfoEvent ¶
func (s *Service) SubscribeHeaderInfoEvent(ch chan<- *types.PandoraHeaderInfo) event.Subscription
func (*Service) SubscribePendingHeaders ¶
func (s *Service) SubscribePendingHeaders( ctx context.Context, crit *types.PandoraPendingHeaderFilter, namespace string, client *rpc.Client, ) (*rpc.ClientSubscription, error)
subscribePendingHeaders subscribes to pandora client from latest saved slot using given rpc client
Click to show internal directories.
Click to hide internal directories.