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

package chaincode

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

Index

Package Files

active_transactions.go ccproviderimpl.go chaincode_support.go config.go container_runtime.go handler.go handler_registry.go metrics.go pending_query_result.go query_response_generator.go runtime_launcher.go transaction_context.go transaction_contexts.go

Constants

const (
    // Mutual TLS auth client key and cert paths in the chaincode container
    TLSClientKeyPath      string = "/etc/hyperledger/fabric/client.key"
    TLSClientCertPath     string = "/etc/hyperledger/fabric/client.crt"
    TLSClientRootCertPath string = "/etc/hyperledger/fabric/peer.crt"
)
const (
    // TXSimulatorKey is the context key used to provide a ledger.TxSimulator
    // from the endorser to the chaincode.
    TXSimulatorKey key = "txsimulatorkey"

    // HistoryQueryExecutorKey is the context key used to provide a
    // ledger.HistoryQueryExecutor from the endorser to the chaincode.
    HistoryQueryExecutorKey key = "historyqueryexecutorkey"
)
const DevModeUserRunsChaincode string = "dev"

DevModeUserRunsChaincode enables chaincode execution in a development environment

func IsDevMode Uses

func IsDevMode() bool

IsDevMode returns true if the peer was configured with development-mode enabled.

func NewTxKey Uses

func NewTxKey(channelID, txID string) string

func ParseName Uses

func ParseName(ccName string) *sysccprovider.ChaincodeInstance

ParseName parses a chaincode name into a ChaincodeInstance. The name should be of the form "chaincode-name:version/channel-name" with optional elements.

type ACLProvider Uses

type ACLProvider interface {
    CheckACL(resName string, channelID string, idinfo interface{}) error
}

An ACLProvider performs access control checks when invoking chaincode.

type ActiveTransactions Uses

type ActiveTransactions struct {
    // contains filtered or unexported fields
}

func NewActiveTransactions Uses

func NewActiveTransactions() *ActiveTransactions

func (*ActiveTransactions) Add Uses

func (a *ActiveTransactions) Add(channelID, txID string) bool

func (*ActiveTransactions) Remove Uses

func (a *ActiveTransactions) Remove(channelID, txID string)

type ApplicationConfigRetriever Uses

type ApplicationConfigRetriever interface {
    // GetApplicationConfig returns the channelconfig.Application for the channel
    // and whether the Application config exists
    GetApplicationConfig(cid string) (channelconfig.Application, bool)
}

ApplicationConfigRetriever to retrieve the application configuration for a channel

type CCProviderImpl Uses

type CCProviderImpl struct {
    // contains filtered or unexported fields
}

ccProviderImpl is an implementation of the ccprovider.ChaincodeProvider interface

func NewProvider Uses

func NewProvider(cs *ChaincodeSupport) *CCProviderImpl

func (*CCProviderImpl) Execute Uses

func (c *CCProviderImpl) Execute(txParams *ccprovider.TransactionParams, cccid *ccprovider.CCContext, input *pb.ChaincodeInput) (*pb.Response, *pb.ChaincodeEvent, error)

Execute executes the chaincode given context and spec (invocation or deploy)

func (*CCProviderImpl) ExecuteLegacyInit Uses

func (c *CCProviderImpl) ExecuteLegacyInit(txParams *ccprovider.TransactionParams, cccid *ccprovider.CCContext, spec *pb.ChaincodeDeploymentSpec) (*pb.Response, *pb.ChaincodeEvent, error)

ExecuteLegacyInit executes a chaincode which is not in the LSCC table

func (*CCProviderImpl) Stop Uses

func (c *CCProviderImpl) Stop(ccci *ccprovider.ChaincodeContainerInfo) error

Stop stops the chaincode given context and spec

type CertGenerator Uses

type CertGenerator interface {
    // Generate returns a certificate and private key and associates
    // the hash of the certificates with the given chaincode name
    Generate(ccName string) (*accesscontrol.CertAndPrivKeyPair, error)
}

CertGenerator generates client certificates for chaincode.

type ChaincodeDefinitionGetter Uses

type ChaincodeDefinitionGetter interface {
    ChaincodeDefinition(chaincodeName string, txSim ledger.QueryExecutor) (ccprovider.ChaincodeDefinition, error)
}

ChaincodeDefinitionGetter is responsible for retrieving a chaincode definition from the system. The definition is used by the InstantiationPolicyChecker.

