Versions in this module Expand all Collapse all v1 v1.0.0 Jun 15, 2026 Changes in this version + const DevModeUserRunsChaincode + const ErrorExecutionTimeout + const ErrorStreamTerminated + const InitializedKeyName + func IsDevMode() bool + func NewTxKey(channelID, txID string) string + func ParseName(ccName string) *sysccprovider.ChaincodeInstance + type ACLProvider interface + CheckACL func(resName string, channelID string, idinfo interface{}) error + type ActiveTransactions struct + func NewActiveTransactions() *ActiveTransactions + func (a *ActiveTransactions) Add(channelID, txID string) bool + func (a *ActiveTransactions) Remove(channelID, txID string) + type ApplicationConfigRetriever interface + GetApplicationConfig func(cid string) (channelconfig.Application, bool) + type CertGenerator interface + Generate func(ccName string) (*accesscontrol.CertAndPrivKeyPair, error) + type ChaincodeSupport struct + ACLProvider ACLProvider + AppConfig ApplicationConfigRetriever + BuiltinSCCs scc.BuiltinSCCs + DeployedCCInfoProvider ledger.DeployedChaincodeInfoProvider + ExecuteTimeout time.Duration + HandlerMetrics *HandlerMetrics + HandlerRegistry *HandlerRegistry + InstallTimeout time.Duration + Keepalive time.Duration + Launcher Launcher + Lifecycle Lifecycle + Peer *peer.Peer + Runtime Runtime + TotalQueryLimit int + UserRunsCC bool + func (cs *ChaincodeSupport) CheckInvocation(txParams *ccprovider.TransactionParams, chaincodeName string, ...) (ccid string, cctype pb.ChaincodeMessage_Type, err error) + func (cs *ChaincodeSupport) Execute(txParams *ccprovider.TransactionParams, chaincodeName string, ...) (*pb.Response, *pb.ChaincodeEvent, error) + func (cs *ChaincodeSupport) ExecuteLegacyInit(txParams *ccprovider.TransactionParams, ccName, ccVersion string, ...) (*pb.Response, *pb.ChaincodeEvent, error) + func (cs *ChaincodeSupport) HandleChaincodeStream(stream ccintf.ChaincodeStream) error + func (cs *ChaincodeSupport) Invoke(txParams *ccprovider.TransactionParams, chaincodeName string, ...) (*pb.ChaincodeMessage, error) + func (cs *ChaincodeSupport) Launch(ccid string) (*Handler, error) + func (cs *ChaincodeSupport) LaunchInProc(ccid string) <-chan struct{} + func (cs *ChaincodeSupport) Register(stream pb.ChaincodeSupport_RegisterServer) error + type CollectionACLCache map[string]*readWritePermission + type Config struct + ExecuteTimeout time.Duration + InstallTimeout time.Duration + Keepalive time.Duration + LogFormat string + LogLevel string + SCCAllowlist map[string]bool + ShimLogLevel string + StartupTimeout time.Duration + TLSEnabled bool + TotalQueryLimit int + func GlobalConfig() *Config + type ConnectionHandler interface + Stream func(ccid string, ccinfo *ccintf.ChaincodeServerInfo, sHandler extcc.StreamHandler) error + type ContainerRouter interface + Build func(ccid string) error + ChaincodeServerInfo func(ccid string) (*ccintf.ChaincodeServerInfo, error) + Start func(ccid string, peerConnection *ccintf.PeerConnection) error + Stop func(ccid string) error + Wait func(ccid string) (int, error) + type ContainerRuntime struct + BuildRegistry *container.BuildRegistry + ContainerRouter ContainerRouter + func (c *ContainerRuntime) Build(ccid string) (*ccintf.ChaincodeServerInfo, error) + func (c *ContainerRuntime) Start(ccid string, ccinfo *ccintf.PeerConnection) error + func (c *ContainerRuntime) Stop(ccid string) error + func (c *ContainerRuntime) Wait(ccid string) (int, error) + type ContextRegistry interface + Close func() + Create func(txParams *ccprovider.TransactionParams) (*TransactionContext, error) + Delete func(channelID, txID string) + Get func(channelID, txID string) *TransactionContext + type Handler struct + ACLProvider ACLProvider + ActiveTransactions TransactionRegistry + AppConfig ApplicationConfigRetriever + BuiltinSCCs scc.BuiltinSCCs + DeployedCCInfoProvider ledger.DeployedChaincodeInfoProvider + IDDeserializerFactory privdata.IdentityDeserializerFactory + Invoker Invoker + Keepalive time.Duration + LedgerGetter LedgerGetter + Metrics *HandlerMetrics + QueryResponseBuilder QueryResponseBuilder + Registry Registry + TXContexts ContextRegistry + TotalQueryLimit int + UUIDGenerator UUIDGenerator + func (h *Handler) Close() + func (h *Handler) Execute(txParams *ccprovider.TransactionParams, namespace string, ...) (*pb.ChaincodeMessage, error) + func (h *Handler) HandleDelState(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error) + func (h *Handler) HandleGetHistoryForKey(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error) + func (h *Handler) HandleGetPrivateDataHash(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error) + func (h *Handler) HandleGetQueryResult(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error) + func (h *Handler) HandleGetState(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error) + func (h *Handler) HandleGetStateByRange(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error) + func (h *Handler) HandleGetStateMetadata(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error) + func (h *Handler) HandleInvokeChaincode(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error) + func (h *Handler) HandlePurgePrivateData(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error) + func (h *Handler) HandlePutState(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error) + func (h *Handler) HandlePutStateMetadata(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error) + func (h *Handler) HandleQueryStateClose(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error) + func (h *Handler) HandleQueryStateNext(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error) + func (h *Handler) HandleRegister(msg *pb.ChaincodeMessage) + func (h *Handler) HandleTransaction(msg *pb.ChaincodeMessage, delegate handleFunc) + func (h *Handler) Notify(msg *pb.ChaincodeMessage) + func (h *Handler) ProcessStream(stream ccintf.ChaincodeStream) error + func (h *Handler) State() State + type HandlerMetrics struct + ExecuteTimeouts metrics.Counter + ShimRequestDuration metrics.Histogram + ShimRequestsCompleted metrics.Counter + ShimRequestsReceived metrics.Counter + func NewHandlerMetrics(p metrics.Provider) *HandlerMetrics + type HandlerRegistry struct + func NewHandlerRegistry(allowUnsolicitedRegistration bool) *HandlerRegistry + func (r *HandlerRegistry) Deregister(ccid string) error + func (r *HandlerRegistry) Failed(ccid string, err error) + func (r *HandlerRegistry) Handler(ccid string) *Handler + func (r *HandlerRegistry) Launching(ccid string) (*LaunchState, bool) + func (r *HandlerRegistry) Ready(ccid string) + func (r *HandlerRegistry) Register(h *Handler) error + type Invoker interface + Invoke func(txParams *ccprovider.TransactionParams, chaincodeName string, ...) (*pb.ChaincodeMessage, error) + type LaunchMetrics struct + LaunchDuration metrics.Histogram + LaunchFailures metrics.Counter + LaunchTimeouts metrics.Counter + func NewLaunchMetrics(p metrics.Provider) *LaunchMetrics + type LaunchRegistry interface + Deregister func(ccid string) error + Launching func(ccid string) (launchState *LaunchState, started bool) + type LaunchState struct + func NewLaunchState() *LaunchState + func (l *LaunchState) Done() <-chan struct{} + func (l *LaunchState) Err() error + func (l *LaunchState) Notify(err error) + type Launcher interface + Launch func(ccid string, streamHandler extcc.StreamHandler) error + Stop func(ccid string) error + type LedgerGetter interface + GetLedger func(cid string) ledger.PeerLedger + type Lifecycle interface + ChaincodeEndorsementInfo func(channelID, chaincodeName string, qe ledger.SimpleQueryExecutor) (*lifecycle.ChaincodeEndorsementInfo, error) + type MessageHandler interface + Handle func(*pb.ChaincodeMessage, *TransactionContext) (*pb.ChaincodeMessage, error) + type PendingQueryResult struct + func (p *PendingQueryResult) Add(queryResult commonledger.QueryResult) error + func (p *PendingQueryResult) Cut() []*pb.QueryResultBytes + func (p *PendingQueryResult) Size() int + type QueryResponseBuilder interface + BuildQueryResponse func(txContext *TransactionContext, iter commonledger.ResultsIterator, ...) (*pb.QueryResponse, error) + type QueryResponseGenerator struct + MaxResultLimit int + func (q *QueryResponseGenerator) BuildQueryResponse(txContext *TransactionContext, iter commonledger.ResultsIterator, ...) (*pb.QueryResponse, error) + type Registry interface + Deregister func(string) error + Failed func(string, error) + Ready func(string) + Register func(*Handler) error + type Runtime interface + Build func(ccid string) (*ccintf.ChaincodeServerInfo, error) + Start func(ccid string, ccinfo *ccintf.PeerConnection) error + Stop func(ccid string) error + Wait func(ccid string) (int, error) + type RuntimeLauncher struct + CACert []byte + CertGenerator CertGenerator + ConnectionHandler ConnectionHandler + Metrics *LaunchMetrics + PeerAddress string + Registry LaunchRegistry + Runtime Runtime + StartupTimeout time.Duration + func (r *RuntimeLauncher) ChaincodeClientInfo(ccid string) (*ccintf.PeerConnection, error) + func (r *RuntimeLauncher) Launch(ccid string, streamHandler extcc.StreamHandler) error + func (r *RuntimeLauncher) Stop(ccid string) error + type State int + const Created + const Established + const Ready + func (s State) String() string + type TransactionContext struct + ChannelID string + CollectionACLCache CollectionACLCache + CollectionStore privdata.CollectionStore + HistoryQueryExecutor ledger.HistoryQueryExecutor + IsInitTransaction bool + NamespaceID string + Proposal *pb.Proposal + ResponseNotifier chan *pb.ChaincodeMessage + SignedProp *pb.SignedProposal + TXSimulator ledger.TxSimulator + func (t *TransactionContext) CleanupQueryContext(queryID string) + func (t *TransactionContext) CleanupQueryContextWithBookmark(queryID string) string + func (t *TransactionContext) CloseQueryIterators() + func (t *TransactionContext) GetPendingQueryResult(queryID string) *PendingQueryResult + func (t *TransactionContext) GetQueryIterator(queryID string) commonledger.ResultsIterator + func (t *TransactionContext) GetTotalReturnCount(queryID string) *int32 + func (t *TransactionContext) InitializeCollectionACLCache() + func (t *TransactionContext) InitializeQueryContext(queryID string, iter commonledger.ResultsIterator) + type TransactionContexts struct + func NewTransactionContexts() *TransactionContexts + func (c *TransactionContexts) Close() + func (c *TransactionContexts) Create(txParams *ccprovider.TransactionParams) (*TransactionContext, error) + func (c *TransactionContexts) Delete(channelID, txID string) + func (c *TransactionContexts) Get(channelID, txID string) *TransactionContext + type TransactionRegistry interface + Add func(channelID, txID string) bool + Remove func(channelID, txID string) + type TxQueryExecutorGetter struct + CCID string + HandlerRegistry *HandlerRegistry + func (g *TxQueryExecutorGetter) TxQueryExecutor(chainID, txID string) ledger.SimpleQueryExecutor + type UUIDGenerator interface + New func() string + type UUIDGeneratorFunc func() string + func (u UUIDGeneratorFunc) New() string