hlf

package
v0.0.3-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExecutorAlreadyExists = errors.New("executor already exists")
	ErrExecutorUndefined     = errors.New("executor undefined")
)

Functions

func IsConnectionFailedErr

func IsConnectionFailedErr(err error) bool

IsConnectionFailedErr checks if the error is a network connection attempt from the SDK fails

func IsEndorsementMismatchErr

func IsEndorsementMismatchErr(err error) bool

IsEndorsementMismatchErr checks if the error is a mismatch.

Types

type ChExecutor

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

func (*ChExecutor) BlockchainHeight

func (che *ChExecutor) BlockchainHeight(ctx context.Context) (*uint64, error)

func (*ChExecutor) Close

func (che *ChExecutor) Close()

func (*ChExecutor) Invoke

func (che *ChExecutor) Invoke(ctx context.Context, req channel.Request, options []channel.RequestOption) (channel.Response, error)

func (*ChExecutor) Query

func (che *ChExecutor) Query(ctx context.Context, req channel.Request, options []channel.RequestOption) (channel.Response, error)

type Events

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

Events stores data about block subscription without gaps

func SubscribeEventBlock

func SubscribeEventBlock(ctx context.Context, channelProvider contextApi.ChannelProvider, fromBlock uint64, channel string, targetPeers []string) (*Events, error)

SubscribeEventBlock - subscription to events without pass blocks

func (*Events) BlockEvent

func (e *Events) BlockEvent() <-chan *fab.BlockEvent

func (*Events) UnsubscribeEventBlock

func (e *Events) UnsubscribeEventBlock()

type ExecuteOptions

type ExecuteOptions struct {
	ExecuteTimeout       time.Duration
	RetryExecuteAttempts uint
	RetryExecuteMaxDelay time.Duration
	RetryExecuteDelay    time.Duration
}

type Pool

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

func NewPool

func NewPool(
	ctx context.Context,
	channels []string,
	userName string,
	opts config.Options,
	profilePath string,
	profile hlfprofile.HlfProfile,
	storage *redis.Storage,
) (*Pool, error)

func (*Pool) Executor

func (pool *Pool) Executor(channel string) (*ChExecutor, error)

func (*Pool) Expand

func (pool *Pool) Expand(ctx context.Context, channel string) error

func (*Pool) Has

func (pool *Pool) Has(channel string) bool

func (*Pool) Readiness

func (pool *Pool) Readiness(channel string) (<-chan struct{}, error)

func (*Pool) RunCollectors

func (pool *Pool) RunCollectors(ctx context.Context) error

type TargetPeersResolver

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

TargetPeersResolver for filter peers after discoveryService find them - choose only peer from array

func NewTargetPeersResolver

func NewTargetPeersResolver(targetPeers []string) TargetPeersResolver

NewTargetPeersResolver create and make map from array for faster find element

func (TargetPeersResolver) Resolve

func (tpp TargetPeersResolver) Resolve(peers []fab.Peer) (fab.Peer, error)

Resolve only peer from map targetPeersMap

func (TargetPeersResolver) ShouldDisconnect

func (TargetPeersResolver) ShouldDisconnect(_ []fab.Peer, _ fab.Peer) bool

ShouldDisconnect always returns false (will not disconnect a connected peer)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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