gateway

package
v0.10.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 34 Imported by: 13

README

CCKit gateway

Documentation

Overview

Package gateway is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	CtxTransientKey = contextKey(`TransientMap`)
	CtxSignerKey    = contextKey(`SigningIdentity`)
	CtxTxWaiterKey  = contextKey(`TxWaiter`)
)
View Source
const EventListStreamTimeout = 500 * time.Millisecond

Variables

View Source
var (
	InvocationType_name = map[int32]string{
		0: "INVOCATION_TYPE_QUERY",
		1: "INVOCATION_TYPE_INVOKE",
	}
	InvocationType_value = map[string]int32{
		"INVOCATION_TYPE_QUERY":  0,
		"INVOCATION_TYPE_INVOKE": 1,
	}
)

Enum value maps for InvocationType.

View Source
var (
	ErrEventChannelClosed = errors.New(`event channel is closed`)

	// ErrChaincodeNotExists occurs when attempting to invoke a nonexostent external chaincode
	ErrChaincodeNotExists = errors.New(`chaincode not exists`)

	// ErrSignerNotDefinedInContext msp.SigningIdentity is not defined in context
	ErrSignerNotDefinedInContext = errors.New(`signer is not defined in context`)

	// ErrUnknownInvocationType query or invoke
	ErrUnknownInvocationType = errors.New(`unknown invocation type`)
)
View Source
var ErrInvokeMethodNotAllowed = errors.New(`invoke method not allowed`)
View Source
var File_chaincode_proto protoreflect.FileDescriptor

Functions

func BlockRange added in v0.9.0

func BlockRange(from, to *BlockLimit) []int64

func ContextWithDefaultSigner added in v0.9.0

func ContextWithDefaultSigner(ctx context.Context, defaultSigner msp.SigningIdentity) context.Context

func ContextWithSigner added in v0.9.0

func ContextWithSigner(ctx context.Context, signer msp.SigningIdentity) context.Context

func ContextWithTransientMap

func ContextWithTransientMap(ctx context.Context, transient map[string][]byte) context.Context

func ContextWithTransientValue

func ContextWithTransientValue(ctx context.Context, key string, value []byte) context.Context

func ContextWithTxWaiter added in v0.9.0

func ContextWithTxWaiter(ctx context.Context, txWaiterType string) context.Context

func InvokerArgs added in v0.10.1

func InvokerArgs(fn string, args []interface{}) ([][]byte, error)

func MatchEventName added in v0.10.0

func MatchEventName(eventName string, expectedNames []string) bool

func NewChaincode deprecated

func NewChaincode(service *ChaincodeService, channelName, chaincodeName string, opts ...Opt) *chaincode

Deprecated: use NewChaincodeInvoker

func RegisterChaincodeEventsServiceHandler added in v0.9.0

func RegisterChaincodeEventsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterChaincodeEventsServiceHandler registers the http handlers for service ChaincodeEventsService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterChaincodeEventsServiceHandlerClient added in v0.9.0

func RegisterChaincodeEventsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChaincodeEventsServiceClient) error

RegisterChaincodeEventsServiceHandlerClient registers the http handlers for service ChaincodeEventsService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ChaincodeEventsServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ChaincodeEventsServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ChaincodeEventsServiceClient" to call the correct interceptors.

func RegisterChaincodeEventsServiceHandlerFromEndpoint added in v0.9.0

func RegisterChaincodeEventsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterChaincodeEventsServiceHandlerFromEndpoint is same as RegisterChaincodeEventsServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterChaincodeEventsServiceHandlerServer added in v0.9.0

func RegisterChaincodeEventsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChaincodeEventsServiceServer) error

RegisterChaincodeEventsServiceHandlerServer registers the http handlers for service ChaincodeEventsService to "mux". UnaryRPC :call ChaincodeEventsServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterChaincodeEventsServiceHandlerFromEndpoint instead.

func RegisterChaincodeEventsServiceServer added in v0.9.0

func RegisterChaincodeEventsServiceServer(s *grpc.Server, srv ChaincodeEventsServiceServer)

func RegisterChaincodeInstanceEventsServiceHandler added in v0.9.0

func RegisterChaincodeInstanceEventsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterChaincodeInstanceEventsServiceHandler registers the http handlers for service ChaincodeInstanceEventsService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterChaincodeInstanceEventsServiceHandlerClient added in v0.9.0

func RegisterChaincodeInstanceEventsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChaincodeInstanceEventsServiceClient) error

RegisterChaincodeInstanceEventsServiceHandlerClient registers the http handlers for service ChaincodeInstanceEventsService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ChaincodeInstanceEventsServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ChaincodeInstanceEventsServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ChaincodeInstanceEventsServiceClient" to call the correct interceptors.

func RegisterChaincodeInstanceEventsServiceHandlerFromEndpoint added in v0.9.0

func RegisterChaincodeInstanceEventsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterChaincodeInstanceEventsServiceHandlerFromEndpoint is same as RegisterChaincodeInstanceEventsServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterChaincodeInstanceEventsServiceHandlerServer added in v0.9.0

func RegisterChaincodeInstanceEventsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChaincodeInstanceEventsServiceServer) error

RegisterChaincodeInstanceEventsServiceHandlerServer registers the http handlers for service ChaincodeInstanceEventsService to "mux". UnaryRPC :call ChaincodeInstanceEventsServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterChaincodeInstanceEventsServiceHandlerFromEndpoint instead.

func RegisterChaincodeInstanceEventsServiceServer added in v0.9.0

func RegisterChaincodeInstanceEventsServiceServer(s *grpc.Server, srv ChaincodeInstanceEventsServiceServer)

func RegisterChaincodeInstanceServiceHandler added in v0.9.0

func RegisterChaincodeInstanceServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterChaincodeInstanceServiceHandler registers the http handlers for service ChaincodeInstanceService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterChaincodeInstanceServiceHandlerClient added in v0.9.0

func RegisterChaincodeInstanceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChaincodeInstanceServiceClient) error

RegisterChaincodeInstanceServiceHandlerClient registers the http handlers for service ChaincodeInstanceService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ChaincodeInstanceServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ChaincodeInstanceServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ChaincodeInstanceServiceClient" to call the correct interceptors.

func RegisterChaincodeInstanceServiceHandlerFromEndpoint added in v0.9.0

func RegisterChaincodeInstanceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterChaincodeInstanceServiceHandlerFromEndpoint is same as RegisterChaincodeInstanceServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterChaincodeInstanceServiceHandlerServer added in v0.9.0

func RegisterChaincodeInstanceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChaincodeInstanceServiceServer) error

RegisterChaincodeInstanceServiceHandlerServer registers the http handlers for service ChaincodeInstanceService to "mux". UnaryRPC :call ChaincodeInstanceServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterChaincodeInstanceServiceHandlerFromEndpoint instead.

func RegisterChaincodeInstanceServiceServer added in v0.9.0

func RegisterChaincodeInstanceServiceServer(s *grpc.Server, srv ChaincodeInstanceServiceServer)

func RegisterChaincodeServiceHandler added in v0.9.0

func RegisterChaincodeServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterChaincodeServiceHandler registers the http handlers for service ChaincodeService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterChaincodeServiceHandlerClient added in v0.9.0

func RegisterChaincodeServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChaincodeServiceClient) error

RegisterChaincodeServiceHandlerClient registers the http handlers for service ChaincodeService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ChaincodeServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ChaincodeServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ChaincodeServiceClient" to call the correct interceptors.

func RegisterChaincodeServiceHandlerFromEndpoint added in v0.9.0

func RegisterChaincodeServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterChaincodeServiceHandlerFromEndpoint is same as RegisterChaincodeServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterChaincodeServiceHandlerServer added in v0.9.0

func RegisterChaincodeServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChaincodeServiceServer) error

RegisterChaincodeServiceHandlerServer registers the http handlers for service ChaincodeService to "mux". UnaryRPC :call ChaincodeServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterChaincodeServiceHandlerFromEndpoint instead.

func RegisterChaincodeServiceServer added in v0.9.0

func RegisterChaincodeServiceServer(s *grpc.Server, srv ChaincodeServiceServer)

func SignerFromContext added in v0.9.0

func SignerFromContext(ctx context.Context) (msp.SigningIdentity, error)

func TransientFromContext

func TransientFromContext(ctx context.Context) (map[string][]byte, error)

func TxWaiterFromContext added in v0.9.0

func TxWaiterFromContext(ctx context.Context) string

TxWaiterFromContext - fetch 'txWaiterType' param which identify transaction waiting policy what params you'll have depends on your implementation for example, in hlf-sdk: available: 'self'(wait for one peer of endorser org), 'all'(wait for each organizations from endorsement policy) default is 'self'(even if you pass empty string)

Types

type Action

type Action string
const (
	Query  Action = `query`
	Invoke Action = `invoke`
)

type BlockLimit added in v0.10.0

type BlockLimit struct {

	// Block number
	Num int64 `protobuf:"varint,1,opt,name=num,proto3" json:"num,omitempty"`
	// contains filtered or unexported fields
}

Block limit number for event stream subscription or event list Values can be negative

func (*BlockLimit) Descriptor deprecated added in v0.10.0

func (*BlockLimit) Descriptor() ([]byte, []int)

Deprecated: Use BlockLimit.ProtoReflect.Descriptor instead.

func (*BlockLimit) GetNum added in v0.10.0

func (x *BlockLimit) GetNum() int64

func (*BlockLimit) ProtoMessage added in v0.10.0

func (*BlockLimit) ProtoMessage()

func (*BlockLimit) ProtoReflect added in v0.10.0

func (x *BlockLimit) ProtoReflect() protoreflect.Message

func (*BlockLimit) Reset added in v0.10.0

func (x *BlockLimit) Reset()

func (*BlockLimit) String added in v0.10.0

func (x *BlockLimit) String() string

func (*BlockLimit) Validate added in v0.10.0

func (this *BlockLimit) Validate() error

type Chaincode deprecated

type Chaincode interface {
	Query(ctx context.Context, fn string, args []interface{}, target interface{}) (interface{}, error)
	Invoke(ctx context.Context, fn string, args []interface{}, target interface{}) (interface{}, error)
	Events(ctx context.Context, r ...*ChaincodeInstanceEventsStreamRequest) (ChaincodeEventSub, error)
}

Deprecated: use ChaincodeInvoker

type ChaincodeEvent added in v0.10.0

type ChaincodeEvent struct {
	Event       *peer.ChaincodeEvent   `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"`
	Block       uint64                 `protobuf:"varint,2,opt,name=block,proto3" json:"block,omitempty"`
	TxTimestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=tx_timestamp,json=txTimestamp,proto3" json:"tx_timestamp,omitempty"`
	Payload     *RawJson               `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

func ProcessEvent added in v0.10.1

func ProcessEvent(event interface {
	Event() *peer.ChaincodeEvent
	Block() uint64
	TxTimestamp() *timestamp.Timestamp
}, opts []EventOpt, matchName []string) (*ChaincodeEvent, error)

func (*ChaincodeEvent) Descriptor deprecated added in v0.10.0

func (*ChaincodeEvent) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeEvent.ProtoReflect.Descriptor instead.

func (*ChaincodeEvent) GetBlock added in v0.10.0

func (x *ChaincodeEvent) GetBlock() uint64

func (*ChaincodeEvent) GetEvent added in v0.10.0

func (x *ChaincodeEvent) GetEvent() *peer.ChaincodeEvent

func (*ChaincodeEvent) GetPayload added in v0.10.0

func (x *ChaincodeEvent) GetPayload() *RawJson

func (*ChaincodeEvent) GetTxTimestamp added in v0.10.0

func (x *ChaincodeEvent) GetTxTimestamp() *timestamppb.Timestamp

func (*ChaincodeEvent) ProtoMessage added in v0.10.0

func (*ChaincodeEvent) ProtoMessage()

func (*ChaincodeEvent) ProtoReflect added in v0.10.0

func (x *ChaincodeEvent) ProtoReflect() protoreflect.Message

func (*ChaincodeEvent) Reset added in v0.10.0

func (x *ChaincodeEvent) Reset()

func (*ChaincodeEvent) String added in v0.10.0

func (x *ChaincodeEvent) String() string

func (*ChaincodeEvent) Validate added in v0.10.0

func (this *ChaincodeEvent) Validate() error

type ChaincodeEventServerStream

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

ChaincodeEventServerStream implements gRPC server stream interfaces

func NewChaincodeEventServerStream

func NewChaincodeEventServerStream(ctx context.Context, opts ...EventOpt) (stream *ChaincodeEventServerStream)

func (*ChaincodeEventServerStream) Close

func (s *ChaincodeEventServerStream) Close()

func (*ChaincodeEventServerStream) Context

func (*ChaincodeEventServerStream) Events

func (s *ChaincodeEventServerStream) Events() <-chan *ChaincodeEvent

func (*ChaincodeEventServerStream) Recv

func (*ChaincodeEventServerStream) RecvMsg

func (s *ChaincodeEventServerStream) RecvMsg(m interface{}) error

func (*ChaincodeEventServerStream) SendHeader

func (*ChaincodeEventServerStream) SendMsg

func (s *ChaincodeEventServerStream) SendMsg(m interface{}) error

func (*ChaincodeEventServerStream) SetHeader

func (*ChaincodeEventServerStream) SetTrailer

func (*ChaincodeEventServerStream) SetTrailer(metadata.MD)

type ChaincodeEventService added in v0.9.0

type ChaincodeEventService struct {
	EventDelivery sdk.EventDelivery
}

func NewChaincodeEventService added in v0.9.0

func NewChaincodeEventService(eventDelivery sdk.EventDelivery) *ChaincodeEventService

func (*ChaincodeEventService) Events added in v0.9.0

func (*ChaincodeEventService) EventsChan added in v0.10.1

func (ce *ChaincodeEventService) EventsChan(
	ctx context.Context, req *ChaincodeEventsStreamRequest) (_ chan *ChaincodeEvent, closer func() error, _ error)

func (*ChaincodeEventService) EventsStream added in v0.10.0

func (*ChaincodeEventService) ServiceDef added in v0.9.0

func (ce *ChaincodeEventService) ServiceDef() ServiceDef

ServiceDef returns service definition

type ChaincodeEventSub deprecated

type ChaincodeEventSub interface {
	Context() context.Context
	Events() <-chan *ChaincodeEvent
	Recv(*ChaincodeEvent) error
	Close()
}

Deprecated: use ChaincodeInstanceEventDelivery

type ChaincodeEvents added in v0.10.0

type ChaincodeEvents struct {
	Locator   *ChaincodeLocator `protobuf:"bytes,1,opt,name=locator,proto3" json:"locator,omitempty"`
	FromBlock *BlockLimit       `protobuf:"bytes,2,opt,name=from_block,json=fromBlock,proto3" json:"from_block,omitempty"`
	ToBlock   *BlockLimit       `protobuf:"bytes,3,opt,name=to_block,json=toBlock,proto3" json:"to_block,omitempty"`
	Items     []*ChaincodeEvent `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*ChaincodeEvents) Descriptor deprecated added in v0.10.0

