{"modulePath":"github.com/mcc-github/blockchain","version":"v0.0.0-20190916220231-95b87edfbee2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package chaincode\n\n## Constants\n\n```go\nconst DevModeUserRunsChaincode string = \"dev\"\n```\n\n```go\nconst (\n\tInitializedKeyName = \"\\x00\" + string(utf8.MaxRune) + \"initialized\"\n)\n```\n\n## Functions\n\n```go\nfunc IsDevMode() bool\n```\n\n```go\nfunc NewTxKey(channelID, txID string) string\n```\n\n```go\nfunc ParseName(ccName string) *sysccprovider.ChaincodeInstance\n```\n\n## Types\n\n```go\ntype ACLProvider interface {\n\tCheckACL(resName string, channelID string, idinfo interface{}) error\n}\n```\n\n```go\ntype ActiveTransactions struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewActiveTransactions() *ActiveTransactions\n```\n\n```go\nfunc (a *ActiveTransactions) Add(channelID, txID string) bool\n```\n\n```go\nfunc (a *ActiveTransactions) Remove(channelID, txID string)\n```\n\n```go\ntype ApplicationConfigRetriever interface {\n\tGetApplicationConfig(cid string) (channelconfig.Application, bool)\n}\n```\n\n```go\ntype CCProviderImpl struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewProvider(cs *ChaincodeSupport) *CCProviderImpl\n```\n\n```go\nfunc (c *CCProviderImpl) ExecuteLegacyInit(txParams *ccprovider.TransactionParams, cccid *ccprovider.CCContext, spec *pb.ChaincodeDeploymentSpec) (*pb.Response, *pb.ChaincodeEvent, error)\n```\n\n```go\nfunc (c *CCProviderImpl) Stop(ccci *ccprovider.ChaincodeContainerInfo) error\n```\n\n```go\ntype CertGenerator interface {\n\tGenerate(ccName string) (*accesscontrol.CertAndPrivKeyPair, error)\n}\n```\n\n```go\ntype ChaincodeSupport struct {\n\tACLProvider            ACLProvider\n\tAppConfig              ApplicationConfigRetriever\n\tBuiltinSCCs            scc.BuiltinSCCs\n\tDeployedCCInfoProvider ledger.DeployedChaincodeInfoProvider\n\tExecuteTimeout         time.Duration\n\tHandlerMetrics         *HandlerMetrics\n\tHandlerRegistry        *HandlerRegistry\n\tKeepalive              time.Duration\n\tLauncher               Launcher\n\tLifecycle              Lifecycle\n\tPeer                   *peer.Peer\n\tRuntime                Runtime\n\tTotalQueryLimit        int\n\tUserRunsCC             bool\n}\n```\n\n```go\nfunc (cs *ChaincodeSupport) CheckInvocation(txParams *ccprovider.TransactionParams, chaincodeName string, input *pb.ChaincodeInput) (ccid string, cctype pb.ChaincodeMessage_Type, err error)\n```\n\n```go\nfunc (cs *ChaincodeSupport) Execute(txParams *ccprovider.TransactionParams, chaincodeName string, input *pb.ChaincodeInput) (*pb.Response, *pb.ChaincodeEvent, error)\n```\n\n```go\nfunc (cs *ChaincodeSupport) ExecuteLegacyInit(txParams *ccprovider.TransactionParams, ccName, ccVersion string, input *pb.ChaincodeInput) (*pb.Response, *pb.ChaincodeEvent, error)\n```\n\n```go\nfunc (cs *ChaincodeSupport) HandleChaincodeStream(stream ccintf.ChaincodeStream) error\n```\n\n```go\nfunc (cs *ChaincodeSupport) Invoke(txParams *ccprovider.TransactionParams, chaincodeName string, input *pb.ChaincodeInput) (*pb.ChaincodeMessage, error)\n```\n\n```go\nfunc (cs *ChaincodeSupport) Launch(ccid string) (*Handler, error)\n```\n\n```go\nfunc (cs *ChaincodeSupport) LaunchInProc(ccid string) \u003c-chan struct{}\n```\n\n```go\nfunc (cs *ChaincodeSupport) Register(stream pb.ChaincodeSupport_RegisterServer) error\n```\n\n```go\ntype CollectionACLCache map[string]*readWritePermission\n```\n\n```go\ntype Config struct {\n\tTotalQueryLimit int\n\tTLSEnabled      bool\n\tKeepalive       time.Duration\n\tExecuteTimeout  time.Duration\n\tStartupTimeout  time.Duration\n\tLogFormat       string\n\tLogLevel        string\n\tShimLogLevel    string\n\tSCCWhitelist    map[string]bool\n}\n```\n\n```go\nfunc GlobalConfig() *Config\n```\n\n```go\ntype ContainerRouter interface {\n\tBuild(ccid string) error\n\tStart(ccid string, peerConnection *ccintf.PeerConnection) error\n\tStop(ccid string) error\n\tWait(ccid string) (int, error)\n}\n```\n\n```go\ntype ContainerRuntime struct {\n\tCertGenerator   CertGenerator\n\tContainerRouter ContainerRouter\n\tCACert          []byte\n\tPeerAddress     string\n}\n```\n\n```go\nfunc (c *ContainerRuntime) Start(ccid string) error\n```\n\n```go\nfunc (c *ContainerRuntime) Stop(ccid string) error\n```\n\n```go\nfunc (c *ContainerRuntime) Wait(ccid string) (int, error)\n```\n\n```go\ntype ContextRegistry interface {\n\tCreate(txParams *ccprovider.TransactionParams) (*TransactionContext, error)\n\tGet(chainID, txID string) *TransactionContext\n\tDelete(chainID, txID string)\n\tClose()\n}\n```\n\n```go\ntype Executor interface {\n\tExecute(ctxt context.Context, cccid *ccprovider.CCContext, cis ccprovider.ChaincodeSpecGetter) (*pb.Response, *pb.ChaincodeEvent, error)\n}\n```\n\n```go\ntype Handler struct {\n\tKeepalive time.Duration\n\n\tTotalQueryLimit int\n\n\tInvoker Invoker\n\n\tRegistry Registry\n\n\tACLProvider ACLProvider\n\n\tTXContexts ContextRegistry\n\n\tActiveTransactions TransactionRegistry\n\n\tBuiltinSCCs scc.BuiltinSCCs\n\n\tQueryResponseBuilder QueryResponseBuilder\n\n\tLedgerGetter LedgerGetter\n\n\tDeployedCCInfoProvider ledger.DeployedChaincodeInfoProvider\n\n\tUUIDGenerator UUIDGenerator\n\n\tAppConfig ApplicationConfigRetriever\n\n\tMetrics *HandlerMetrics\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (h *Handler) Close()\n```\n\n```go\nfunc (h *Handler) Execute(txParams *ccprovider.TransactionParams, namespace string, msg *pb.ChaincodeMessage, timeout time.Duration) (*pb.ChaincodeMessage, error)\n```\n\n```go\nfunc (h *Handler) HandleDelState(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)\n```\n\n```go\nfunc (h *Handler) HandleGetHistoryForKey(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)\n```\n\n```go\nfunc (h *Handler) HandleGetPrivateDataHash(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)\n```\n\n```go\nfunc (h *Handler) HandleGetQueryResult(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)\n```\n\n```go\nfunc (h *Handler) HandleGetState(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)\n```\n\n```go\nfunc (h *Handler) HandleGetStateByRange(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)\n```\n\n```go\nfunc (h *Handler) HandleGetStateMetadata(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)\n```\n\n```go\nfunc (h *Handler) HandleInvokeChaincode(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)\n```\n\n```go\nfunc (h *Handler) HandlePutState(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)\n```\n\n```go\nfunc (h *Handler) HandlePutStateMetadata(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)\n```\n\n```go\nfunc (h *Handler) HandleQueryStateClose(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)\n```\n\n```go\nfunc (h *Handler) HandleQueryStateNext(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)\n```\n\n```go\nfunc (h *Handler) HandleRegister(msg *pb.ChaincodeMessage)\n```\n\n```go\nfunc (h *Handler) HandleTransaction(msg *pb.ChaincodeMessage, delegate handleFunc)\n```\n\n```go\nfunc (h *Handler) Notify(msg *pb.ChaincodeMessage)\n```\n\n```go\nfunc (h *Handler) ProcessStream(stream ccintf.ChaincodeStream) error\n```\n\n```go\nfunc (h *Handler) State() State\n```\n\n```go\ntype HandlerMetrics struct {\n\tShimRequestsReceived  metrics.Counter\n\tShimRequestsCompleted metrics.Counter\n\tShimRequestDuration   metrics.Histogram\n\tExecuteTimeouts       metrics.Counter\n}\n```\n\n```go\nfunc NewHandlerMetrics(p metrics.Provider) *HandlerMetrics\n```\n\n```go\ntype HandlerRegistry struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewHandlerRegistry(allowUnsolicitedRegistration bool) *HandlerRegistry\n```\n\n```go\nfunc (r *HandlerRegistry) Deregister(ccid string) error\n```\n\n```go\nfunc (r *HandlerRegistry) Failed(ccid string, err error)\n```\n\n```go\nfunc (r *HandlerRegistry) Handler(ccid string) *Handler\n```\n\n```go\nfunc (r *HandlerRegistry) Launching(ccid string) (*LaunchState, bool)\n```\n\n```go\nfunc (r *HandlerRegistry) Ready(ccid string)\n```\n\n```go\nfunc (r *HandlerRegistry) Register(h *Handler) error\n```\n\n```go\ntype Invoker interface {\n\tInvoke(txParams *ccprovider.TransactionParams, chaincodeName string, spec *pb.ChaincodeInput) (*pb.ChaincodeMessage, error)\n}\n```\n\n```go\ntype LaunchMetrics struct {\n\tLaunchDuration metrics.Histogram\n\tLaunchFailures metrics.Counter\n\tLaunchTimeouts metrics.Counter\n}\n```\n\n```go\nfunc NewLaunchMetrics(p metrics.Provider) *LaunchMetrics\n```\n\n```go\ntype LaunchRegistry interface {\n\tLaunching(ccid string) (launchState *LaunchState, started bool)\n\tDeregister(ccid string) error\n}\n```\n\n```go\ntype LaunchState struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewLaunchState() *LaunchState\n```\n\n```go\nfunc (l *LaunchState) Done() \u003c-chan struct{}\n```\n\n```go\nfunc (l *LaunchState) Err() error\n```\n\n```go\nfunc (l *LaunchState) Notify(err error)\n```\n\n```go\ntype Launcher interface {\n\tLaunch(ccid string) error\n}\n```\n\n```go\ntype LedgerGetter interface {\n\tGetLedger(cid string) ledger.PeerLedger\n}\n```\n\n```go\ntype Lifecycle struct {\n\tExecutor Executor\n}\n```\n\n```go\nfunc (l *Lifecycle) GetChaincodeDefinition(\n\tctx context.Context,\n\ttxid string,\n\tsignedProp *pb.SignedProposal,\n\tprop *pb.Proposal,\n\tchainID string,\n\tchaincodeID string,\n) (ccprovider.ChaincodeDefinition, error)\n```\n\n```go\nfunc (l *Lifecycle) GetChaincodeDeploymentSpec(\n\tctx context.Context,\n\ttxid string,\n\tsignedProp *pb.SignedProposal,\n\tprop *pb.Proposal,\n\tchainID string,\n\tchaincodeID string,\n) (*pb.ChaincodeDeploymentSpec, error)\n```\n\n```go\ntype MessageHandler interface {\n\tHandle(*pb.ChaincodeMessage, *TransactionContext) (*pb.ChaincodeMessage, error)\n}\n```\n\n```go\ntype PendingQueryResult struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (p *PendingQueryResult) Add(queryResult commonledger.QueryResult) error\n```\n\n```go\nfunc (p *PendingQueryResult) Cut() []*pb.QueryResultBytes\n```\n\n```go\nfunc (p *PendingQueryResult) Size() int\n```\n\n```go\ntype QueryResponseBuilder interface {\n\tBuildQueryResponse(txContext *TransactionContext, iter commonledger.ResultsIterator,\n\t\titerID string, isPaginated bool, totalReturnLimit int32) (*pb.QueryResponse, error)\n}\n```\n\n```go\ntype QueryResponseGenerator struct {\n\tMaxResultLimit int\n}\n```\n\n```go\nfunc (q *QueryResponseGenerator) BuildQueryResponse(txContext *TransactionContext, iter commonledger.ResultsIterator,\n\titerID string, isPaginated bool, totalReturnLimit int32) (*pb.QueryResponse, error)\n```\n\n```go\ntype Registry interface {\n\tRegister(*Handler) error\n\tReady(string)\n\tFailed(string, error)\n\tDeregister(string) error\n}\n```\n\n```go\ntype Runtime interface {\n\tStart(ccid string) error\n\tStop(ccid string) error\n\tWait(ccid string) (int, error)\n}\n```\n\n```go\ntype RuntimeLauncher struct {\n\tRuntime        Runtime\n\tRegistry       LaunchRegistry\n\tStartupTimeout time.Duration\n\tMetrics        *LaunchMetrics\n}\n```\n\n```go\nfunc (r *RuntimeLauncher) Launch(ccid string) error\n```\n\n```go\ntype State int\n```\n\n```go\nconst (\n\tCreated State = iota\n\tEstablished\n\tReady\n)\n```\n\n```go\nfunc (s State) String() string\n```\n\n```go\ntype TransactionContext struct {\n\tChannelID            string\n\tNamespaceID          string\n\tSignedProp           *pb.SignedProposal\n\tProposal             *pb.Proposal\n\tResponseNotifier     chan *pb.ChaincodeMessage\n\tTXSimulator          ledger.TxSimulator\n\tHistoryQueryExecutor ledger.HistoryQueryExecutor\n\tCollectionStore      privdata.CollectionStore\n\tIsInitTransaction    bool\n\n\tCollectionACLCache CollectionACLCache\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (t *TransactionContext) CleanupQueryContext(queryID string)\n```\n\n```go\nfunc (t *TransactionContext) CleanupQueryContextWithBookmark(queryID string) string\n```\n\n```go\nfunc (t *TransactionContext) CloseQueryIterators()\n```\n\n```go\nfunc (t *TransactionContext) GetPendingQueryResult(queryID string) *PendingQueryResult\n```\n\n```go\nfunc (t *TransactionContext) GetQueryIterator(queryID string) commonledger.ResultsIterator\n```\n\n```go\nfunc (t *TransactionContext) GetTotalReturnCount(queryID string) *int32\n```\n\n```go\nfunc (t *TransactionContext) InitializeCollectionACLCache()\n```\n\n```go\nfunc (t *TransactionContext) InitializeQueryContext(queryID string, iter commonledger.ResultsIterator)\n```\n\n```go\ntype TransactionContexts struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewTransactionContexts() *TransactionContexts\n```\n\n```go\nfunc (c *TransactionContexts) Close()\n```\n\n```go\nfunc (c *TransactionContexts) Create(txParams *ccprovider.TransactionParams) (*TransactionContext, error)\n```\n\n```go\nfunc (c *TransactionContexts) Delete(channelID, txID string)\n```\n\n```go\nfunc (c *TransactionContexts) Get(channelID, txID string) *TransactionContext\n```\n\n```go\ntype TransactionRegistry interface {\n\tAdd(channelID, txID string) bool\n\tRemove(channelID, txID string)\n}\n```\n\n```go\ntype TxQueryExecutorGetter struct {\n\tHandlerRegistry *HandlerRegistry\n\tCCID            string\n}\n```\n\n```go\nfunc (g *TxQueryExecutorGetter) TxQueryExecutor(chainID, txID string) ledger.SimpleQueryExecutor\n```\n\n```go\ntype UUIDGenerator interface {\n\tNew() string\n}\n```\n\n```go\ntype UUIDGeneratorFunc func() string\n```\n\n```go\nfunc (u UUIDGeneratorFunc) New() string\n```\n\n","path":"github.com/mcc-github/blockchain/core/chaincode","name":"chaincode","synopsis":"","isRedistributable":true}
