Documentation ¶
Overview ¶
Package commit provides an implementation for finding transaction commit status that is specific to the Gateway embedded within a peer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Finder ¶
type Finder struct {
// contains filtered or unexported fields
}
Finder is used to obtain transaction status.
func NewFinder ¶
func NewFinder(query QueryProvider, notifier *Notifier) *Finder
func (*Finder) TransactionStatus ¶
func (finder *Finder) TransactionStatus(ctx context.Context, channelName string, transactionID string) (*Status, error)
TransactionStatus provides status of a specified transaction on a given channel. If the transaction has already committed, the status is returned immediately; otherwise this call blocks waiting for the transaction to be committed or the context to be cancelled.
type NotificationSupplier ¶
type NotificationSupplier interface {
CommitNotifications(done <-chan struct{}, channelName string) (<-chan *ledger.CommitNotification, error)
}
NotificationSupplier obtains a commit notification channel for a specific ledger. It provides an abstraction of the use of Peer, Channel and Ledger to obtain this result, and allows mocking in unit tests.
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier provides notification of transaction commits.
func NewNotifier ¶
func NewNotifier(supplier NotificationSupplier) *Notifier
type QueryProvider ¶
type QueryProvider interface {
TransactionStatus(channelName string, transactionID string) (peer.TxValidationCode, uint64, error)
}
QueryProvider provides status of previously committed transactions on a given channel. An error is returned if the transaction is not present in the ledger.