func (*ChaincodeEvents) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeEvents.ProtoReflect.Descriptor instead.

func (*ChaincodeEvents) GetFromBlock added in v0.10.0

func (x *ChaincodeEvents) GetFromBlock() *BlockLimit

func (*ChaincodeEvents) GetItems added in v0.10.0

func (x *ChaincodeEvents) GetItems() []*ChaincodeEvent

func (*ChaincodeEvents) GetLocator added in v0.10.1

func (x *ChaincodeEvents) GetLocator() *ChaincodeLocator

func (*ChaincodeEvents) GetToBlock added in v0.10.0

func (x *ChaincodeEvents) GetToBlock() *BlockLimit

func (*ChaincodeEvents) ProtoMessage added in v0.10.0

func (*ChaincodeEvents) ProtoMessage()

func (*ChaincodeEvents) ProtoReflect added in v0.10.0

func (x *ChaincodeEvents) ProtoReflect() protoreflect.Message

func (*ChaincodeEvents) Reset added in v0.10.0

func (x *ChaincodeEvents) Reset()

func (*ChaincodeEvents) String added in v0.10.0

func (x *ChaincodeEvents) String() string

func (*ChaincodeEvents) Validate added in v0.10.0

func (this *ChaincodeEvents) Validate() error

type ChaincodeEventsRequest added in v0.9.0

