committer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ConfigTXPrefix = "configtx_"
)

Variables

This section is empty.

Functions

func Drivers

func Drivers() []string

Drivers returns a sorted list of the names of the registered drivers.

func Register

func Register(name string, driver driver.Driver)

Register makes a kvs driver available by the provided name. If Register is called twice with the same name or if driver is nil, it panics.

Types

type ChaincodeEvent

type ChaincodeEvent struct {
	BlockNumber   uint64
	TransactionID string
	ChaincodeID   string
	EventName     string
	Payload       []byte
}

ChaincodeEvent models the chaincode event details.

func (*ChaincodeEvent) Message

func (chaincodeEvent *ChaincodeEvent) Message() interface{}

func (*ChaincodeEvent) Topic

func (chaincodeEvent *ChaincodeEvent) Topic() string

type Committer added in v0.2.0

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

func New

func New(channel string, network Network, finality Finality, waitForEventTimeout time.Duration, quiet bool, metrics Metrics, publisher events.Publisher) (*Committer, error)

func (*Committer) Commit added in v0.2.0

func (c *Committer) Commit(block *common.Block) error

Commit commits the transactions in the block passed as argument

func (*Committer) CommitEndorserTransaction added in v0.2.0

func (c *Committer) CommitEndorserTransaction(txID string, block *common.Block, indexInBlock int, env *common.Envelope, event *TxEvent) error

CommitEndorserTransaction commits the transaction to the vault

func (*Committer) DiscardEndorserTransaction added in v0.2.0

func (c *Committer) DiscardEndorserTransaction(txID string, block *common.Block, event *TxEvent, validationCode pb.TxValidationCode) error

DiscardEndorserTransaction discards the transaction from the vault

func (*Committer) IsFinal added in v0.2.0

func (c *Committer) IsFinal(ctx context.Context, txID string) error

IsFinal takes in input a transaction id and waits for its confirmation with the respect to the passed context that can be used to set a deadline for the waiting time.

type ExternalCommitter

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

func GetExternalCommitter

func GetExternalCommitter(name string, sp view2.ServiceProvider, vault driver.Vault) (*ExternalCommitter, error)

func (*ExternalCommitter) CommitTX

func (c *ExternalCommitter) CommitTX(txid string, block uint64, indexInBloc int) error

func (*ExternalCommitter) DiscardTX

func (c *ExternalCommitter) DiscardTX(txid string) error

func (*ExternalCommitter) Status

func (*ExternalCommitter) Validate

func (c *ExternalCommitter) Validate(txid string) (fdriver.ValidationCode, error)

type Finality

type Finality interface {
	IsFinal(txID string, address string) error
}

type Metrics

type Metrics interface {
	EmitKey(val float32, event ...string)
}

type Network

type Network interface {
	Committer(channel string) (driver.Committer, error)
	PickPeer() *grpc.ConnectionConfig
	Ledger(channel string) (driver.Ledger, error)
}

type TxEvent

type TxEvent struct {
	Txid           string
	DependantTxIDs []string
	Committed      bool
	Block          uint64
	IndexInBlock   int
	CommitPeer     string
	Err            error
}

TxEvent contains information for token transaction commit

type ValidationFlags

type ValidationFlags []uint8

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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