type ChaincodeSupport Uses

type ChaincodeSupport struct {
    Keepalive        time.Duration
    ExecuteTimeout   time.Duration
    UserRunsCC       bool
    Runtime          Runtime
    ACLProvider      ACLProvider
    HandlerRegistry  *HandlerRegistry
    Launcher         Launcher
    SystemCCProvider sysccprovider.SystemChaincodeProvider
    Lifecycle        Lifecycle

    HandlerMetrics *HandlerMetrics
    LaunchMetrics  *LaunchMetrics
    // contains filtered or unexported fields
}

ChaincodeSupport responsible for providing interfacing with chaincodes from the Peer.

func NewChaincodeSupport Uses

func NewChaincodeSupport(
    config *Config,
    peerAddress string,
    userRunsCC bool,
    caCert []byte,
    certGenerator CertGenerator,
    packageProvider PackageProvider,
    lifecycle Lifecycle,
    aclProvider ACLProvider,
    processor Processor,
    SystemCCProvider sysccprovider.SystemChaincodeProvider,
    platformRegistry *platforms.Registry,
    appConfig ApplicationConfigRetriever,
    metricsProvider metrics.Provider,
) *ChaincodeSupport

NewChaincodeSupport creates a new ChaincodeSupport instance.

func (*ChaincodeSupport) Execute Uses

func (cs *ChaincodeSupport) Execute(txParams *ccprovider.TransactionParams, cccid *ccprovider.CCContext, input *pb.ChaincodeInput) (*pb.Response, *pb.ChaincodeEvent, error)

Execute invokes chaincode and returns the original response.

func (*ChaincodeSupport) ExecuteLegacyInit Uses

func (cs *ChaincodeSupport) ExecuteLegacyInit(txParams *ccprovider.TransactionParams, cccid *ccprovider.CCContext, spec *pb.ChaincodeDeploymentSpec) (*pb.Response, *pb.ChaincodeEvent, error)

ExecuteLegacyInit 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.

func (*ChaincodeSupport) HandleChaincodeStream Uses

func (cs *ChaincodeSupport) HandleChaincodeStream(stream ccintf.ChaincodeStream) error

HandleChaincodeStream implements ccintf.HandleChaincodeStream for all vms to call with appropriate stream

func (*ChaincodeSupport) Invoke Uses

func (cs *ChaincodeSupport) Invoke(txParams *ccprovider.TransactionParams, cccid *ccprovider.CCContext, input *pb.ChaincodeInput) (*pb.ChaincodeMessage, error)

Invoke will invoke chaincode and return the message containing the response. The chaincode will be launched if it is not already running.

func (*ChaincodeSupport) InvokeInit Uses

func (cs *ChaincodeSupport) InvokeInit(txParams *ccprovider.TransactionParams, cccid *ccprovider.CCContext, input *pb.ChaincodeInput) (*pb.ChaincodeMessage, error)

func (*ChaincodeSupport) Launch Uses

func (cs *ChaincodeSupport) Launch(chainID, chaincodeName, chaincodeVersion string, qe ledger.QueryExecutor) (*Handler, error)

Launch 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.

func (*ChaincodeSupport) LaunchInit Uses

func (cs *ChaincodeSupport) LaunchInit(ccci *ccprovider.ChaincodeContainerInfo) error

LaunchInit 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

func (*ChaincodeSupport) Register Uses

func (cs *ChaincodeSupport) Register(stream pb.ChaincodeSupport_RegisterServer) error

Register the bidi stream entry point called by chaincode to register with the Peer.

func (*ChaincodeSupport) Stop Uses

func (cs *ChaincodeSupport) Stop(ccci *ccprovider.ChaincodeContainerInfo) error

Stop stops a chaincode if running.

type CheckInstantiationPolicyFunc Uses

type CheckInstantiationPolicyFunc func(name, version string, cd *ccprovider.ChaincodeData) error

Adapter from function to InstantiationPolicyChecker interface.

func (CheckInstantiationPolicyFunc) CheckInstantiationPolicy Uses

func (c CheckInstantiationPolicyFunc) CheckInstantiationPolicy(name, version string, cd *ccprovider.ChaincodeData) error

type Config Uses

type Config struct {
    TLSEnabled     bool
    Keepalive      time.Duration
    ExecuteTimeout time.Duration
    StartupTimeout time.Duration
    LogFormat      string
    LogLevel       string
    ShimLogLevel   string
}

