blockstream

package
v0.0.2-0...-d05d5d5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

func NewBufferedServer

func NewBufferedServer(server dgrpcserver.Server, size int, opts ...ServerOption) *Server

func NewServer

func NewServer(server dgrpcserver.Server, opts ...ServerOption) *Server

func NewUnmanagedServer

func NewUnmanagedServer(opts ...ServerOption) *Server

NewUnmanagedServer can be used to create a BlockStream server that has no control over the actual gRPC server. Registration of services should be made manually by entity calling `blockstream.NewUnmanagedServer`.

Moreover, management methods like `Close`

func (*Server) Blocks

func (*Server) GetHeadInfo

func (*Server) PushBlock

func (s *Server) PushBlock(blk *pbbstream.Block) error

func (*Server) Ready

func (s *Server) Ready() bool

func (*Server) SetHeadInfo

func (s *Server) SetHeadInfo(num uint64, id string, blkTime time.Time, libNum uint64)

type ServerOption

type ServerOption func(s *Server)

func ServerOptionWithBuffer

func ServerOptionWithBuffer(size int) ServerOption

func ServerOptionWithLogger

func ServerOptionWithLogger(logger *zap.Logger) ServerOption

type Source

type Source struct {
	*shutter.Shutter
	// contains filtered or unexported fields
}

func NewSource

func NewSource(
	ctx context.Context,
	endpointURL string,
	burst int64,
	h bstream.Handler,
	options ...SourceOption,
) *Source

func (*Source) Run

func (s *Source) Run()

func (*Source) SetLogger

func (s *Source) SetLogger(logger *zap.Logger)

func (*Source) SetParallelPreproc

func (s *Source) SetParallelPreproc(f bstream.PreprocessFunc, threads int)

type SourceOption

type SourceOption = func(s *Source)

func WithLogger

func WithLogger(logger *zap.Logger) SourceOption

func WithNumGator

func WithNumGator(blockNum uint64, exclusive bool) SourceOption

func WithParallelPreproc

func WithParallelPreproc(f bstream.PreprocessFunc, threads int) SourceOption

func WithRequester

func WithRequester(requester string) SourceOption

func WithTimeThresholdGator

func WithTimeThresholdGator(threshold time.Duration) SourceOption

Jump to

Keyboard shortcuts

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