pandorachain

package
v0.0.0-theta.test3 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: Apache-2.0 Imports: 15 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.Database,
	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) 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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