func GlobalConfig Uses

func GlobalConfig() *Config

type ContainerRuntime Uses

type ContainerRuntime struct {
    CertGenerator    CertGenerator
    Processor        Processor
    CACert           []byte
    CommonEnv        []string
    PeerAddress      string
    PlatformRegistry *platforms.Registry
}

ContainerRuntime is responsible for managing containerized chaincode.

func (*ContainerRuntime) LaunchConfig Uses

func (c *ContainerRuntime) LaunchConfig(cname string, ccType string) (*LaunchConfig, error)

LaunchConfig creates the LaunchConfig for chaincode running in a container.

func (*ContainerRuntime) Start Uses

func (c *ContainerRuntime) Start(ccci *ccprovider.ChaincodeContainerInfo, codePackage []byte) error

Start launches chaincode in a runtime environment.

func (*ContainerRuntime) Stop Uses

func (c *ContainerRuntime) Stop(ccci *ccprovider.ChaincodeContainerInfo) error

Stop terminates chaincode and its container runtime environment.

func (*ContainerRuntime) Wait Uses

func (c *ContainerRuntime) Wait(ccci *ccprovider.ChaincodeContainerInfo) (int, error)

Wait waits for the container runtime to terminate.

type ContextRegistry Uses

type ContextRegistry interface {
    Create(txParams *ccprovider.TransactionParams) (*TransactionContext, error)
    Get(chainID, txID string) *TransactionContext
    Delete(chainID, txID string)
    Close()
}

A ContextRegistry is responsible for managing transaction contexts.

type Handler Uses

type Handler struct {
    // Keepalive specifies the interval at which keep-alive messages are sent.
    Keepalive time.Duration
    // SystemCCVersion specifies the current system chaincode version
    SystemCCVersion string
    // DefinitionGetter is used to retrieve the chaincode definition from the
    // Lifecycle System Chaincode.
    DefinitionGetter ChaincodeDefinitionGetter
    // Invoker is used to invoke chaincode.
    Invoker Invoker
    // Registry is used to track active handlers.
    Registry Registry
    // ACLProvider is used to check if a chaincode invocation should be allowed.
    ACLProvider ACLProvider
    // TXContexts is a collection of TransactionContext instances
    // that are accessed by channel name and transaction ID.
    TXContexts ContextRegistry
    // activeTransactions holds active transaction identifiers.
    ActiveTransactions TransactionRegistry
    // SystemCCProvider provides access to system chaincode metadata
    SystemCCProvider SystemCCProvider
    // InstantiationPolicyChecker is used to evaluate the chaincode instantiation policies.
    InstantiationPolicyChecker InstantiationPolicyChecker
    // QueryResponeBuilder is used to build query responses
    QueryResponseBuilder QueryResponseBuilder
    // LedgerGetter is used to get the ledger associated with a channel
    LedgerGetter LedgerGetter
    // UUIDGenerator is used to generate UUIDs
    UUIDGenerator UUIDGenerator
    // AppConfig is used to retrieve the application config for a channel
    AppConfig ApplicationConfigRetriever

    // Metrics holds chaincode handler metrics
    Metrics *HandlerMetrics
    // contains filtered or unexported fields
}

Handler implements the peer side of the chaincode stream.

func (*Handler) ChaincodeName Uses

func (h *Handler) ChaincodeName() string

func (*Handler) Close Uses

func (h *Handler) Close()

func (*Handler) Execute Uses

func (h *Handler) Execute(txParams *ccprovider.TransactionParams, cccid *ccprovider.CCContext, msg *pb.ChaincodeMessage, timeout time.Duration) (*pb.ChaincodeMessage, error)

func (*Handler) HandleDelState Uses

func (h *Handler) HandleDelState(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)

func (*Handler) HandleGetHistoryForKey Uses

func (h *Handler) HandleGetHistoryForKey(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)

Handles query to ledger history db

func (*Handler) HandleGetPrivateDataHash Uses

func (h *Handler) HandleGetPrivateDataHash(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)

func (*Handler) HandleGetQueryResult Uses

func (h *Handler) HandleGetQueryResult(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)

Handles query to ledger to execute query state

func (*Handler) HandleGetState Uses

func (h *Handler) HandleGetState(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)

Handles query to ledger to get state

