deliver

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromTxID

func FromTxID(qscc GetBlockerInfo, txID string) func(*subscribeEventOption) error

func WithDefaultSeek

func WithDefaultSeek(seekOpts ...api.EventCCSeekOption) func(*subscribeEventOption) error

WithDefaultSeek need if fromTxID is empty

func WithGetBlockByTx

func WithGetBlockByTx(seekOpts ...api.EventCCSeekOption) func(*subscribeEventOption)

Types

type Deliver

type Deliver struct {
	Client   peer.DeliverClient
	Identity msp.SigningIdentity
	// TlsCertHash used when creating seek envelope with enabled tls
	TLSCertHash []byte
}

func New

func New(deliverClient peer.DeliverClient, identity msp.SigningIdentity, tlsCertHash []byte) *Deliver

func (*Deliver) SubscribeBlock

func (d *Deliver) SubscribeBlock(ctx context.Context, channelName string, seekOpt ...api.EventCCSeekOption) (api.BlockSubscription, error)

func (*Deliver) SubscribeCC

func (d *Deliver) SubscribeCC(ctx context.Context, channelName string, ccName string, seekOpt ...api.EventCCSeekOption) (api.EventCCSubscription, error)

func (*Deliver) SubscribeEvents

func (d *Deliver) SubscribeEvents(ctx context.Context, channelName string, ccName string, setOpts ...func(*subscribeEventOption) error) (api.EventCCSubscription, error)

SubscribeEvents it is just once helper for save to api version today

func (*Deliver) SubscribeTx

func (d *Deliver) SubscribeTx(ctx context.Context, channelName string, txID string, seekOpt ...api.EventCCSeekOption) (api.TxSubscription, error)

type GetBlockerInfo

type GetBlockerInfo interface {
	GetBlockByTxID(ctx context.Context, channelName string, txID string) (*common.Block, error)
}

type SeekOptConverter

type SeekOptConverter struct {
	GetChannelHeight func(ctx context.Context, channel string) (uint64, error)

	Logger *zap.Logger
	// contains filtered or unexported fields
}

func NewSeekOptConverter

func NewSeekOptConverter(channelInfo api.ChannelInfo, logger *zap.Logger) *SeekOptConverter

func (*SeekOptConverter) ByBlockRange

func (so *SeekOptConverter) ByBlockRange(ctx context.Context, channel string, blockRange ...int64) (api.EventCCSeekOption, error)

func (*SeekOptConverter) ChannelHeight

func (so *SeekOptConverter) ChannelHeight(ctx context.Context, channel string) (uint64, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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