chaincode

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: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChaincodeInvokeOrQuery

func ChaincodeInvokeOrQuery(
	spec *pb.ChaincodeSpec,
	cID string,
	invoke bool,
	signer msp.SigningIdentity,
	endorserClient pb.EndorserClient,
	bc common.BroadcastClient,
) (*pb.ProposalResponse, error)

ChaincodeInvokeOrQuery invokes or queries the chaincode. If successful, the INVOKE form prints the ProposalResponse to STDOUT, and the QUERY form prints the query result on STDOUT. A command-line flag (-r, --raw) determines whether the query result is output as raw bytes, or as a printable string. The printable form is optionally (-x, --hex) a hexadecimal representation of the query response. If the query response is NIL, nothing is output.

NOTE - Query will likely go away as all interactions with the endorser are Proposal and ProposalResponses

func Cmd

Cmd returns the cobra command for Chaincode

Types

type ChaincodeCmdFactory

type ChaincodeCmdFactory struct {
	EndorserClient  pb.EndorserClient
	Signer          msp.SigningIdentity
	BroadcastClient common.BroadcastClient
}

ChaincodeCmdFactory holds the clients used by ChaincodeCmd

func InitCmdFactory

func InitCmdFactory(isEndorserRequired, isOrdererRequired bool) (*ChaincodeCmdFactory, error)

InitCmdFactory init the ChaincodeCmdFactory with default clients

Jump to

Keyboard shortcuts

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