Documentation
¶
Index ¶
- Constants
- func IsDevMode() bool
- func NewTxKey(channelID, txID string) string
- func ParseName(ccName string) *sysccprovider.ChaincodeInstance
- type ACLProvider
- type ActiveTransactions
- type ApplicationConfigRetriever
- type CCProviderImpl
- type CertGenerator
- type ChaincodeSupport
- 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
- type Config
- type ContainerRouter
- type ContainerRuntime
- type ContextRegistry
- type Executor
- type Handler
- 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) 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
- type 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
- type LaunchMetrics
- type LaunchRegistry
- type LaunchState
- type Launcher
- type LedgerGetter
- type Lifecycle
- func (l *Lifecycle) GetChaincodeDefinition(ctx context.Context, txid string, signedProp *pb.SignedProposal, ...) (ccprovider.ChaincodeDefinition, error)
- func (l *Lifecycle) GetChaincodeDeploymentSpec(ctx context.Context, txid string, signedProp *pb.SignedProposal, ...) (*pb.ChaincodeDeploymentSpec, error)
- type MessageHandler
- type PendingQueryResult
- type QueryResponseBuilder
- type QueryResponseGenerator
- type Registry
- type Runtime
- type RuntimeLauncher
- type State
- type TransactionContext
- 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
- type TransactionRegistry
- type TxQueryExecutorGetter
- type UUIDGenerator
- type UUIDGeneratorFunc
Constants ¶
View Source
const DevModeUserRunsChaincode string = "dev"
View Source
const (
InitializedKeyName = "\x00" + string(utf8.MaxRune) + "initialized"
)
Variables ¶
This section is empty.
Functions ¶
func ParseName ¶
func ParseName(ccName string) *sysccprovider.ChaincodeInstance
Types ¶
type ACLProvider ¶
type ActiveTransactions ¶
type ActiveTransactions struct {
// contains filtered or unexported fields
}
func NewActiveTransactions ¶
func NewActiveTransactions() *ActiveTransactions
func (*ActiveTransactions) Add ¶
func (a *ActiveTransactions) Add(channelID, txID string) bool
func (*ActiveTransactions) Remove ¶
func (a *ActiveTransactions) Remove(channelID, txID string)
type ApplicationConfigRetriever ¶
type ApplicationConfigRetriever interface {
GetApplicationConfig(cid string) (channelconfig.Application, bool)
}
type CCProviderImpl ¶
type CCProviderImpl struct {
// contains filtered or unexported fields
}
func NewProvider ¶
func NewProvider(cs *ChaincodeSupport) *CCProviderImpl
func (*CCProviderImpl) ExecuteLegacyInit ¶
func (c *CCProviderImpl) ExecuteLegacyInit(txParams *ccprovider.TransactionParams, cccid *ccprovider.CCContext, spec *pb.ChaincodeDeploymentSpec) (*pb.Response, *pb.ChaincodeEvent, error)
func (*CCProviderImpl) Stop ¶
func (c *CCProviderImpl) Stop(ccci *ccprovider.ChaincodeContainerInfo) error
type CertGenerator ¶
type CertGenerator interface {
Generate(ccName string) (*accesscontrol.CertAndPrivKeyPair, error)
}
type ChaincodeSupport ¶
type ChaincodeSupport struct { ACLProvider ACLProvider AppConfig ApplicationConfigRetriever BuiltinSCCs scc.BuiltinSCCs DeployedCCInfoProvider ledger.DeployedChaincodeInfoProvider ExecuteTimeout time.Duration HandlerMetrics *HandlerMetrics HandlerRegistry *HandlerRegistry Keepalive time.Duration Launcher Launcher Lifecycle Lifecycle Peer *peer.Peer Runtime Runtime TotalQueryLimit int UserRunsCC bool }
func (*ChaincodeSupport) CheckInvocation ¶
func (cs *ChaincodeSupport) CheckInvocation(txParams *ccprovider.TransactionParams, chaincodeName string, input *pb.ChaincodeInput) (ccid string, cctype pb.ChaincodeMessage_Type, err error)
func (*ChaincodeSupport) Execute ¶
func (cs *ChaincodeSupport) Execute(txParams *ccprovider.TransactionParams, chaincodeName string, input *pb.ChaincodeInput) (*pb.Response, *pb.ChaincodeEvent, error)
func (*ChaincodeSupport) ExecuteLegacyInit ¶
func (cs *ChaincodeSupport) ExecuteLegacyInit(txParams *ccprovider.TransactionParams, ccName, ccVersion string, input *pb.ChaincodeInput) (*pb.Response, *pb.ChaincodeEvent, error)
func (*ChaincodeSupport) HandleChaincodeStream ¶
func (cs *ChaincodeSupport) HandleChaincodeStream(stream ccintf.ChaincodeStream) error
func (*ChaincodeSupport) Invoke ¶
func (cs *ChaincodeSupport) Invoke(txParams *ccprovider.TransactionParams, chaincodeName string, input *pb.ChaincodeInput) (*pb.ChaincodeMessage, error)
func (*ChaincodeSupport) LaunchInProc ¶
func (cs *ChaincodeSupport) LaunchInProc(ccid string) <-chan struct{}
func (*ChaincodeSupport) Register ¶
func (cs *ChaincodeSupport) Register(stream pb.ChaincodeSupport_RegisterServer) error
type CollectionACLCache ¶
type CollectionACLCache map[string]*readWritePermission
type Config ¶
type Config struct { TotalQueryLimit int TLSEnabled bool Keepalive time.Duration ExecuteTimeout time.Duration StartupTimeout time.Duration LogFormat string LogLevel string ShimLogLevel string SCCWhitelist map[string]bool }
func GlobalConfig ¶
func GlobalConfig() *Config
type ContainerRouter ¶
type ContainerRuntime ¶
type ContainerRuntime struct { CertGenerator CertGenerator ContainerRouter ContainerRouter CACert []byte PeerAddress string }
func (*ContainerRuntime) Start ¶
func (c *ContainerRuntime) Start(ccid string) error
func (*ContainerRuntime) Stop ¶
func (c *ContainerRuntime) Stop(ccid string) error
type ContextRegistry ¶
type ContextRegistry interface { Create(txParams *ccprovider.TransactionParams) (*TransactionContext, error) Get(chainID, txID string) *TransactionContext Delete(chainID, txID string) Close() }
type Executor ¶
type Executor interface {
Execute(ctxt context.Context, cccid *ccprovider.CCContext, cis ccprovider.ChaincodeSpecGetter) (*pb.Response, *pb.ChaincodeEvent, error)
}
type Handler ¶
type Handler struct { Keepalive time.Duration TotalQueryLimit int Invoker Invoker Registry Registry ACLProvider ACLProvider TXContexts ContextRegistry ActiveTransactions TransactionRegistry BuiltinSCCs scc.BuiltinSCCs QueryResponseBuilder QueryResponseBuilder LedgerGetter LedgerGetter DeployedCCInfoProvider ledger.DeployedChaincodeInfoProvider UUIDGenerator UUIDGenerator AppConfig ApplicationConfigRetriever Metrics *HandlerMetrics // contains filtered or unexported fields }
func (*Handler) Execute ¶
func (h *Handler) Execute(txParams *ccprovider.TransactionParams, namespace string, msg *pb.ChaincodeMessage, timeout time.Duration) (*pb.ChaincodeMessage, error)
func (*Handler) HandleDelState ¶
func (h *Handler) HandleDelState(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)
func (*Handler) HandleGetHistoryForKey ¶
func (h *Handler) HandleGetHistoryForKey(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)
func (*Handler) HandleGetPrivateDataHash ¶
func (h *Handler) HandleGetPrivateDataHash(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)
func (*Handler) HandleGetQueryResult ¶
func (h *Handler) HandleGetQueryResult(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)
func (*Handler) HandleGetState ¶
func (h *Handler) HandleGetState(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)
func (*Handler) HandleGetStateByRange ¶
func (h *Handler) HandleGetStateByRange(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)
func (*Handler) HandleGetStateMetadata ¶
func (h *Handler) HandleGetStateMetadata(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)
func (*Handler) HandleInvokeChaincode ¶
func (h *Handler) HandleInvokeChaincode(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)
func (*Handler) HandlePutState ¶
func (h *Handler) HandlePutState(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)
func (*Handler) HandlePutStateMetadata ¶
func (h *Handler) HandlePutStateMetadata(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)
func (*Handler) HandleQueryStateClose ¶
func (h *Handler) HandleQueryStateClose(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)
func (*Handler) HandleQueryStateNext ¶
func (h *Handler) HandleQueryStateNext(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)
func (*Handler) HandleRegister ¶
func (h *Handler) HandleRegister(msg *pb.ChaincodeMessage)
func (*Handler) HandleTransaction ¶
func (h *Handler) HandleTransaction(msg *pb.ChaincodeMessage, delegate handleFunc)
func (*Handler) Notify ¶
func (h *Handler) Notify(msg *pb.ChaincodeMessage)
func (*Handler) ProcessStream ¶
func (h *Handler) ProcessStream(stream ccintf.ChaincodeStream) error
type HandlerMetrics ¶
type HandlerMetrics struct { ShimRequestsReceived metrics.Counter ShimRequestsCompleted metrics.Counter ShimRequestDuration metrics.Histogram ExecuteTimeouts metrics.Counter }
func NewHandlerMetrics ¶
func NewHandlerMetrics(p metrics.Provider) *HandlerMetrics
type HandlerRegistry ¶
type HandlerRegistry struct {
// contains filtered or unexported fields
}
func NewHandlerRegistry ¶
func NewHandlerRegistry(allowUnsolicitedRegistration bool) *HandlerRegistry
func (*HandlerRegistry) Deregister ¶
func (r *HandlerRegistry) Deregister(ccid string) error
func (*HandlerRegistry) Failed ¶
func (r *HandlerRegistry) Failed(ccid string, err error)
func (*HandlerRegistry) Handler ¶
func (r *HandlerRegistry) Handler(ccid string) *Handler
func (*HandlerRegistry) Launching ¶
func (r *HandlerRegistry) Launching(ccid string) (*LaunchState, bool)
func (*HandlerRegistry) Ready ¶
func (r *HandlerRegistry) Ready(ccid string)
func (*HandlerRegistry) Register ¶
func (r *HandlerRegistry) Register(h *Handler) error
type Invoker ¶
type Invoker interface {
Invoke(txParams *ccprovider.TransactionParams, chaincodeName string, spec *pb.ChaincodeInput) (*pb.ChaincodeMessage, error)
}
type LaunchMetrics ¶
type LaunchMetrics struct { LaunchDuration metrics.Histogram LaunchFailures metrics.Counter LaunchTimeouts metrics.Counter }
func NewLaunchMetrics ¶
func NewLaunchMetrics(p metrics.Provider) *LaunchMetrics
type LaunchRegistry ¶
type LaunchRegistry interface { Launching(ccid string) (launchState *LaunchState, started bool) Deregister(ccid string) error }
type LaunchState ¶
type LaunchState struct {
// contains filtered or unexported fields
}
func NewLaunchState ¶
func NewLaunchState() *LaunchState
func (*LaunchState) Done ¶
func (l *LaunchState) Done() <-chan struct{}
func (*LaunchState) Err ¶
func (l *LaunchState) Err() error
func (*LaunchState) Notify ¶
func (l *LaunchState) Notify(err error)
type LedgerGetter ¶
type LedgerGetter interface {
GetLedger(cid string) ledger.PeerLedger
}
type Lifecycle ¶
type Lifecycle struct {
Executor Executor
}
func (*Lifecycle) GetChaincodeDefinition ¶
func (l *Lifecycle) GetChaincodeDefinition( ctx context.Context, txid string, signedProp *pb.SignedProposal, prop *pb.Proposal, chainID string, chaincodeID string, ) (ccprovider.ChaincodeDefinition, error)
func (*Lifecycle) GetChaincodeDeploymentSpec ¶
type MessageHandler ¶
type MessageHandler interface {
Handle(*pb.ChaincodeMessage, *TransactionContext) (*pb.ChaincodeMessage, error)
}
type PendingQueryResult ¶
type PendingQueryResult struct {
// contains filtered or unexported fields
}
func (*PendingQueryResult) Add ¶
func (p *PendingQueryResult) Add(queryResult commonledger.QueryResult) error
func (*PendingQueryResult) Cut ¶
func (p *PendingQueryResult) Cut() []*pb.QueryResultBytes
func (*PendingQueryResult) Size ¶
func (p *PendingQueryResult) Size() int
type QueryResponseBuilder ¶
type QueryResponseBuilder interface { BuildQueryResponse(txContext *TransactionContext, iter commonledger.ResultsIterator, iterID string, isPaginated bool, totalReturnLimit int32) (*pb.QueryResponse, error) }
type QueryResponseGenerator ¶
type QueryResponseGenerator struct {
MaxResultLimit int
}
func (*QueryResponseGenerator) BuildQueryResponse ¶
func (q *QueryResponseGenerator) BuildQueryResponse(txContext *TransactionContext, iter commonledger.ResultsIterator, iterID string, isPaginated bool, totalReturnLimit int32) (*pb.QueryResponse, error)
type RuntimeLauncher ¶
type RuntimeLauncher struct { Runtime Runtime Registry LaunchRegistry StartupTimeout time.Duration Metrics *LaunchMetrics }
func (*RuntimeLauncher) Launch ¶
func (r *RuntimeLauncher) Launch(ccid string) error
type TransactionContext ¶
type TransactionContext struct { ChannelID string NamespaceID string SignedProp *pb.SignedProposal Proposal *pb.Proposal ResponseNotifier chan *pb.ChaincodeMessage TXSimulator ledger.TxSimulator HistoryQueryExecutor ledger.HistoryQueryExecutor CollectionStore privdata.CollectionStore IsInitTransaction bool CollectionACLCache CollectionACLCache // contains filtered or unexported fields }
func (*TransactionContext) CleanupQueryContext ¶
func (t *TransactionContext) CleanupQueryContext(queryID string)
func (*TransactionContext) CleanupQueryContextWithBookmark ¶
func (t *TransactionContext) CleanupQueryContextWithBookmark(queryID string) string
func (*TransactionContext) CloseQueryIterators ¶
func (t *TransactionContext) CloseQueryIterators()
func (*TransactionContext) GetPendingQueryResult ¶
func (t *TransactionContext) GetPendingQueryResult(queryID string) *PendingQueryResult
func (*TransactionContext) GetQueryIterator ¶
func (t *TransactionContext) GetQueryIterator(queryID string) commonledger.ResultsIterator
func (*TransactionContext) GetTotalReturnCount ¶
func (t *TransactionContext) GetTotalReturnCount(queryID string) *int32
func (*TransactionContext) InitializeCollectionACLCache ¶
func (t *TransactionContext) InitializeCollectionACLCache()
func (*TransactionContext) InitializeQueryContext ¶
func (t *TransactionContext) InitializeQueryContext(queryID string, iter commonledger.ResultsIterator)
type TransactionContexts ¶
type TransactionContexts struct {
// contains filtered or unexported fields
}
func NewTransactionContexts ¶
func NewTransactionContexts() *TransactionContexts
func (*TransactionContexts) Close ¶
func (c *TransactionContexts) Close()
func (*TransactionContexts) Create ¶
func (c *TransactionContexts) Create(txParams *ccprovider.TransactionParams) (*TransactionContext, error)
func (*TransactionContexts) Delete ¶
func (c *TransactionContexts) Delete(channelID, txID string)
func (*TransactionContexts) Get ¶
func (c *TransactionContexts) Get(channelID, txID string) *TransactionContext
type TransactionRegistry ¶
type TxQueryExecutorGetter ¶
type TxQueryExecutorGetter struct { HandlerRegistry *HandlerRegistry CCID string }
func (*TxQueryExecutorGetter) TxQueryExecutor ¶
func (g *TxQueryExecutorGetter) TxQueryExecutor(chainID, txID string) ledger.SimpleQueryExecutor
type UUIDGenerator ¶
type UUIDGenerator interface {
New() string
}
type UUIDGeneratorFunc ¶
type UUIDGeneratorFunc func() string
func (UUIDGeneratorFunc) New ¶
func (u UUIDGeneratorFunc) New() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.