func (*Handler) HandleGetStateByRange Uses

func (h *Handler) HandleGetStateByRange(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)

Handles query to ledger to rage query state

func (*Handler) HandleGetStateMetadata Uses

func (h *Handler) HandleGetStateMetadata(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)

Handles query to ledger to get state metadata

func (*Handler) HandleInvokeChaincode Uses

func (h *Handler) HandleInvokeChaincode(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)

Handles requests that modify ledger state

func (*Handler) HandlePutState Uses

func (h *Handler) HandlePutState(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)

func (*Handler) HandlePutStateMetadata Uses

func (h *Handler) HandlePutStateMetadata(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)

func (*Handler) HandleQueryStateClose Uses

func (h *Handler) HandleQueryStateClose(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)

Handles the closing of a state iterator

func (*Handler) HandleQueryStateNext Uses

func (h *Handler) HandleQueryStateNext(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error)

Handles query to ledger for query state next

func (*Handler) HandleRegister Uses

func (h *Handler) HandleRegister(msg *pb.ChaincodeMessage)

handleRegister is invoked when chaincode tries to register.

func (*Handler) HandleTransaction Uses

func (h *Handler) HandleTransaction(msg *pb.ChaincodeMessage, delegate handleFunc)

HandleTransaction 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.

func (*Handler) Notify Uses

func (h *Handler) Notify(msg *pb.ChaincodeMessage)

func (*Handler) ProcessStream Uses

func (h *Handler) ProcessStream(stream ccintf.ChaincodeStream) error

func (*Handler) State Uses

func (h *Handler) State() State

type HandlerMetrics Uses

type HandlerMetrics struct {
    ShimRequestsReceived  metrics.Counter
    ShimRequestsCompleted metrics.Counter
    ShimRequestDuration   metrics.Histogram
    ExecuteTimeouts       metrics.Counter
}

func NewHandlerMetrics Uses

func NewHandlerMetrics(p metrics.Provider) *HandlerMetrics

type HandlerRegistry Uses

type HandlerRegistry struct {
    // contains filtered or unexported fields
}

HandlerRegistry maintains chaincode Handler instances.

func NewHandlerRegistry Uses

func NewHandlerRegistry(allowUnsolicitedRegistration bool) *HandlerRegistry

NewHandlerRegistry constructs a HandlerRegistry.

func (*HandlerRegistry) Deregister Uses

func (r *HandlerRegistry) Deregister(cname string) error

Deregister 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.

func (*HandlerRegistry) Failed Uses

func (r *HandlerRegistry) Failed(cname string, err error)

Failed indicates that registration of a launched chaincode has failed.

func (*HandlerRegistry) Handler Uses

func (r *HandlerRegistry) Handler(cname string) *Handler

Handler retrieves the handler for a chaincode instance.

func (*HandlerRegistry) Launching Uses

func (r *HandlerRegistry) Launching(cname string) (*LaunchState, bool)

Launching 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.

func (*HandlerRegistry) Ready Uses

func (r *HandlerRegistry) Ready(cname string)

Ready indicates that the chaincode registration has completed and the READY response has been sent to the chaincode.

func (*HandlerRegistry) Register Uses

func (r *HandlerRegistry) Register(h *Handler) error

Register 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.

type InstantiationPolicyChecker Uses

type InstantiationPolicyChecker interface {
    CheckInstantiationPolicy(name, version string, cd *ccprovider.ChaincodeData) error
}

InstantiationPolicyChecker is used to evaluate instantiation policies.

type Invoker Uses

type Invoker interface {
    Invoke(txParams *ccprovider.TransactionParams, cccid *ccprovider.CCContext, spec *pb.ChaincodeInput) (*pb.ChaincodeMessage, error)
}

An Invoker invokes chaincode.

type LaunchConfig Uses

type LaunchConfig struct {
    Args  []string
    Envs  []string
    Files map[string][]byte
}

LaunchConfig holds chaincode launch arguments, environment variables, and files.

func (*LaunchConfig) String Uses

func (lc *LaunchConfig) String() string

type LaunchMetrics Uses

type LaunchMetrics struct {
    LaunchDuration metrics.Histogram
    LaunchFailures metrics.Counter
    LaunchTimeouts metrics.Counter
}

func NewLaunchMetrics Uses

func NewLaunchMetrics(p metrics.Provider) *LaunchMetrics

type LaunchRegistry Uses

