{"modulePath":"github.com/ctk-program/ctk","version":"v0.0.0-20200221082512-8dfe50c80c6c","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package chaincode\n\n## Constants\n\n```go\nconst (\n\t// Mutual TLS auth client key and cert paths in the chaincode container\n\tTLSClientKeyPath      string = \"/etc/hyperledger/fabric/client.key\"\n\tTLSClientCertPath     string = \"/etc/hyperledger/fabric/client.crt\"\n\tTLSClientRootCertPath string = \"/etc/hyperledger/fabric/peer.crt\"\n)\n```\n\n```go\nconst (\n\t// TXSimulatorKey is the context key used to provide a ledger.TxSimulator\n\t// from the endorser to the chaincode.\n\tTXSimulatorKey key = \"txsimulatorkey\"\n\n\t// HistoryQueryExecutorKey is the context key used to provide a\n\t// ledger.HistoryQueryExecutor from the endorser to the chaincode.\n\tHistoryQueryExecutorKey key = \"historyqueryexecutorkey\"\n)\n```\n\n```go\nconst DevModeUserRunsChaincode string = \"dev\"\n```\nDevModeUserRunsChaincode enables chaincode execution in a development environment\n\n## Functions\n\n```go\nfunc IsDevMode() bool\n```\nIsDevMode returns true if the peer was configured with development-mode enabled.\n\n```go\nfunc NewTxKey(channelID, txID string) string\n```\n\n```go\nfunc ParseName(ccName string) *sysccprovider.ChaincodeInstance\n```\nParseName parses a chaincode name into a ChaincodeInstance. The name should be of the form \"chaincode-name:version/channel-name\" with optional elements.\n\n## Types\n\n```go\ntype ACLProvider interface {\n\tCheckACL(resName string, channelID string, idinfo interface{}) error\n}\n```\nAn ACLProvider performs access control checks when invoking chaincode.\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\t// GetApplicationConfig returns the channelconfig.Application for the channel\n\t// and whether the Application config exists\n\tGetApplicationConfig(cid string) (channelconfig.Application, bool)\n}\n```\nApplicationConfigRetriever to retrieve the application configuration for a channel\n\n```go\ntype CCProviderImpl struct {\n\t// contains filtered or unexported fields\n}\n```\nccProviderImpl is an implementation of the ccprovider.ChaincodeProvider interface\n\n```go\nfunc NewProvider(cs *ChaincodeSupport) *CCProviderImpl\n```\n\n```go\nfunc (c *CCProviderImpl) Execute(txParams *ccprovider.TransactionParams, cccid *ccprovider.CCContext, input *pb.ChaincodeInput) (*pb.Response, *pb.ChaincodeEvent, error)\n```\nExecute executes the chaincode given context and spec (invocation or deploy)\n\n```go\nfunc (c *CCProviderImpl) ExecuteLegacyInit(txParams *ccprovider.TransactionParams, cccid *ccprovider.CCContext, spec *pb.ChaincodeDeploymentSpec) (*pb.Response, *pb.ChaincodeEvent, error)\n```\nExecuteLegacyInit executes a chaincode which is not in the LSCC table\n\n```go\nfunc (c *CCProviderImpl) Stop(ccci *ccprovider.ChaincodeContainerInfo) error\n```\nStop stops the chaincode given context and spec\n\n```go\ntype CertGenerator interface {\n\t// Generate returns a certificate and private key and associates\n\t// the hash of the certificates with the given chaincode name\n\tGenerate(ccName string) (*accesscontrol.CertAndPrivKeyPair, error)\n}\n```\nCertGenerator generates client certificates for chaincode.\n\n```go\ntype ChaincodeDefinitionGetter interface {\n\tChaincodeDefinition(chaincodeName string, txSim ledger.QueryExecutor) (ccprovider.ChaincodeDefinition, error)\n}\n```\nChaincodeDefinitionGetter is responsible for retrieving a chaincode definition from the system. The definition is used by the InstantiationPolicyChecker.\n\n```go\ntype ChaincodeSupport struct {\n\tKeepalive        time.Duration\n\tExecuteTimeout   time.Duration\n\tUserRunsCC       bool\n\tRuntime          Runtime\n\tACLProvider      ACLProvider\n\tHandlerRegistry  *HandlerRegistry\n\tLauncher         Launcher\n\tSystemCCProvider sysccprovider.SystemChaincodeProvider\n\tLifecycle        Lifecycle\n\n\tHandlerMetrics *HandlerMetrics\n\tLaunchMetrics  *LaunchMetrics\n\t// contains filtered or unexported fields\n}\n```\nChaincodeSupport responsible for providing interfacing with chaincodes from the Peer.\n\n```go\nfunc NewChaincodeSupport(\n\tconfig *Config,\n\tpeerAddress string,\n\tuserRunsCC bool,\n\tcaCert []byte,\n\tcertGenerator CertGenerator,\n\tpackageProvider PackageProvider,\n\tlifecycle Lifecycle,\n\taclProvider ACLProvider,\n\tprocessor Processor,\n\tSystemCCProvider sysccprovider.SystemChaincodeProvider,\n\tplatformRegistry *platforms.Registry,\n\tappConfig ApplicationConfigRetriever,\n\tmetricsProvider metrics.Provider,\n) *ChaincodeSupport\n```\nNewChaincodeSupport creates a new ChaincodeSupport instance.\n\n```go\nfunc (cs *ChaincodeSupport) Execute(txParams *ccprovider.TransactionParams, cccid *ccprovider.CCContext, input *pb.ChaincodeInput) (*pb.Response, *pb.ChaincodeEvent, error)\n```\nExecute invokes chaincode and returns the original response.\n\n```go\nfunc (cs *ChaincodeSupport) ExecuteLegacyInit(txParams *ccprovider.TransactionParams, cccid *ccprovider.CCContext, spec *pb.ChaincodeDeploymentSpec) (*pb.Response, *pb.ChaincodeEvent, error)\n```\nExecuteLegacyInit is a temporary method which should be removed once the old style lifecycle is entirely deprecated.  Ideally one release after the introduction of the new lifecycle. It does not attempt to start the chaincode based on the information from lifecycle, but instead accepts the container information directly in the form of a ChaincodeDeploymentSpec.\n\n```go\nfunc (cs *ChaincodeSupport) HandleChaincodeStream(stream ccintf.ChaincodeStream) error\n```\nHandleChaincodeStream implements ccintf.HandleChaincodeStream for all vms to call with appropriate stream\n\n```go\nfunc (cs *ChaincodeSupport) Invoke(txParams *ccprovider.TransactionParams, cccid *ccprovider.CCContext, input *pb.ChaincodeInput) (*pb.ChaincodeMessage, error)\n```\nInvoke will invoke chaincode and return the message containing the response. The chaincode will be launched if it is not already running.\n\n```go\nfunc (cs *ChaincodeSupport) InvokeInit(txParams *ccprovider.TransactionParams, cccid *ccprovider.CCContext, input *pb.ChaincodeInput) (*pb.ChaincodeMessage, error)\n```\n\n```go\nfunc (cs *ChaincodeSupport) Launch(chainID, chaincodeName, chaincodeVersion string, qe ledger.QueryExecutor) (*Handler, error)\n```\nLaunch starts executing chaincode if it is not already running. This method blocks until the peer side handler gets into ready state or encounters a fatal error. If the chaincode is already running, it simply returns.\n\n```go\nfunc (cs *ChaincodeSupport) LaunchInit(ccci *ccprovider.ChaincodeContainerInfo) error\n```\nLaunchInit bypasses getting the chaincode spec from the LSCC table as in the case of v1.0-v1.2 lifecycle, the chaincode will not yet be defined in the LSCC table\n\n```go\nfunc (cs *ChaincodeSupport) Register(stream pb.ChaincodeSupport_RegisterServer) error\n```\nRegister the bidi stream entry point called by chaincode to register with the Peer.\n\n```go\nfunc (cs *ChaincodeSupport) Stop(ccci *ccprovider.ChaincodeContainerInfo) error\n```\nStop stops a chaincode if running.\n\n```go\ntype CheckInstantiationPolicyFunc func(name, version string, cd *ccprovider.ChaincodeData) error\n```\nAdapter from function to InstantiationPolicyChecker interface.\n\n```go\nfunc (c CheckInstantiationPolicyFunc) CheckInstantiationPolicy(name, version string, cd *ccprovider.ChaincodeData) error\n```\n\n```go\ntype Config struct {\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}\n```\n\n```go\nfunc GlobalConfig() *Config\n```\n\n```go\ntype ContainerRuntime struct {\n\tCertGenerator    CertGenerator\n\tProcessor        Processor\n\tCACert           []byte\n\tCommonEnv        []string\n\tPeerAddress      string\n\tPlatformRegistry *platforms.Registry\n}\n```\nContainerRuntime is responsible for managing containerized chaincode.\n\n```go\nfunc (c *ContainerRuntime) LaunchConfig(cname string, ccType string) (*LaunchConfig, error)\n```\nLaunchConfig creates the LaunchConfig for chaincode running in a container.\n\n```go\nfunc (c *ContainerRuntime) Start(ccci *ccprovider.ChaincodeContainerInfo, codePackage []byte) error\n```\nStart launches chaincode in a runtime environment.\n\n```go\nfunc (c *ContainerRuntime) Stop(ccci *ccprovider.ChaincodeContainerInfo) error\n```\nStop terminates chaincode and its container runtime environment.\n\n```go\nfunc (c *ContainerRuntime) Wait(ccci *ccprovider.ChaincodeContainerInfo) (int, error)\n```\nWait waits for the container runtime to terminate.\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```\nA ContextRegistry is responsible for managing transaction contexts.\n\n```go\ntype Handler struct {\n\t// Keepalive specifies the interval at which keep-alive messages are sent.\n\tKeepalive time.Duration\n\t// SystemCCVersion specifies the current system chaincode version\n\tSystemCCVersion string\n\t// DefinitionGetter is used to retrieve the chaincode definition from the\n\t// Lifecycle System Chaincode.\n\tDefinitionGetter ChaincodeDefinitionGetter\n\t// Invoker is used to invoke chaincode.\n\tInvoker Invoker\n\t// Registry is used to track active handlers.\n\tRegistry Registry\n\t// ACLProvider is used to check if a chaincode invocation should be allowed.\n\tACLProvider ACLProvider\n\t// TXContexts is a collection of TransactionContext instances\n\t// that are accessed by channel name and transaction ID.\n\tTXContexts ContextRegistry\n\t// activeTransactions holds active transaction identifiers.\n\tActiveTransactions TransactionRegistry\n\t// SystemCCProvider provides access to system chaincode metadata\n\tSystemCCProvider SystemCCProvider\n\t// InstantiationPolicyChecker is used to evaluate the chaincode instantiation policies.\n\tInstantiationPolicyChecker InstantiationPolicyChecker\n\t// QueryResponeBuilder is used to build query responses\n\tQueryResponseBuilder QueryResponseBuilder\n\t// LedgerGetter is used to get the ledger associated with a channel\n\tLedgerGetter LedgerGetter\n\t// UUIDGenerator is used to generate UUIDs\n\tUUIDGenerator UUIDGenerator\n\t// AppConfig is used to retrieve the application config for a channel\n\tAppConfig ApplicationConfigRetriever\n\t// Metrics holds chaincode handler metrics\n\tMetrics *HandlerMetrics\n\t// contains filtered or unexported fields\n}\n```\nHandler implements the peer side of the chaincode stream.\n\n```go\nfunc (h *Handler) ChaincodeName() string\n```\n\n```go\nfunc (h *Handler) Close()\n```\n\n```go\nfunc (h *Handler) Execute(txParams *ccprovider.TransactionParams, cccid *ccprovider.CCContext, 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```\nHandles query to ledger history db\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```\nHandles query to ledger to execute query state\n\n```go\nfunc (h *Handler) HandleGetState(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)\n```\nHandles query to ledger to get state\n\n```go\nfunc (h *Handler) HandleGetStateByRange(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)\n```\nHandles query to ledger to rage query state\n\n```go\nfunc (h *Handler) HandleGetStateMetadata(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)\n```\nHandles query to ledger to get state metadata\n\n```go\nfunc (h *Handler) HandleInvokeChaincode(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)\n```\nHandles requests that modify ledger state\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```\nHandles the closing of a state iterator\n\n```go\nfunc (h *Handler) HandleQueryStateNext(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)\n```\nHandles query to ledger for query state next\n\n```go\nfunc (h *Handler) HandleRegister(msg *pb.ChaincodeMessage)\n```\nhandleRegister is invoked when chaincode tries to register.\n\n```go\nfunc (h *Handler) HandleTransaction(msg *pb.ChaincodeMessage, delegate handleFunc)\n```\nHandleTransaction is a middleware function that obtains and verifies a transaction context prior to forwarding the message to the provided delegate. Response messages returned by the delegate are sent to the chat stream. Any errors returned by the delegate are packaged as chaincode error messages.\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```\nHandlerRegistry maintains chaincode Handler instances.\n\n```go\nfunc NewHandlerRegistry(allowUnsolicitedRegistration bool) *HandlerRegistry\n```\nNewHandlerRegistry constructs a HandlerRegistry.\n\n```go\nfunc (r *HandlerRegistry) Deregister(cname string) error\n```\nDeregister clears references to state associated specified chaincode. As part of the cleanup, it closes the handler so it can cleanup any state. If the registry does not contain the provided handler, an error is returned.\n\n```go\nfunc (r *HandlerRegistry) Failed(cname string, err error)\n```\nFailed indicates that registration of a launched chaincode has failed.\n\n```go\nfunc (r *HandlerRegistry) Handler(cname string) *Handler\n```\nHandler retrieves the handler for a chaincode instance.\n\n```go\nfunc (r *HandlerRegistry) Launching(cname string) (*LaunchState, bool)\n```\nLaunching indicates that chaincode is being launched. The LaunchState that is returned provides mechanisms to determine when the operation has completed and whether or not it failed. The bool indicates whether or not the chaincode has already been started.\n\n```go\nfunc (r *HandlerRegistry) Ready(cname string)\n```\nReady indicates that the chaincode registration has completed and the READY response has been sent to the chaincode.\n\n```go\nfunc (r *HandlerRegistry) Register(h *Handler) error\n```\nRegister adds a chaincode handler to the registry. An error will be returned if a handler is already registered for the chaincode. An error will also be returned if the chaincode has not already been \"launched\", and unsolicited registration is not allowed.\n\n```go\ntype InstantiationPolicyChecker interface {\n\tCheckInstantiationPolicy(name, version string, cd *ccprovider.ChaincodeData) error\n}\n```\nInstantiationPolicyChecker is used to evaluate instantiation policies.\n\n```go\ntype Invoker interface {\n\tInvoke(txParams *ccprovider.TransactionParams, cccid *ccprovider.CCContext, spec *pb.ChaincodeInput) (*pb.ChaincodeMessage, error)\n}\n```\nAn Invoker invokes chaincode.\n\n```go\ntype LaunchConfig struct {\n\tArgs  []string\n\tEnvs  []string\n\tFiles map[string][]byte\n}\n```\nLaunchConfig holds chaincode launch arguments, environment variables, and files.\n\n```go\nfunc (lc *LaunchConfig) String() string\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(cname string) (launchState *LaunchState, started bool)\n\tDeregister(cname string) error\n}\n```\nLaunchRegistry tracks launching chaincode instances.\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(ccci *ccprovider.ChaincodeContainerInfo) error\n}\n```\nLauncher is used to launch chaincode runtimes.\n\n```go\ntype LedgerGetter interface {\n\tGetLedger(cid string) ledger.PeerLedger\n}\n```\nLedgerGetter is used to get ledgers for chaincode.\n\n```go\ntype Lifecycle interface {\n\t// ChaincodeDefinition returns the details for a chaincode by name\n\tChaincodeDefinition(chaincodeName string, qe ledger.QueryExecutor) (ccprovider.ChaincodeDefinition, error)\n\n\t// ChaincodeContainerInfo returns the package necessary to launch a chaincode\n\tChaincodeContainerInfo(chaincodeName string, qe ledger.QueryExecutor) (*ccprovider.ChaincodeContainerInfo, error)\n}\n```\nLifecycle provides a way to retrieve chaincode definitions and the packages necessary to run them\n\n```go\ntype MessageHandler interface {\n\tHandle(*pb.ChaincodeMessage, *TransactionContext) (*pb.ChaincodeMessage, error)\n}\n```\n\n```go\ntype PackageProvider interface {\n\tGetChaincodeCodePackage(ccname string, ccversion string) ([]byte, error)\n}\n```\nPackageProvider gets chaincode packages from the filesystem.\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 Processor interface {\n\tProcess(vmtype string, req container.VMCReq) error\n}\n```\nProcessor processes vm and container requests.\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```\nQueryResponseBuilder is responsible for building QueryResponse messages for query transactions initiated by chaincode.\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```\nBuildQueryResponse takes an iterator and fetch state to construct QueryResponse\n\n```go\ntype Registry interface {\n\tRegister(*Handler) error\n\tReady(cname string)\n\tFailed(cname string, err error)\n\tDeregister(cname string) error\n}\n```\nA Registry is responsible for tracking handlers.\n\n```go\ntype Runtime interface {\n\tStart(ccci *ccprovider.ChaincodeContainerInfo, codePackage []byte) error\n\tStop(ccci *ccprovider.ChaincodeContainerInfo) error\n\tWait(ccci *ccprovider.ChaincodeContainerInfo) (int, error)\n}\n```\nRuntime is used to manage chaincode runtime instances.\n\n```go\ntype RuntimeLauncher struct {\n\tRuntime         Runtime\n\tRegistry        LaunchRegistry\n\tPackageProvider PackageProvider\n\tStartupTimeout  time.Duration\n\tMetrics         *LaunchMetrics\n}\n```\nRuntimeLauncher is responsible for launching chaincode runtimes.\n\n```go\nfunc (r *RuntimeLauncher) Launch(ccci *ccprovider.ChaincodeContainerInfo) 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 SystemCCProvider interface {\n\tIsSysCC(name string) bool\n\tIsSysCCAndNotInvokableCC2CC(name string) bool\n}\n```\nSystemCCProvider provides system chaincode metadata.\n\n```go\ntype TransactionContext struct {\n\tChainID              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\t// cache used to save the result of collection acl\n\t// as a transactionContext is created for every chaincode\n\t// invoke (even in case of chaincode-calling-chaincode,\n\t// we do not need to store the namespace in the map and\n\t// collection alone is sufficient.\n\tAllowedCollectionAccess map[string]bool\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) InitializeQueryContext(queryID string, iter commonledger.ResultsIterator)\n```\n\n```go\ntype TransactionContexts struct {\n\t// contains filtered or unexported fields\n}\n```\nTransactionContexts maintains active transaction contexts for a Handler.\n\n```go\nfunc NewTransactionContexts() *TransactionContexts\n```\nNewTransactionContexts creates a registry for active transaction contexts.\n\n```go\nfunc (c *TransactionContexts) Close()\n```\nClose closes all query iterators assocated with the context.\n\n```go\nfunc (c *TransactionContexts) Create(txParams *ccprovider.TransactionParams) (*TransactionContext, error)\n```\nCreate creates a new TransactionContext for the specified chain and transaction ID. An error is returned when a transaction context has already been created for the specified chain and transaction ID.\n\n```go\nfunc (c *TransactionContexts) Delete(chainID, txID string)\n```\nDelete removes the transaction context associated with the specified chain and transaction ID.\n\n```go\nfunc (c *TransactionContexts) Get(chainID, txID string) *TransactionContext\n```\nGet retrieves the transaction context associated with the chain and transaction ID.\n\n```go\ntype TransactionRegistry interface {\n\tAdd(channelID, txID string) bool\n\tRemove(channelID, txID string)\n}\n```\nTransactionRegistry tracks active transactions for each channel.\n\n```go\ntype UUIDGenerator interface {\n\tNew() string\n}\n```\nUUIDGenerator is responsible for creating unique query identifiers.\n\n```go\ntype UUIDGeneratorFunc func() string\n```\n\n```go\nfunc (u UUIDGeneratorFunc) New() string\n```\n\n","path":"github.com/ctk-program/ctk/core/chaincode","name":"chaincode","synopsis":"","isRedistributable":true}
