finality

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 23 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommitterFLM added in v0.4.0

func NewCommitterFLM(committer *fabric.Committer) *committerListenerManager

func NewDeliveryFLM added in v0.4.0

func NewDeliveryFLM(config DeliveryListenerManagerConfig, network string, ch *fabric.Channel) (*deliveryListenerManager, error)

func NewListenerManager added in v0.4.0

func NewListenerManager[T TxInfo](config DeliveryListenerManagerConfig, delivery *fabric.Delivery, tracer trace.Tracer, mapper TxInfoMapper[T]) (*listenerManager[T], error)

Types

type DeliveryListenerManagerConfig added in v0.4.0

type DeliveryListenerManagerConfig struct {
	MapperParallelism       int
	BlockProcessParallelism int
	ListenerTimeout         time.Duration
	LRUSize                 int
	LRUBuffer               int
}

type FabricFinality added in v0.4.0

type FabricFinality struct {
	Channel                string
	ConfigService          driver.ConfigService
	Services               Services
	DefaultSigningIdentity driver.SigningIdentity
	Hasher                 Hasher
	WaitForEventTimeout    time.Duration
	// contains filtered or unexported fields
}

func NewFabricFinality

func NewFabricFinality(
	channel string,
	ConfigService driver.ConfigService,
	peerService Services,
	defaultSigningIdentity driver.SigningIdentity,
	hasher Hasher,
	waitForEventTimeout time.Duration,
	useFiltered bool,
) (*FabricFinality, error)

func (*FabricFinality) IsFinal added in v0.4.0

func (d *FabricFinality) IsFinal(txID string, address string) error

type Hasher

type Hasher interface {
	Hash(msg []byte) (hash []byte, err error)
}

type ListenerEntry added in v0.4.0

type ListenerEntry[T TxInfo] interface {
	// OnStatus is the callback for the transaction
	OnStatus(ctx context.Context, info T)
	// Equals compares a listener entry for the delition
	Equals(other ListenerEntry[T]) bool
}

type ListenerManager added in v0.4.0

type ListenerManager[T TxInfo] interface {
	AddFinalityListener(txID string, e ListenerEntry[T]) error
	RemoveFinalityListener(txID string, e ListenerEntry[T]) error
}

type Services added in v0.4.0

type Services interface {
	NewPeerClient(cc grpc.ConnectionConfig) (services.PeerClient, error)
}

type TxInfo added in v0.4.0

type TxInfo interface {
	TxID() driver2.TxID
}

type TxInfoCallback added in v0.4.0

type TxInfoCallback[T TxInfo] func(T) error

type TxInfoMapper added in v0.4.0

type TxInfoMapper[T TxInfo] interface {
	MapTxData(ctx context.Context, tx []byte, block *common.BlockMetadata, blockNum driver2.BlockNum, txNum driver2.TxNum) (map[driver2.Namespace]T, error)
	MapProcessedTx(tx *fabric.ProcessedTransaction) ([]T, error)
}

Jump to

Keyboard shortcuts

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