type LaunchRegistry interface {
    Launching(cname string) (launchState *LaunchState, started bool)
    Deregister(cname string) error
}

LaunchRegistry tracks launching chaincode instances.

type LaunchState Uses

type LaunchState struct {
    // contains filtered or unexported fields
}

func NewLaunchState Uses

func NewLaunchState() *LaunchState

func (*LaunchState) Done Uses

func (l *LaunchState) Done() <-chan struct{}

func (*LaunchState) Err Uses

func (l *LaunchState) Err() error

func (*LaunchState) Notify Uses

func (l *LaunchState) Notify(err error)

type Launcher Uses

type Launcher interface {
    Launch(ccci *ccprovider.ChaincodeContainerInfo) error
}

Launcher is used to launch chaincode runtimes.

type LedgerGetter Uses

type LedgerGetter interface {
    GetLedger(cid string) ledger.PeerLedger
}

LedgerGetter is used to get ledgers for chaincode.

type Lifecycle Uses

type Lifecycle interface {
    // ChaincodeDefinition returns the details for a chaincode by name
    ChaincodeDefinition(chaincodeName string, qe ledger.QueryExecutor) (ccprovider.ChaincodeDefinition, error)

    // ChaincodeContainerInfo returns the package necessary to launch a chaincode
    ChaincodeContainerInfo(chaincodeName string, qe ledger.QueryExecutor) (*ccprovider.ChaincodeContainerInfo, error)
}

Lifecycle provides a way to retrieve chaincode definitions and the packages necessary to run them

type MessageHandler Uses

type MessageHandler interface {
    Handle(*pb.ChaincodeMessage, *TransactionContext) (*pb.ChaincodeMessage, error)
}

type PackageProvider Uses

type PackageProvider interface {
    GetChaincodeCodePackage(ccname string, ccversion string) ([]byte, error)
}

PackageProvider gets chaincode packages from the filesystem.

type PendingQueryResult Uses

type PendingQueryResult struct {
    // contains filtered or unexported fields
}

func (*PendingQueryResult) Add Uses

func (p *PendingQueryResult) Add(queryResult commonledger.QueryResult) error

func (*PendingQueryResult) Cut Uses

func (p *PendingQueryResult) Cut() []*pb.QueryResultBytes

func (*PendingQueryResult) Size Uses

func (p *PendingQueryResult) Size() int

type Processor Uses

type Processor interface {
    Process(vmtype string, req container.VMCReq) error
}

Processor processes vm and container requests.

type QueryResponseBuilder Uses

type QueryResponseBuilder interface {
    BuildQueryResponse(txContext *TransactionContext, iter commonledger.ResultsIterator,
        iterID string, isPaginated bool, totalReturnLimit int32) (*pb.QueryResponse, error)
}

QueryResponseBuilder is responsible for building QueryResponse messages for query transactions initiated by chaincode.

type QueryResponseGenerator Uses

type QueryResponseGenerator struct {
    MaxResultLimit int
}

func (*QueryResponseGenerator) BuildQueryResponse Uses

func (q *QueryResponseGenerator) BuildQueryResponse(txContext *TransactionContext, iter commonledger.ResultsIterator,
    iterID string, isPaginated bool, totalReturnLimit int32) (*pb.QueryResponse, error)

BuildQueryResponse takes an iterator and fetch state to construct QueryResponse

type Registry Uses

type Registry interface {
    Register(*Handler) error
    Ready(cname string)
    Failed(cname string, err error)
    Deregister(cname string) error
}

A Registry is responsible for tracking handlers.

type Runtime Uses

type Runtime interface {
    Start(ccci *ccprovider.ChaincodeContainerInfo, codePackage []byte) error
    Stop(ccci *ccprovider.ChaincodeContainerInfo) error
    Wait(ccci *ccprovider.ChaincodeContainerInfo) (int, error)
}

Runtime is used to manage chaincode runtime instances.

type RuntimeLauncher Uses

type RuntimeLauncher struct {
    Runtime         Runtime
    Registry        LaunchRegistry
    PackageProvider PackageProvider
    StartupTimeout  time.Duration
    Metrics         *LaunchMetrics
}

RuntimeLauncher is responsible for launching chaincode runtimes.

func (*RuntimeLauncher) Launch Uses

func (r *RuntimeLauncher) Launch(ccci *ccprovider.ChaincodeContainerInfo) error

