service

package
v1.5.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FailureBlacklistDuration = time.Minute * 10
View Source
var FailureBlacklistMinimalCount = 0

fail fast when the exact same request has already failed twice, preventing waste of tier2 resources

View Source
var FailureForcedBackoffIncrement = time.Millisecond * 500

hold the incoming request for this duration before answering with an error if the client keeps retrying

View Source
var FailureForcedBackoffLimit = time.Second * 30
View Source
var IsValidCacheTag = regexp.MustCompile(`^[a-zA-Z0-9_-]+$`).MatchString

Functions

func GetCommonServerOptions added in v1.1.6

func GetCommonServerOptions(listenAddr string, logger *zap.Logger, healthcheck dgrpcserver.HealthCheck) []dgrpcserver.Option

func ListenTier1 added in v1.1.6

func ListenTier1(
	addr string,
	svc *Tier1Service,
	auth dauth.Authenticator,
	logger *zap.Logger,
	healthcheck dgrpcserver.HealthCheck,
) error

func ListenTier2 added in v1.1.6

func ListenTier2(
	addr string,
	serviceDiscoveryURL *url.URL,
	svc *Tier2Service,
	auth dauth.Authenticator,
	logger *zap.Logger,
	healthcheck dgrpcserver.HealthCheck,
) (err error)

Types

type Option

type Option func(anyTierService)

func WithMaxConcurrentRequests added in v1.4.0

func WithMaxConcurrentRequests(max uint64) Option

func WithMaxWasmFuelPerBlockModule added in v1.0.0

func WithMaxWasmFuelPerBlockModule(maxFuel uint64) Option

func WithModuleExecutionTracing added in v1.1.4

func WithModuleExecutionTracing() Option

func WithReadinessFunc added in v1.4.0

func WithReadinessFunc(f func(bool)) Option

func WithWASMExtensioner added in v1.5.0

func WithWASMExtensioner(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 {
	*shutter.Shutter
	ssconnect.UnimplementedStreamHandler
	// contains filtered or unexported fields
}

func NewTier1 added in v1.0.2

func NewTier1(
	logger *zap.Logger,
	mergedBlocksStore dstore.Store,
	forkedBlocksStore dstore.Store,
	hub *hub.ForkableHub,

	stateStore dstore.Store,
	defaultCacheTag string,

	parallelSubRequests uint64,
	stateBundleSize uint64,
	blockType string,

	substreamsClientConfig *client.SubstreamsClientConfig,
	tier2RequestParameters reqctx.Tier2RequestParameters,
	opts ...Option,
) (*Tier1Service, error)

func TestNewService added in v0.1.0

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

func (*Tier1Service) Blocks added in v1.0.2

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(
	logger *zap.Logger,
	opts ...Option,
) (*Tier2Service, error)

func TestNewServiceTier2 added in v1.0.2

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

func (*Tier2Service) ProcessRange added in v1.0.2

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

func (*Tier2Service) TestProcessRange added in v1.1.9

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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