fabric: github.com/hyperledger/fabric/peer/chaincode Index | Files | Directories

package chaincode

import "github.com/hyperledger/fabric/peer/chaincode"


Package Files

chaincode.go common.go install.go instantiate.go invoke.go list.go package.go query.go signpackage.go upgrade.go

func ChaincodeInvokeOrQuery Uses

func ChaincodeInvokeOrQuery(
    spec *pb.ChaincodeSpec,
    cID string,
    txID string,
    invoke bool,
    signer msp.SigningIdentity,
    certificate tls.Certificate,
    endorserClients []pb.EndorserClient,
    deliverClients []api.PeerDeliverClient,
    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 Uses

func Cmd(cf *ChaincodeCmdFactory) *cobra.Command

Cmd returns the cobra command for Chaincode

type ChaincodeCmdFactory Uses

type ChaincodeCmdFactory struct {
    EndorserClients []pb.EndorserClient
    DeliverClients  []api.PeerDeliverClient
    Certificate     tls.Certificate
    Signer          msp.SigningIdentity
    BroadcastClient common.BroadcastClient

ChaincodeCmdFactory holds the clients used by ChaincodeCmd

func InitCmdFactory Uses

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

InitCmdFactory init the ChaincodeCmdFactory with default clients


mockCode generated by counterfeiter.

Package chaincode imports 41 packages (graph) and is imported by 14 packages. Updated 2018-12-13. Refresh now. Tools for package owners.