type State Uses

type State int
const (
    Created State = iota
    Established
    Ready
)

func (State) String Uses

func (s State) String() string

type SystemCCProvider Uses

type SystemCCProvider interface {
    IsSysCC(name string) bool
    IsSysCCAndNotInvokableCC2CC(name string) bool
}

SystemCCProvider provides system chaincode metadata.

type TransactionContext Uses

type TransactionContext struct {
    ChainID              string
    SignedProp           *pb.SignedProposal
    Proposal             *pb.Proposal
    ResponseNotifier     chan *pb.ChaincodeMessage
    TXSimulator          ledger.TxSimulator
    HistoryQueryExecutor ledger.HistoryQueryExecutor
    CollectionStore      privdata.CollectionStore
    IsInitTransaction    bool

    // cache used to save the result of collection acl
    // as a transactionContext is created for every chaincode
    // invoke (even in case of chaincode-calling-chaincode,
    // we do not need to store the namespace in the map and
    // collection alone is sufficient.
    AllowedCollectionAccess map[string]bool
    // contains filtered or unexported fields
}

func (*TransactionContext) CleanupQueryContext Uses

func (t *TransactionContext) CleanupQueryContext(queryID string)

func (*TransactionContext) CleanupQueryContextWithBookmark Uses

func (t *TransactionContext) CleanupQueryContextWithBookmark(queryID string) string

func (*TransactionContext) CloseQueryIterators Uses

func (t *TransactionContext) CloseQueryIterators()

func (*TransactionContext) GetPendingQueryResult Uses

func (t *TransactionContext) GetPendingQueryResult(queryID string) *PendingQueryResult

func (*TransactionContext) GetQueryIterator Uses

func (t *TransactionContext) GetQueryIterator(queryID string) commonledger.ResultsIterator

func (*TransactionContext) GetTotalReturnCount Uses

func (t *TransactionContext) GetTotalReturnCount(queryID string) *int32

func (*TransactionContext) InitializeQueryContext Uses

func (t *TransactionContext) InitializeQueryContext(queryID string, iter commonledger.ResultsIterator)

type TransactionContexts Uses

type TransactionContexts struct {
    // contains filtered or unexported fields
}

TransactionContexts maintains active transaction contexts for a Handler.

func NewTransactionContexts Uses

func NewTransactionContexts() *TransactionContexts

NewTransactionContexts creates a registry for active transaction contexts.

func (*TransactionContexts) Close Uses

func (c *TransactionContexts) Close()

Close closes all query iterators assocated with the context.

func (*TransactionContexts) Create Uses

func (c *TransactionContexts) Create(txParams *ccprovider.TransactionParams) (*TransactionContext, error)

Create 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.

func (*TransactionContexts) Delete Uses

func (c *TransactionContexts) Delete(chainID, txID string)

Delete removes the transaction context associated with the specified chain and transaction ID.

func (*TransactionContexts) Get Uses

func (c *TransactionContexts) Get(chainID, txID string) *TransactionContext

Get retrieves the transaction context associated with the chain and transaction ID.

type TransactionRegistry Uses

type TransactionRegistry interface {
    Add(channelID, txID string) bool
    Remove(channelID, txID string)
}

TransactionRegistry tracks active transactions for each channel.

type UUIDGenerator Uses

type UUIDGenerator interface {
    New() string
}

UUIDGenerator is responsible for creating unique query identifiers.

type UUIDGeneratorFunc Uses

type UUIDGeneratorFunc func() string

func (UUIDGeneratorFunc) New Uses

func (u UUIDGeneratorFunc) New() string

Directories

PathSynopsis
accesscontrol
fakeCode generated by counterfeiter.
lib/cid
lifecycle
lifecycle/mockCode generated by counterfeiter.
mockCode generated by counterfeiter.
persistence
persistence/mockCode generated by counterfeiter.
platforms
platforms/car
platforms/ccmetadata
platforms/golang
platforms/java
platforms/mockCode generated by counterfeiter.
platforms/node
platforms/util
shimPackage shim provides APIs for the chaincode to access its state variables, transaction context and call other chaincodes.
shim/ext/attrmgr
shim/ext/cid
shim/ext/entities
shim/ext/statebased

Package chaincode imports 32 packages (graph) and is imported by 117 packages. Updated 2019-07-17. Refresh now. Tools for package owners.