chaincodes

package
v0.0.0-...-e9fc09b Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListShadowCCs

func ListShadowCCs()

ListShadowCCs lists all registered shadow ccs in the library

func RegisterCCClients

func RegisterCCClients(ccs []*CCClient) error

RegisterCCClients registers and maps chaincode clients to their shadows

Types

type CCClient

type CCClient struct {
	//-------------config properties ------------
	//Name of the chaincode
	Name string

	//InitArgs used for deploying the chaincode
	InitArgs []string

	//Path to the chaincode
	Path string

	//NumFinalQueryAttempts number of times to try final query before giving up
	NumFinalQueryAttempts int

	//NumberOfInvokes number of iterations to do invoke on
	NumberOfInvokes int

	//DelayBetweenInvokeMs delay between each invoke
	DelayBetweenInvokeMs int

	//DelayBetweenQueryMs delay between each query
	DelayBetweenQueryMs int

	//TimeoutToAbortSecs timeout for aborting this chaincode processing
	TimeoutToAbortSecs int

	//Lang of chaincode
	Lang string

	//WaitAfterInvokeMs wait time before validating invokes for this chaincode
	WaitAfterInvokeMs int

	//Concurrency number of goroutines to spin
	Concurrency int

	//-------------runtime properties ------------
	//Unique number assigned to this CC by CCChecker
	ID int
	// contains filtered or unexported fields
}

CCClient chaincode properties, config and runtime

func (*CCClient) Report

func (cc *CCClient) Report(verbose bool, chainID string)

Report reports chaincode test execution, iter by iter

func (*CCClient) Run

Run test over given number of iterations

i will be unique across chaincodes and can be used as a key
  this is useful if chaincode occurs multiple times in the array of chaincodes

func (*CCClient) Validate

func (cc *CCClient) Validate(ctxt context.Context, chainID string, bc common.BroadcastClient, ec pb.EndorserClient, signer msp.SigningIdentity, wg *sync.WaitGroup) error

Validate test that was Run. Each successful iteration in the run is validated against

type ShadowCCIntf

type ShadowCCIntf interface {
	//InitShadowCC initializes the shadow chaincode (will be called once for each chaincode)
	InitShadowCC(initArgs []string)

	//GetInvokeArgs gets invoke arguments from shadow
	GetInvokeArgs(ccnum int, iter int) [][]byte

	//PostInvoke passes the retvalue from the invoke to the shadow for post-processing
	PostInvoke(args [][]byte, retval []byte) error

	//GetQueryArgs mimics the Invoke and gets the query for an invoke
	GetQueryArgs(ccnum int, iter int) [][]byte

	//Validate the results against the query arguments
	Validate(args [][]byte, value []byte) error

	//GetNumQueries returns number of queries to perform
	GetNumQueries(numSuccessfulInvokes int) int

	//OverrideNumInvokes overrides the users number of invoke request
	OverrideNumInvokes(numInvokesPlanned int) int
}

ShadowCCIntf interfaces to be implemented by shadow chaincodes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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