service

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 38 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestTraceID = "00000000000000000000000000000000"

TestTraceID must be used everywhere a TraceID is required. It must be the same between tier1 and tier2, otherwise tier1 will not find the file produced by tier2 correctly.

Functions

func TestTraceIDParam added in v1.1.3

func TestTraceIDParam() store.TraceIDParam

Types

type Option

type Option func(anyTierService)

func WithCacheSaveInterval added in v0.2.0

func WithCacheSaveInterval(block uint64) Option

func WithMaxWasmFuelPerBlockModule added in v1.0.0

func WithMaxWasmFuelPerBlockModule(maxFuel uint64) Option

func WithPipelineOptions

func WithPipelineOptions(f pipeline.PipelineOptioner) Option

WithPipelineOptions is used to configure pipeline options for consumer outside of the substreams library itself, for example in chain specific Firehose implementations.

func WithRequestStats added in v0.0.21

func WithRequestStats() Option

func WithWASMExtension

func WithWASMExtension(ext wasm.WASMExtensioner) Option

type StreamFactory added in v0.0.21

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

func (*StreamFactory) GetHeadBlock added in v1.0.2

func (s *StreamFactory) GetHeadBlock() (uint64, error)

func (*StreamFactory) GetRecentFinalBlock added in v0.1.0

func (s *StreamFactory) GetRecentFinalBlock() (uint64, error)

func (*StreamFactory) New added in v0.0.21

func (sf *StreamFactory) New(
	ctx context.Context,
	h bstream.Handler,
	startBlockNum int64,
	stopBlockNum uint64,
	cursor string,
	finalBlocksOnly bool,
	cursorIsTarget bool,
	logger *zap.Logger,
) (Streamable, error)

type StreamFactoryFunc added in v0.1.0

type StreamFactoryFunc func(ctx context.Context,
	h bstream.Handler,
	startBlockNum int64,
	stopBlockNum uint64,
	cursor string,
	finalBlocksOnly bool,
	cursorIsTarget bool,
	logger *zap.Logger) (Streamable, error)

type Streamable added in v0.1.0

type Streamable interface {
	Run(ctx context.Context) error
}

type Tier1Service added in v1.0.2

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

func NewTier1 added in v1.0.2

func NewTier1(
	stateStore dstore.Store,
	blockType string,
	parallelSubRequests uint64,
	subrequestSplitSize uint64,
	substreamsClientConfig *client.SubstreamsClientConfig,
	opts ...Option,
) (s *Tier1Service, err error)

func TestNewService added in v0.1.0

func TestNewService(runtimeConfig config.RuntimeConfig, linearHandoffBlockNum uint64, streamFactoryFunc StreamFactoryFunc) *Tier1Service

func (*Tier1Service) BaseStateStore added in v1.0.2

func (s *Tier1Service) BaseStateStore() dstore.Store

func (*Tier1Service) BlockType added in v1.0.2

func (s *Tier1Service) BlockType() string

func (*Tier1Service) Blocks added in v1.0.2

func (s *Tier1Service) Blocks(request *pbsubstreamsrpc.Request, streamSrv pbsubstreamsrpc.Stream_BlocksServer) (grpcError error)

func (*Tier1Service) Register added in v1.0.2

func (s *Tier1Service) Register(
	server dgrpcserver.Server,
	mergedBlocksStore dstore.Store,
	forkedBlocksStore dstore.Store,
	forkableHub *hub.ForkableHub,
	logger *zap.Logger)

func (*Tier1Service) TestBlocks added in v1.0.2

func (s *Tier1Service) TestBlocks(ctx context.Context, isSubRequest bool, request *pbsubstreamsrpc.Request, respFunc substreams.ResponseFunc) error

type Tier2Service added in v1.0.2

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

func NewTier2 added in v1.0.2

func NewTier2(
	stateStore dstore.Store,
	blockType string,
	opts ...Option,
) (s *Tier2Service)

func TestNewServiceTier2 added in v1.0.2

func TestNewServiceTier2(runtimeConfig config.RuntimeConfig, streamFactoryFunc StreamFactoryFunc) *Tier2Service

func (*Tier2Service) BaseStateStore added in v1.0.2

func (s *Tier2Service) BaseStateStore() dstore.Store

func (*Tier2Service) BlockType added in v1.0.2

func (s *Tier2Service) BlockType() string

func (*Tier2Service) ProcessRange added in v1.0.2

func (s *Tier2Service) ProcessRange(request *pbssinternal.ProcessRangeRequest, streamSrv pbssinternal.Substreams_ProcessRangeServer) (grpcError error)

func (*Tier2Service) Register added in v1.0.2

func (s *Tier2Service) Register(
	server dgrpcserver.Server,
	mergedBlocksStore dstore.Store,
	_ dstore.Store,
	_ *hub.ForkableHub,
	logger *zap.Logger)

func (*Tier2Service) TestBlocks added in v1.0.2

func (s *Tier2Service) TestBlocks(ctx context.Context, request *pbssinternal.ProcessRangeRequest, respFunc substreams.ResponseFunc, traceID *string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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