syncer

package
v0.0.0-...-77d485b Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockInterceptor

func BlockInterceptor(srv *Service, network utils.Network, networkId utils.NetworkID, direction SyncDirection) func(block *types.Block) (*types.Block, error)

BlockInterceptor -

func InjectSubscribers

func InjectSubscribers(service *Service, network utils.Network, networkId utils.NetworkID) error

InjectSubscribers will look into map of the subscribers and attempt to register them against subscriber manager. In case of any issues, it will sequentially fail. It's deliberate to fail on sequence instead of spawning goroutines and returning back errors.

func Run

func Run(ctx *cli.Context) error

func UnpackerInterceptor

func UnpackerInterceptor(srv *Service) func(event *events.Unpack) error

Types

type Server

type Server struct {
	*Service

	server_pb.UnimplementedUnpackServer
	// contains filtered or unexported fields
}

func NewGRPCServer

func NewGRPCServer(ctx context.Context, service *Service) (*Server, error)

func (*Server) Start

func (s *Server) Start() error

func (*Server) Unpack

func (s *Server) Unpack(ctx context.Context, req *server_pb.UnpackRequest) (resp *server_pb.UnpackResponse, err error)

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(ctx *cli.Context) (*Service, error)

func NewService

func NewService(ctx context.Context) (*Service, error)

func (*Service) Start

func (s *Service) Start(network utils.Network, networkId utils.NetworkID) error

func (*Service) Unpack

func (s *Service) Unpack(ctx *cli.Context) error

Unpack ...

func (*Service) UnpackFromEntry

func (s *Service) UnpackFromEntry(ctx context.Context, entry *entries.Entry, state machine.State) (*unpacker.Descriptor, error)

type SyncDirection

type SyncDirection string
var (
	HeadSyncDirection    SyncDirection = "head"
	ArchiveSyncDirection SyncDirection = "archive"
)

func (SyncDirection) String

func (s SyncDirection) String() string

Jump to

Keyboard shortcuts

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