txmanager

package
v0.0.0-...-cfcde66 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WaitTime = 10 * 60 * time.Second
	WaitTime                      = 100 * time.Second
	RandomSendTime                = 10
	RandomTransactoinHandlerCount = 1
	MaxResendCount                = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EndorserConfig

type EndorserConfig struct {
	Address      string
	SN           string
	EventAddress string
	ClientConfig endorser.ClientConfig
	GrpcClient   *endorser.GRPCClient
}

type OrdererConfig

type OrdererConfig struct {
	OrdererAddress string
	OrdererSN      string
	OrdererConfig  endorser.ClientConfig
	OrdererClient  *endorser.GRPCClient
}

type TxManager

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

func NewConsortiumNode

func NewConsortiumNode() (tm *TxManager, err error)

func (*TxManager) GetCreator

func (tm *TxManager) GetCreator() []byte

func (*TxManager) GetSigner

func (tm *TxManager) GetSigner() interface{}

func (*TxManager) GetTransactionByID

func (tm *TxManager) GetTransactionByID(chainId, txid string) (string, error)

func (*TxManager) PickEndorserConfig

func (tm *TxManager) PickEndorserConfig() (*EndorserConfig, error)

func (*TxManager) PickOrdererConfig

func (tm *TxManager) PickOrdererConfig() (*OrdererConfig, error)

func (*TxManager) PickRandomTxHandler

func (tm *TxManager) PickRandomTxHandler() (*endorser.TransactionHandler, error)

func (*TxManager) RandomTxHandler

func (tm *TxManager) RandomTxHandler() (*endorser.TransactionHandler, error)

下次改成初始化一批,然后从中选取,而不是这样每次都new

func (*TxManager) RetraceEvent

func (tm *TxManager) RetraceEvent(log chan event.ChaincodeEventInfo, config event.RetraceConf)

func (*TxManager) RollBack

func (tm *TxManager) RollBack(userToC endorser.ChaincodeEventInfo)

func (*TxManager) SendTransaction

func (tm *TxManager) SendTransaction(th *endorser.TransactionHandler, c chan int, cc chan interface{}, chainId, chaincodeName, version, funcName, cid string, args ...string) (string, string, error)

func (*TxManager) WaitUntilTransactionSuccess

func (tm *TxManager) WaitUntilTransactionSuccess(callback func(logCToUser interface{}) bool, query func(q ...interface{}) bool, revert func(q ...interface{}), chainId, chaincodeName, version, funcName, cid string, args ...string)

Jump to

Keyboard shortcuts

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