pandorachain

package
v0.0.16-theta Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupInProcServer

func SetupInProcServer(t *testing.T) (*rpc.Server, *pandoraChainService)

SetupInProcServer

Types

type DialRPCFn

type DialRPCFn func(endpoint string) (*rpc.Client, error)

DialRPCFn dials to the given endpoint

func DialInProcClient

func DialInProcClient(server *rpc.Server) DialRPCFn

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.PandoraHeaderHashDB, cache cache.PandoraHeaderCache, dialRPCFn DialRPCFn) (*Service, error)

NewService creates new service with pandora ws or ipc endpoint, pandora service namespace and db

func SetupPandoraSvc

func SetupPandoraSvc(ctx context.Context, t *testing.T, dialRPCFn DialRPCFn) *Service

SetupPandoraSvc creates pandora chain service with mocked pandora chain interop

func (*Service) OnNewPendingHeader

func (s *Service) OnNewPendingHeader(ctx context.Context, header *eth1Types.Header) error

OnNewPendingHeader :

  • cache and store header and header hash with status
  • send to consensus service for checking header with vanguard header for confirmation

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) 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

Jump to

Keyboard shortcuts

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