type ChaincodeEventsRequest struct {
	Locator   *ChaincodeLocator `protobuf:"bytes,1,opt,name=locator,proto3" json:"locator,omitempty"`
	FromBlock *BlockLimit       `protobuf:"bytes,2,opt,name=from_block,json=fromBlock,proto3" json:"from_block,omitempty"`
	ToBlock   *BlockLimit       `protobuf:"bytes,3,opt,name=to_block,json=toBlock,proto3" json:"to_block,omitempty"`
	EventName []string          `protobuf:"bytes,4,rep,name=event_name,json=eventName,proto3" json:"event_name,omitempty"`
	Limit     uint32            `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

Chaincode events list request

func (*ChaincodeEventsRequest) Descriptor deprecated added in v0.9.0

func (*ChaincodeEventsRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeEventsRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeEventsRequest) GetEventName added in v0.10.0

func (x *ChaincodeEventsRequest) GetEventName() []string

func (*ChaincodeEventsRequest) GetFromBlock added in v0.10.0

func (x *ChaincodeEventsRequest) GetFromBlock() *BlockLimit

func (*ChaincodeEventsRequest) GetLimit added in v0.10.0

func (x *ChaincodeEventsRequest) GetLimit() uint32

func (*ChaincodeEventsRequest) GetLocator added in v0.10.1

func (x *ChaincodeEventsRequest) GetLocator() *ChaincodeLocator

func (*ChaincodeEventsRequest) GetToBlock added in v0.10.0

func (x *ChaincodeEventsRequest) GetToBlock() *BlockLimit

func (*ChaincodeEventsRequest) ProtoMessage added in v0.9.0

func (*ChaincodeEventsRequest) ProtoMessage()

func (*ChaincodeEventsRequest) ProtoReflect added in v0.9.0

func (x *ChaincodeEventsRequest) ProtoReflect() protoreflect.Message

func (*ChaincodeEventsRequest) Reset added in v0.9.0

func (x *ChaincodeEventsRequest) Reset()

func (*ChaincodeEventsRequest) String added in v0.9.0

func (x *ChaincodeEventsRequest) String() string

func (*ChaincodeEventsRequest) Validate added in v0.9.0

func (this *ChaincodeEventsRequest) Validate() error

type ChaincodeEventsServer added in v0.9.0

type ChaincodeEventsServer = chaincodeServiceEventsStreamServer

ChaincodeEventsServer gateway/chaincode.go needs access to grpc stream

type ChaincodeEventsServiceClient added in v0.9.0

type ChaincodeEventsServiceClient interface {
	// Chaincode events stream
	EventsStream(ctx context.Context, in *ChaincodeEventsStreamRequest, opts ...grpc.CallOption) (ChaincodeEventsService_EventsStreamClient, error)
	// Chaincode events
	Events(ctx context.Context, in *ChaincodeEventsRequest, opts ...grpc.CallOption) (*ChaincodeEvents, error)
}

ChaincodeEventsServiceClient is the client API for ChaincodeEventsService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewChaincodeEventsServiceClient added in v0.9.0

func NewChaincodeEventsServiceClient(cc grpc.ClientConnInterface) ChaincodeEventsServiceClient

type ChaincodeEventsServiceServer added in v0.9.0

type ChaincodeEventsServiceServer interface {
	// Chaincode events stream
	EventsStream(*ChaincodeEventsStreamRequest, ChaincodeEventsService_EventsStreamServer) error
	// Chaincode events
	Events(context.Context, *ChaincodeEventsRequest) (*ChaincodeEvents, error)
}

ChaincodeEventsServiceServer is the server API for ChaincodeEventsService service.

type ChaincodeEventsService_EventsStreamClient added in v0.10.0

type ChaincodeEventsService_EventsStreamClient interface {
	Recv() (*ChaincodeEvent, error)
	grpc.ClientStream
}

type ChaincodeEventsService_EventsStreamServer added in v0.10.0

type ChaincodeEventsService_EventsStreamServer interface {
	Send(*ChaincodeEvent) error
	grpc.ServerStream
}

type ChaincodeEventsStreamRequest added in v0.10.0

type ChaincodeEventsStreamRequest struct {
	Locator   *ChaincodeLocator `protobuf:"bytes,1,opt,name=locator,proto3" json:"locator,omitempty"`
	FromBlock *BlockLimit       `protobuf:"bytes,2,opt,name=from_block,json=fromBlock,proto3" json:"from_block,omitempty"`
	ToBlock   *BlockLimit       `protobuf:"bytes,3,opt,name=to_block,json=toBlock,proto3" json:"to_block,omitempty"`
	EventName []string          `protobuf:"bytes,4,rep,name=event_name,json=eventName,proto3" json:"event_name,omitempty"`
	// contains filtered or unexported fields
}

Chaincode events stream request

func (*ChaincodeEventsStreamRequest) Descriptor deprecated added in v0.10.0

func (*ChaincodeEventsStreamRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeEventsStreamRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeEventsStreamRequest) GetEventName added in v0.10.0

func (x *ChaincodeEventsStreamRequest) GetEventName() []string

func (*ChaincodeEventsStreamRequest) GetFromBlock added in v0.10.0

func (x *ChaincodeEventsStreamRequest) GetFromBlock() *BlockLimit

func (*ChaincodeEventsStreamRequest) GetLocator added in v0.10.1

func (*ChaincodeEventsStreamRequest) GetToBlock added in v0.10.0

func (x *ChaincodeEventsStreamRequest) GetToBlock() *BlockLimit

func (*ChaincodeEventsStreamRequest) ProtoMessage added in v0.10.0

func (*ChaincodeEventsStreamRequest) ProtoMessage()

func (*ChaincodeEventsStreamRequest) ProtoReflect added in v0.10.0

func (*ChaincodeEventsStreamRequest) Reset added in v0.10.0

func (x *ChaincodeEventsStreamRequest) Reset()

func (*ChaincodeEventsStreamRequest) String added in v0.10.0

func (*ChaincodeEventsStreamRequest) Validate added in v0.10.0

func (this *ChaincodeEventsStreamRequest) Validate() error

type ChaincodeExecRequest added in v0.10.1

type ChaincodeExecRequest struct {
	Locator *ChaincodeLocator `protobuf:"bytes,1,opt,name=locator,proto3" json:"locator,omitempty"`
	Type    InvocationType    `protobuf:"varint,2,opt,name=type,proto3,enum=cckit.gateway.InvocationType" json:"type,omitempty"`
	Input   *ChaincodeInput   `protobuf:"bytes,3,opt,name=input,proto3" json:"input,omitempty"`
	// contains filtered or unexported fields
}

Chaincode execution specification

func (*ChaincodeExecRequest) Descriptor deprecated added in v0.10.1

func (*ChaincodeExecRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeExecRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeExecRequest) GetInput added in v0.10.1

func (x *ChaincodeExecRequest) GetInput() *ChaincodeInput

func (*ChaincodeExecRequest) GetLocator added in v0.10.1

func (x *ChaincodeExecRequest) GetLocator() *ChaincodeLocator

func (*ChaincodeExecRequest) GetType added in v0.10.1

func (x *ChaincodeExecRequest) GetType() InvocationType

func (*ChaincodeExecRequest) ProtoMessage added in v0.10.1

func (*ChaincodeExecRequest) ProtoMessage()

func (*ChaincodeExecRequest) ProtoReflect added in v0.10.1

func (x *ChaincodeExecRequest) ProtoReflect() protoreflect.Message

func (*ChaincodeExecRequest) Reset added in v0.10.1

func (x *ChaincodeExecRequest) Reset()

func (*ChaincodeExecRequest) String added in v0.10.1

func (x *ChaincodeExecRequest) String() string

func (*ChaincodeExecRequest) Validate added in v0.10.1

func (this *ChaincodeExecRequest) Validate() error

type ChaincodeInput added in v0.9.0

type ChaincodeInput struct {

	// Input contains the arguments for invocation.
	Args [][]byte `protobuf:"bytes,1,rep,name=args,proto3" json:"args,omitempty"`
	// TransientMap contains data (e.g. cryptographic material) that might be used
	// to implement some form of application-level confidentiality. The contents
	// of this field are supposed to always be omitted from the transaction and
	// excluded from the ledger.
	Transient map[string][]byte `` /* 159-byte string literal not displayed */
	// contains filtered or unexported fields
}

Chaincode invocation input

func (*ChaincodeInput) Descriptor deprecated added in v0.9.0

func (*ChaincodeInput) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeInput.ProtoReflect.Descriptor instead.

func (*ChaincodeInput) GetArgs added in v0.9.0

func (x *ChaincodeInput) GetArgs() [][]byte

func (*ChaincodeInput) GetTransient added in v0.9.0

func (x *ChaincodeInput) GetTransient() map[string][]byte

func (*ChaincodeInput) ProtoMessage added in v0.9.0

func (*ChaincodeInput) ProtoMessage()

func (*ChaincodeInput) ProtoReflect added in v0.9.0

func (x *ChaincodeInput) ProtoReflect() protoreflect.Message

func (*ChaincodeInput) Reset added in v0.9.0

func (x *ChaincodeInput) Reset()

func (*ChaincodeInput) String added in v0.9.0

func (x *ChaincodeInput) String() string

func (*ChaincodeInput) Validate added in v0.9.0

func (this *ChaincodeInput) Validate() error

type ChaincodeInstance added in v0.10.1

type ChaincodeInstance interface {
	ChaincodeInstanceServiceServer

	EventsChan(ctx context.Context, rr ...*ChaincodeInstanceEventsStreamRequest) (
		_ chan *ChaincodeEvent, closer func() error, _ error)
}

ChaincodeInstance base implementation ChaincodeInstanceService - via SDK but also possible another implementation (via REST, another SDK etc)

type ChaincodeInstanceEventService added in v0.9.0

type ChaincodeInstanceEventService struct {
	EventDelivery sdk.EventDelivery
	Locator       *ChaincodeLocator
	Opts          *Opts
	Logger        *zap.Logger
}

func NewChaincodeInstanceEventService added in v0.9.0

func NewChaincodeInstanceEventService(delivery sdk.EventDelivery, channel, chaincode string, opts ...Opt) *ChaincodeInstanceEventService

func (*ChaincodeInstanceEventService) Events added in v0.9.0

func (*ChaincodeInstanceEventService) EventsChan added in v0.10.1

func (ces *ChaincodeInstanceEventService) EventsChan(ctx context.Context, rr ...*ChaincodeInstanceEventsStreamRequest) (_ chan *ChaincodeEvent, closer func() error, _ error)

EventsChan is not part of ChaincodeInstanceEventService interface, for calls as component

func (*ChaincodeInstanceEventService) EventsStream added in v0.10.0

func (*ChaincodeInstanceEventService) ServiceDef added in v0.9.0

func (ces *ChaincodeInstanceEventService) ServiceDef() ServiceDef

type ChaincodeInstanceEvents added in v0.10.1

type ChaincodeInstanceEvents interface {
	ChaincodeInstanceEventsServiceServer

	EventsChan(ctx context.Context, rr ...*ChaincodeInstanceEventsStreamRequest) (
		_ chan *ChaincodeEvent, closer func() error, _ error)
}

type ChaincodeInstanceEventsRequest added in v0.9.0

type ChaincodeInstanceEventsRequest struct {
	FromBlock *BlockLimit `protobuf:"bytes,1,opt,name=from_block,json=fromBlock,proto3" json:"from_block,omitempty"`
	ToBlock   *BlockLimit `protobuf:"bytes,2,opt,name=to_block,json=toBlock,proto3" json:"to_block,omitempty"`
	EventName []string    `protobuf:"bytes,3,rep,name=event_name,json=eventName,proto3" json:"event_name,omitempty"`
	Limit     uint32      `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

func (*ChaincodeInstanceEventsRequest) Descriptor deprecated added in v0.9.0

func (*ChaincodeInstanceEventsRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeInstanceEventsRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeInstanceEventsRequest) GetEventName added in v0.10.0

func (x *ChaincodeInstanceEventsRequest) GetEventName() []string

func (*ChaincodeInstanceEventsRequest) GetFromBlock added in v0.10.0

func (x *ChaincodeInstanceEventsRequest) GetFromBlock() *BlockLimit

func (*ChaincodeInstanceEventsRequest) GetLimit added in v0.10.0

func (x *ChaincodeInstanceEventsRequest) GetLimit() uint32

func (*ChaincodeInstanceEventsRequest) GetToBlock added in v0.10.0

func (x *ChaincodeInstanceEventsRequest) GetToBlock() *BlockLimit

func (*ChaincodeInstanceEventsRequest) ProtoMessage added in v0.9.0

func (*ChaincodeInstanceEventsRequest) ProtoMessage()

func (*ChaincodeInstanceEventsRequest) ProtoReflect added in v0.9.0

func (*ChaincodeInstanceEventsRequest) Reset added in v0.9.0

func (x *ChaincodeInstanceEventsRequest) Reset()

func (*ChaincodeInstanceEventsRequest) String added in v0.9.0

func (*ChaincodeInstanceEventsRequest) Validate added in v0.9.0

func (this *ChaincodeInstanceEventsRequest) Validate() error

type ChaincodeInstanceEventsServiceClient added in v0.9.0

type ChaincodeInstanceEventsServiceClient interface {
	// Chaincode events stream
	EventsStream(ctx context.Context, in *ChaincodeInstanceEventsStreamRequest, opts ...grpc.CallOption) (ChaincodeInstanceEventsService_EventsStreamClient, error)
	// Chaincode events s
	Events(ctx context.Context, in *ChaincodeInstanceEventsRequest, opts ...grpc.CallOption) (*ChaincodeEvents, error)
}

ChaincodeInstanceEventsServiceClient is the client API for ChaincodeInstanceEventsService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewChaincodeInstanceEventsServiceClient added in v0.9.0

func NewChaincodeInstanceEventsServiceClient(cc grpc.ClientConnInterface) ChaincodeInstanceEventsServiceClient

type ChaincodeInstanceEventsServiceServer added in v0.9.0

type ChaincodeInstanceEventsServiceServer interface {
	// Chaincode events stream
	EventsStream(*ChaincodeInstanceEventsStreamRequest, ChaincodeInstanceEventsService_EventsStreamServer) error
	// Chaincode events s
	Events(context.Context, *ChaincodeInstanceEventsRequest) (*ChaincodeEvents, error)
}

ChaincodeInstanceEventsServiceServer is the server API for ChaincodeInstanceEventsService service.

type ChaincodeInstanceEventsService_EventsStreamClient added in v0.10.0

type ChaincodeInstanceEventsService_EventsStreamClient interface {
	Recv() (*ChaincodeEvent, error)
	grpc.ClientStream
}

type ChaincodeInstanceEventsService_EventsStreamServer added in v0.10.0

type ChaincodeInstanceEventsService_EventsStreamServer interface {
	Send(*ChaincodeEvent) error
	grpc.ServerStream
}

type ChaincodeInstanceEventsStreamRequest added in v0.10.0

type ChaincodeInstanceEventsStreamRequest struct {
	FromBlock *BlockLimit `protobuf:"bytes,1,opt,name=from_block,json=fromBlock,proto3" json:"from_block,omitempty"`
	ToBlock   *BlockLimit `protobuf:"bytes,2,opt,name=to_block,json=toBlock,proto3" json:"to_block,omitempty"`
	EventName []string    `protobuf:"bytes,3,rep,name=event_name,json=eventName,proto3" json:"event_name,omitempty"`
	// contains filtered or unexported fields
}

func (*ChaincodeInstanceEventsStreamRequest) Descriptor deprecated added in v0.10.0

func (*ChaincodeInstanceEventsStreamRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeInstanceEventsStreamRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeInstanceEventsStreamRequest) GetEventName added in v0.10.0

func (x *ChaincodeInstanceEventsStreamRequest) GetEventName() []string

func (*ChaincodeInstanceEventsStreamRequest) GetFromBlock added in v0.10.0

func (*ChaincodeInstanceEventsStreamRequest) GetToBlock added in v0.10.0

func (*ChaincodeInstanceEventsStreamRequest) ProtoMessage added in v0.10.0

func (*ChaincodeInstanceEventsStreamRequest) ProtoMessage()

func (*ChaincodeInstanceEventsStreamRequest) ProtoReflect added in v0.10.0

func (*ChaincodeInstanceEventsStreamRequest) Reset added in v0.10.0

func (*ChaincodeInstanceEventsStreamRequest) String added in v0.10.0

func (*ChaincodeInstanceEventsStreamRequest) Validate added in v0.10.0

type ChaincodeInstanceExecRequest added in v0.10.1

type ChaincodeInstanceExecRequest struct {
	Type  InvocationType  `protobuf:"varint,1,opt,name=type,proto3,enum=cckit.gateway.InvocationType" json:"type,omitempty"`
	Input *ChaincodeInput `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"`
	// contains filtered or unexported fields
}

func (*ChaincodeInstanceExecRequest) Descriptor deprecated added in v0.10.1

func (*ChaincodeInstanceExecRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeInstanceExecRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeInstanceExecRequest) GetInput added in v0.10.1

func (*ChaincodeInstanceExecRequest) GetType added in v0.10.1

func (*ChaincodeInstanceExecRequest) ProtoMessage added in v0.10.1

func (*ChaincodeInstanceExecRequest) ProtoMessage()

func (*ChaincodeInstanceExecRequest) ProtoReflect added in v0.10.1

func (*ChaincodeInstanceExecRequest) Reset added in v0.10.1

func (x *ChaincodeInstanceExecRequest) Reset()

func (*ChaincodeInstanceExecRequest) String added in v0.10.1

func (*ChaincodeInstanceExecRequest) Validate added in v0.10.1

func (this *ChaincodeInstanceExecRequest) Validate() error

type ChaincodeInstanceInvokeRequest added in v0.10.1

type ChaincodeInstanceInvokeRequest struct {
	Input *ChaincodeInput `protobuf:"bytes,1,opt,name=input,proto3" json:"input,omitempty"`
	// contains filtered or unexported fields
}

func (*ChaincodeInstanceInvokeRequest) Descriptor deprecated added in v0.10.1

func (*ChaincodeInstanceInvokeRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeInstanceInvokeRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeInstanceInvokeRequest) GetInput added in v0.10.1

func (*ChaincodeInstanceInvokeRequest) ProtoMessage added in v0.10.1

func (*ChaincodeInstanceInvokeRequest) ProtoMessage()

func (*ChaincodeInstanceInvokeRequest) ProtoReflect added in v0.10.1

func (*ChaincodeInstanceInvokeRequest) Reset added in v0.10.1

func (x *ChaincodeInstanceInvokeRequest) Reset()

func (*ChaincodeInstanceInvokeRequest) String added in v0.10.1

func (*ChaincodeInstanceInvokeRequest) Validate added in v0.10.1

func (this *ChaincodeInstanceInvokeRequest) Validate() error

type ChaincodeInstanceInvoker added in v0.10.1

type ChaincodeInstanceInvoker interface {
	Query(ctx context.Context, fn string, args []interface{}, target interface{}) (interface{}, error)
	Invoke(ctx context.Context, fn string, args []interface{}, target interface{}) (interface{}, error)
}

ChaincodeInvoker used in generated service gateway code

type ChaincodeInstanceQueryRequest added in v0.10.1

type ChaincodeInstanceQueryRequest struct {
	Input *ChaincodeInput `protobuf:"bytes,1,opt,name=input,proto3" json:"input,omitempty"`
	// contains filtered or unexported fields
}

func (*ChaincodeInstanceQueryRequest) Descriptor deprecated added in v0.10.1

func (*ChaincodeInstanceQueryRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeInstanceQueryRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeInstanceQueryRequest) GetInput added in v0.10.1

func (*ChaincodeInstanceQueryRequest) ProtoMessage added in v0.10.1

func (*ChaincodeInstanceQueryRequest) ProtoMessage()

func (*ChaincodeInstanceQueryRequest) ProtoReflect added in v0.10.1

func (*ChaincodeInstanceQueryRequest) Reset added in v0.10.1

func (x *ChaincodeInstanceQueryRequest) Reset()

func (*ChaincodeInstanceQueryRequest) String added in v0.10.1

func (*ChaincodeInstanceQueryRequest) Validate added in v0.10.1

func (this *ChaincodeInstanceQueryRequest) Validate() error

type ChaincodeInstanceService added in v0.9.0

type ChaincodeInstanceService struct {
	SDK     sdk.SDK
	Locator *ChaincodeLocator
	Opts    *Opts
}

func NewChaincodeInstanceService added in v0.9.0

func NewChaincodeInstanceService(sdk sdk.SDK, locator *ChaincodeLocator, opts ...Opt) *ChaincodeInstanceService

func (*ChaincodeInstanceService) EventService added in v0.9.0

func (*ChaincodeInstanceService) Events added in v0.9.0

func (*ChaincodeInstanceService) EventsChan added in v0.10.1

func (cis *ChaincodeInstanceService) EventsChan(
	ctx context.Context, rr ...*ChaincodeInstanceEventsStreamRequest) (_ chan *ChaincodeEvent, closer func() error, _ error)

func (*ChaincodeInstanceService) EventsStream added in v0.10.0

func (*ChaincodeInstanceService) Exec added in v0.9.0

func (*ChaincodeInstanceService) Invoke added in v0.9.0

func (*ChaincodeInstanceService) Query added in v0.9.0

func (*ChaincodeInstanceService) ServiceDef added in v0.9.0

func (cis *ChaincodeInstanceService) ServiceDef() ServiceDef

type ChaincodeInstanceServiceClient added in v0.9.0

type ChaincodeInstanceServiceClient interface {
	// Exec: Query or Invoke
	Exec(ctx context.Context, in *ChaincodeInstanceExecRequest, opts ...grpc.CallOption) (*peer.Response, error)
	// Query chaincode on home peer. Do NOT send to orderer.
	Query(ctx context.Context, in *ChaincodeInstanceQueryRequest, opts ...grpc.CallOption) (*peer.Response, error)
	// Invoke chaincode on peers, according to endorsement policy and the SEND to orderer
	Invoke(ctx context.Context, in *ChaincodeInstanceInvokeRequest, opts ...grpc.CallOption) (*peer.Response, error)
	// Chaincode events stream
	EventsStream(ctx context.Context, in *ChaincodeInstanceEventsStreamRequest, opts ...grpc.CallOption) (ChaincodeInstanceService_EventsStreamClient, error)
	// Chaincode events
	Events(ctx context.Context, in *ChaincodeInstanceEventsRequest, opts ...grpc.CallOption) (*ChaincodeEvents, error)
}

ChaincodeInstanceServiceClient is the client API for ChaincodeInstanceService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewChaincodeInstanceServiceClient added in v0.9.0

func NewChaincodeInstanceServiceClient(cc grpc.ClientConnInterface) ChaincodeInstanceServiceClient

type ChaincodeInstanceServiceInvoker added in v0.10.1

type ChaincodeInstanceServiceInvoker struct {
	ChaincodeInstance ChaincodeInstanceServiceServer
}

ChaincodeInvoker used in generated service gateway code

func NewChaincodeInstanceServiceInvoker added in v0.10.1

func NewChaincodeInstanceServiceInvoker(ccInstance ChaincodeInstanceServiceServer) *ChaincodeInstanceServiceInvoker

func (*ChaincodeInstanceServiceInvoker) Invoke added in v0.10.1

func (c *ChaincodeInstanceServiceInvoker) Invoke(
	ctx context.Context, fn string, args []interface{}, target interface{}) (interface{}, error)

func (*ChaincodeInstanceServiceInvoker) Query added in v0.10.1

func (c *ChaincodeInstanceServiceInvoker) Query(
	ctx context.Context, fn string, args []interface{}, target interface{}) (interface{}, error)

type ChaincodeInstanceServiceServer added in v0.9.0

type ChaincodeInstanceServiceServer interface {
	// Exec: Query or Invoke
	Exec(context.Context, *ChaincodeInstanceExecRequest) (*peer.Response, error)
	// Query chaincode on home peer. Do NOT send to orderer.
	Query(context.Context, *ChaincodeInstanceQueryRequest) (*peer.Response, error)
	// Invoke chaincode on peers, according to endorsement policy and the SEND to orderer
	Invoke(context.Context, *ChaincodeInstanceInvokeRequest) (*peer.Response, error)
	// Chaincode events stream
	EventsStream(*ChaincodeInstanceEventsStreamRequest, ChaincodeInstanceService_EventsStreamServer) error
	// Chaincode events
	Events(context.Context, *ChaincodeInstanceEventsRequest) (*ChaincodeEvents, error)
}

ChaincodeInstanceServiceServer is the server API for ChaincodeInstanceService service.

type ChaincodeInstanceService_EventsStreamClient added in v0.10.0

type ChaincodeInstanceService_EventsStreamClient interface {
	Recv() (*ChaincodeEvent, error)
	grpc.ClientStream
}

type ChaincodeInstanceService_EventsStreamServer added in v0.10.0

type ChaincodeInstanceService_EventsStreamServer interface {
	Send(*ChaincodeEvent) error
	grpc.ServerStream
}

type ChaincodeInvokeRequest added in v0.10.1

type ChaincodeInvokeRequest struct {
	Locator *ChaincodeLocator `protobuf:"bytes,1,opt,name=locator,proto3" json:"locator,omitempty"`
	Input   *ChaincodeInput   `protobuf:"bytes,3,opt,name=input,proto3" json:"input,omitempty"`
	// contains filtered or unexported fields
}

func (*ChaincodeInvokeRequest) Descriptor deprecated added in v0.10.1

func (*ChaincodeInvokeRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeInvokeRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeInvokeRequest) GetInput added in v0.10.1

func (x *ChaincodeInvokeRequest) GetInput() *ChaincodeInput

func (*ChaincodeInvokeRequest) GetLocator added in v0.10.1

func (x *ChaincodeInvokeRequest) GetLocator() *ChaincodeLocator

func (*ChaincodeInvokeRequest) ProtoMessage added in v0.10.1

func (*ChaincodeInvokeRequest) ProtoMessage()

func (*ChaincodeInvokeRequest) ProtoReflect added in v0.10.1

func (x *ChaincodeInvokeRequest) ProtoReflect() protoreflect.Message

func (*ChaincodeInvokeRequest) Reset added in v0.10.1

func (x *ChaincodeInvokeRequest) Reset()

func (*ChaincodeInvokeRequest) String added in v0.10.1

func (x *ChaincodeInvokeRequest) String() string

func (*ChaincodeInvokeRequest) Validate added in v0.10.1

func (this *ChaincodeInvokeRequest) Validate() error

type ChaincodeLocator added in v0.9.0

type ChaincodeLocator struct {

	// Chaincode name
	Chaincode string `protobuf:"bytes,1,opt,name=chaincode,proto3" json:"chaincode,omitempty"`
	// Channel name
	Channel string `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty"`
	// contains filtered or unexported fields
}

Chaincode locator - channel name and chaincode name

func (*ChaincodeLocator) Descriptor deprecated added in v0.9.0

func (*ChaincodeLocator) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeLocator.ProtoReflect.Descriptor instead.

func (*ChaincodeLocator) GetChaincode added in v0.9.0

func (x *ChaincodeLocator) GetChaincode() string

func (*ChaincodeLocator) GetChannel added in v0.9.0

func (x *ChaincodeLocator) GetChannel() string

func (*ChaincodeLocator) ProtoMessage added in v0.9.0

func (*ChaincodeLocator) ProtoMessage()

func (*ChaincodeLocator) ProtoReflect added in v0.9.0

func (x *ChaincodeLocator) ProtoReflect() protoreflect.Message

func (*ChaincodeLocator) Reset added in v0.9.0

func (x *ChaincodeLocator) Reset()

func (*ChaincodeLocator) String added in v0.9.0

func (x *ChaincodeLocator) String() string

func (*ChaincodeLocator) Validate added in v0.9.0

func (this *ChaincodeLocator) Validate() error

type ChaincodeLocatorResolver added in v0.10.1

type ChaincodeLocatorResolver func(ctx router.Context, serviceName string) (*ChaincodeLocator, error)

type ChaincodeQueryRequest added in v0.10.1

type ChaincodeQueryRequest struct {
	Locator *ChaincodeLocator `protobuf:"bytes,1,opt,name=locator,proto3" json:"locator,omitempty"`
	Input   *ChaincodeInput   `protobuf:"bytes,3,opt,name=input,proto3" json:"input,omitempty"`
	// contains filtered or unexported fields
}

func (*ChaincodeQueryRequest) Descriptor deprecated added in v0.10.1

func (*ChaincodeQueryRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeQueryRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeQueryRequest) GetInput added in v0.10.1

func (x *ChaincodeQueryRequest) GetInput() *ChaincodeInput

func (*ChaincodeQueryRequest) GetLocator added in v0.10.1

func (x *ChaincodeQueryRequest) GetLocator() *ChaincodeLocator

func (*ChaincodeQueryRequest) ProtoMessage added in v0.10.1

func (*ChaincodeQueryRequest) ProtoMessage()

func (*ChaincodeQueryRequest) ProtoReflect added in v0.10.1

func (x *ChaincodeQueryRequest) ProtoReflect() protoreflect.Message

func (*ChaincodeQueryRequest) Reset added in v0.10.1

func (x *ChaincodeQueryRequest) Reset()

func (*ChaincodeQueryRequest) String added in v0.10.1

func (x *ChaincodeQueryRequest) String() string

func (*ChaincodeQueryRequest) Validate added in v0.10.1

func (this *ChaincodeQueryRequest) Validate() error

type ChaincodeService added in v0.9.0

type ChaincodeService struct {
	SDK          sdk.SDK
	EventService *ChaincodeEventService
}

func New deprecated added in v0.9.0

func New(sdk sdk.SDK) *ChaincodeService

Deprecated: use NewChaincodeService instead

func NewChaincodeService added in v0.9.0

func NewChaincodeService(sdk sdk.SDK) *ChaincodeService

func (*ChaincodeService) Events added in v0.9.0

func (*ChaincodeService) EventsChan added in v0.10.1

func (cs *ChaincodeService) EventsChan(
	ctx context.Context, req *ChaincodeEventsStreamRequest) (_ chan *ChaincodeEvent, closer func() error, _ error)

func (*ChaincodeService) EventsStream added in v0.10.0

func (*ChaincodeService) Exec added in v0.9.0

func (*ChaincodeService) InstanceService added in v0.9.0

func (cs *ChaincodeService) InstanceService(locator *ChaincodeLocator, opts ...Opt) *ChaincodeInstanceService

InstanceService returns ChaincodeInstanceService for current Peer interface and provided channel and chaincode name

func (*ChaincodeService) Invoke added in v0.9.0

func (*ChaincodeService) Query added in v0.9.0

func (*ChaincodeService) ServiceDef added in v0.9.0

func (cs *ChaincodeService) ServiceDef() ServiceDef

ServiceDef returns service definition

type ChaincodeServiceClient added in v0.9.0

type ChaincodeServiceClient interface {
	// Exec: Query or Invoke
	Exec(ctx context.Context, in *ChaincodeExecRequest, opts ...grpc.CallOption) (*peer.Response, error)
	// Query chaincode on home peer. Do NOT send to orderer.
	Query(ctx context.Context, in *ChaincodeQueryRequest, opts ...grpc.CallOption) (*peer.Response, error)
	// Invoke chaincode on peers, according to endorsement policy and the SEND to orderer
	Invoke(ctx context.Context, in *ChaincodeInvokeRequest, opts ...grpc.CallOption) (*peer.Response, error)
	// Chaincode events stream
	EventsStream(ctx context.Context, in *ChaincodeEventsStreamRequest, opts ...grpc.CallOption) (ChaincodeService_EventsStreamClient, error)
	// Chaincode events
	Events(ctx context.Context, in *ChaincodeEventsRequest, opts ...grpc.CallOption) (*ChaincodeEvents, error)
}

ChaincodeServiceClient is the client API for ChaincodeService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewChaincodeServiceClient added in v0.9.0

func NewChaincodeServiceClient(cc grpc.ClientConnInterface) ChaincodeServiceClient

type ChaincodeServiceServer added in v0.9.0

type ChaincodeServiceServer interface {
	// Exec: Query or Invoke
	Exec(context.Context, *ChaincodeExecRequest) (*peer.Response, error)
	// Query chaincode on home peer. Do NOT send to orderer.
	Query(context.Context, *ChaincodeQueryRequest) (*peer.Response, error)
	// Invoke chaincode on peers, according to endorsement policy and the SEND to orderer
	Invoke(context.Context, *ChaincodeInvokeRequest) (*peer.Response, error)
	// Chaincode events stream
	EventsStream(*ChaincodeEventsStreamRequest, ChaincodeService_EventsStreamServer) error
	// Chaincode events
	Events(context.Context, *ChaincodeEventsRequest) (*ChaincodeEvents, error)
}

ChaincodeServiceServer is the server API for ChaincodeService service.

type ChaincodeService_EventsStreamClient added in v0.10.0

type ChaincodeService_EventsStreamClient interface {
	Recv() (*ChaincodeEvent, error)
	grpc.ClientStream
}

type ChaincodeService_EventsStreamServer added in v0.10.0

type ChaincodeService_EventsStreamServer interface {
	Send(*ChaincodeEvent) error
	grpc.ServerStream
}

type ChaincodeStubInvoker added in v0.10.1

type ChaincodeStubInvoker interface {
	Query(stub shim.ChaincodeStubInterface, fn string, args []interface{}, target interface{}) (interface{}, error)
}

ChaincodeStubInvoker for cross chaincode calls - only query (read) methods context argument is router.Context, not context.Context

type ContextOpt

type ContextOpt func(ctx context.Context) context.Context

type EventOpt

type EventOpt func(event *ChaincodeEvent) error

type InputOpt

type InputOpt func(input *ChaincodeInput) error

type InstanceOpts added in v0.10.1

type InstanceOpts struct {
	Locator *ChaincodeLocator
	Opts    Opts
}

type InvocationType added in v0.9.0

type InvocationType int32

Chaincode invocation type

const (
	// Simulation
	InvocationType_INVOCATION_TYPE_QUERY InvocationType = 0
	// Simulation and applying to ledger
	InvocationType_INVOCATION_TYPE_INVOKE InvocationType = 1
)

func (InvocationType) Descriptor added in v0.9.0

func (InvocationType) Enum added in v0.9.0

func (x InvocationType) Enum() *InvocationType

func (InvocationType) EnumDescriptor deprecated added in v0.9.0

func (InvocationType) EnumDescriptor() ([]byte, []int)

Deprecated: Use InvocationType.Descriptor instead.

func (InvocationType) Number added in v0.9.0

func (InvocationType) String added in v0.9.0

func (x InvocationType) String() string

func (InvocationType) Type added in v0.9.0

type LocatorChaincodeStubInvoker added in v0.10.1

type LocatorChaincodeStubInvoker struct {
	Locator *ChaincodeLocator
}

func (*LocatorChaincodeStubInvoker) Query added in v0.10.1

func (c *LocatorChaincodeStubInvoker) Query(
	stub shim.ChaincodeStubInterface, fn string, args []interface{}, target interface{}) (interface{}, error)

type Opt

type Opt func(*Opts)

func WithArgsEncryption

func WithArgsEncryption(encKey []byte) Opt

func WithDefaultSigner

func WithDefaultSigner(defaultSigner msp.SigningIdentity) Opt

func WithDefaultTransientMapValue added in v0.10.1

func WithDefaultTransientMapValue(key string, value []byte) Opt

func WithEncryption

func WithEncryption(encKey []byte) Opt

func WithEventDecryption

func WithEventDecryption(encKey []byte) Opt

func WithEventResolver added in v0.10.0

func WithEventResolver(resolver mapping.EventResolver) Opt

func WithInvokePayloadDecryption

func WithInvokePayloadDecryption(encKey []byte) Opt

type Opts added in v0.10.0

type Opts struct {
	Context []ContextOpt
	Input   []InputOpt
	Output  []OutputOpt
	Event   []EventOpt
}

type OutputOpt

type OutputOpt func(action InvocationType, response *peer.Response) error

type RawJson added in v0.10.0

type RawJson struct {
	Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*RawJson) Descriptor deprecated added in v0.10.0

func (*RawJson) Descriptor() ([]byte, []int)

Deprecated: Use RawJson.ProtoReflect.Descriptor instead.

func (*RawJson) GetValue added in v0.10.0

func (x *RawJson) GetValue() []byte

func (*RawJson) MarshalJSON added in v0.10.0

func (x *RawJson) MarshalJSON() ([]byte, error)

func (*RawJson) MarshalJSONPB added in v0.10.0

func (x *RawJson) MarshalJSONPB(_ *jsonpb.Marshaler) ([]byte, error)

func (*RawJson) ProtoMessage added in v0.10.0

func (*RawJson) ProtoMessage()

func (*RawJson) ProtoReflect added in v0.10.0

func (x *RawJson) ProtoReflect() protoreflect.Message

func (*RawJson) Reset added in v0.10.0

func (x *RawJson) Reset()

func (*RawJson) String added in v0.10.0

func (x *RawJson) String() string

func (*RawJson) Validate added in v0.10.0

func (this *RawJson) Validate() error

type RegisterHandlerFromEndpoint

type RegisterHandlerFromEndpoint func(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

type Service added in v0.10.1

type Service interface {
	Name() string
	Swagger() []byte
	GRPCDesc() *grpc.ServiceDesc
	Impl() interface{}
	GRPCGatewayRegister() func(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
}

type ServiceDef

type ServiceDef struct {
	Desc                        *grpc.ServiceDesc
	Service                     interface{}
	HandlerFromEndpointRegister RegisterHandlerFromEndpoint
	// contains filtered or unexported fields
}

func NewServiceDef added in v0.10.1

func NewServiceDef(name string, swagger []byte, desc *grpc.ServiceDesc, service interface{}, registerHandler RegisterHandlerFromEndpoint) ServiceDef

func (ServiceDef) GRPCDesc added in v0.10.1

func (s ServiceDef) GRPCDesc() *grpc.ServiceDesc

func (ServiceDef) GRPCGatewayRegister added in v0.10.1

func (s ServiceDef) GRPCGatewayRegister() func(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

func (ServiceDef) Impl added in v0.10.1

func (s ServiceDef) Impl() interface{}

func (ServiceDef) Name added in v0.10.1

func (s ServiceDef) Name() string

func (ServiceDef) Swagger added in v0.10.1

func (s ServiceDef) Swagger() []byte

type UnimplementedChaincodeEventsServiceServer added in v0.9.0

type UnimplementedChaincodeEventsServiceServer struct {
}

UnimplementedChaincodeEventsServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedChaincodeEventsServiceServer) Events added in v0.9.0

func (*UnimplementedChaincodeEventsServiceServer) EventsStream added in v0.10.0

type UnimplementedChaincodeInstanceEventsServiceServer added in v0.9.0

type UnimplementedChaincodeInstanceEventsServiceServer struct {
}

UnimplementedChaincodeInstanceEventsServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedChaincodeInstanceEventsServiceServer) Events added in v0.9.0

func (*UnimplementedChaincodeInstanceEventsServiceServer) EventsStream added in v0.10.0

type UnimplementedChaincodeInstanceServiceServer added in v0.9.0

type UnimplementedChaincodeInstanceServiceServer struct {
}

UnimplementedChaincodeInstanceServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedChaincodeInstanceServiceServer) Events added in v0.9.0

func (*UnimplementedChaincodeInstanceServiceServer) EventsStream added in v0.10.0

func (*UnimplementedChaincodeInstanceServiceServer) Exec added in v0.9.0

func (*UnimplementedChaincodeInstanceServiceServer) Invoke added in v0.9.0

func (*UnimplementedChaincodeInstanceServiceServer) Query added in v0.9.0

type UnimplementedChaincodeServiceServer added in v0.9.0

type UnimplementedChaincodeServiceServer struct {
}

UnimplementedChaincodeServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedChaincodeServiceServer) Events added in v0.9.0

func (*UnimplementedChaincodeServiceServer) EventsStream added in v0.10.0

func (*UnimplementedChaincodeServiceServer) Exec added in v0.9.0

func (*UnimplementedChaincodeServiceServer) Invoke added in v0.9.0

func (*UnimplementedChaincodeServiceServer) Query added in v0.9.0

Directories

Path Synopsis
Deprecated: use github.com/s7techlab/cckit/gateway package
Deprecated: use github.com/s7techlab/cckit/gateway package

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL