lscc

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Overview

Package lscc is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_systemcc_lscc_lscc_proto protoreflect.FileDescriptor
View Source
var Swagger []byte

Functions

func RegisterLSCCServiceHandler

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

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

func RegisterLSCCServiceHandlerClient

func RegisterLSCCServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LSCCServiceClient) error

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

func RegisterLSCCServiceHandlerFromEndpoint

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

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

func RegisterLSCCServiceHandlerServer

func RegisterLSCCServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LSCCServiceServer) error

RegisterLSCCServiceHandlerServer registers the http handlers for service LSCCService to "mux". UnaryRPC :call LSCCServiceServer 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 RegisterLSCCServiceHandlerFromEndpoint instead.

func RegisterLSCCServiceServer

func RegisterLSCCServiceServer(s *grpc.Server, srv LSCCServiceServer)

Types

type DeployRequest

type DeployRequest struct {
	Channel          string                          `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"`
	DeploymentSpec   *peer.ChaincodeDeploymentSpec   `protobuf:"bytes,2,opt,name=deployment_spec,json=deploymentSpec,proto3" json:"deployment_spec,omitempty"`
	Policy           *common.SignaturePolicyEnvelope `protobuf:"bytes,3,opt,name=policy,proto3" json:"policy,omitempty"`
	ESCC             string                          `protobuf:"bytes,4,opt,name=ESCC,proto3" json:"ESCC,omitempty"`
	VSCC             string                          `protobuf:"bytes,5,opt,name=VSCC,proto3" json:"VSCC,omitempty"`
	CollectionConfig *common.CollectionConfigPackage `protobuf:"bytes,6,opt,name=collection_config,json=collectionConfig,proto3" json:"collection_config,omitempty"`
	Transient        map[string][]byte               `` /* 159-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*DeployRequest) Descriptor deprecated

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

Deprecated: Use DeployRequest.ProtoReflect.Descriptor instead.

func (*DeployRequest) GetChannel

func (x *DeployRequest) GetChannel() string

func (*DeployRequest) GetCollectionConfig

func (x *DeployRequest) GetCollectionConfig() *common.CollectionConfigPackage

func (*DeployRequest) GetDeploymentSpec

func (x *DeployRequest) GetDeploymentSpec() *peer.ChaincodeDeploymentSpec

func (*DeployRequest) GetESCC

func (x *DeployRequest) GetESCC() string

func (*DeployRequest) GetPolicy

func (*DeployRequest) GetTransient

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

func (*DeployRequest) GetVSCC

func (x *DeployRequest) GetVSCC() string

func (*DeployRequest) ProtoMessage

func (*DeployRequest) ProtoMessage()

func (*DeployRequest) ProtoReflect

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

func (*DeployRequest) Reset

func (x *DeployRequest) Reset()

func (*DeployRequest) String

func (x *DeployRequest) String() string

func (*DeployRequest) Validate

func (m *DeployRequest) Validate() error

Validate checks the field values on DeployRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*DeployRequest) ValidateAll

func (m *DeployRequest) ValidateAll() error

ValidateAll checks the field values on DeployRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in DeployRequestMultiError, or nil if none found.

type DeployRequestMultiError

type DeployRequestMultiError []error

DeployRequestMultiError is an error wrapping multiple validation errors returned by DeployRequest.ValidateAll() if the designated constraints aren't met.

func (DeployRequestMultiError) AllErrors

func (m DeployRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DeployRequestMultiError) Error

func (m DeployRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type DeployRequestValidationError

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

DeployRequestValidationError is the validation error returned by DeployRequest.Validate if the designated constraints aren't met.

func (DeployRequestValidationError) Cause

Cause function returns cause value.

func (DeployRequestValidationError) Error

Error satisfies the builtin error interface

func (DeployRequestValidationError) ErrorName

func (e DeployRequestValidationError) ErrorName() string

ErrorName returns error name.

func (DeployRequestValidationError) Field

Field function returns field value.

func (DeployRequestValidationError) Key

Key function returns key value.

func (DeployRequestValidationError) Reason

Reason function returns reason value.

type GetChaincodeDataRequest

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

func (*GetChaincodeDataRequest) Descriptor deprecated

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

Deprecated: Use GetChaincodeDataRequest.ProtoReflect.Descriptor instead.

func (*GetChaincodeDataRequest) GetChaincode

func (x *GetChaincodeDataRequest) GetChaincode() string

func (*GetChaincodeDataRequest) GetChannel

func (x *GetChaincodeDataRequest) GetChannel() string

func (*GetChaincodeDataRequest) ProtoMessage

func (*GetChaincodeDataRequest) ProtoMessage()

func (*GetChaincodeDataRequest) ProtoReflect

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

func (*GetChaincodeDataRequest) Reset

func (x *GetChaincodeDataRequest) Reset()

func (*GetChaincodeDataRequest) String

func (x *GetChaincodeDataRequest) String() string

func (*GetChaincodeDataRequest) Validate

func (m *GetChaincodeDataRequest) Validate() error

Validate checks the field values on GetChaincodeDataRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetChaincodeDataRequest) ValidateAll

func (m *GetChaincodeDataRequest) ValidateAll() error

ValidateAll checks the field values on GetChaincodeDataRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetChaincodeDataRequestMultiError, or nil if none found.

type GetChaincodeDataRequestMultiError

type GetChaincodeDataRequestMultiError []error

GetChaincodeDataRequestMultiError is an error wrapping multiple validation errors returned by GetChaincodeDataRequest.ValidateAll() if the designated constraints aren't met.

func (GetChaincodeDataRequestMultiError) AllErrors

func (m GetChaincodeDataRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetChaincodeDataRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type GetChaincodeDataRequestValidationError

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

GetChaincodeDataRequestValidationError is the validation error returned by GetChaincodeDataRequest.Validate if the designated constraints aren't met.

func (GetChaincodeDataRequestValidationError) Cause

Cause function returns cause value.

func (GetChaincodeDataRequestValidationError) Error

Error satisfies the builtin error interface

func (GetChaincodeDataRequestValidationError) ErrorName

ErrorName returns error name.

func (GetChaincodeDataRequestValidationError) Field

Field function returns field value.

func (GetChaincodeDataRequestValidationError) Key

Key function returns key value.

func (GetChaincodeDataRequestValidationError) Reason

Reason function returns reason value.

type GetChaincodesRequest

type GetChaincodesRequest struct {
	Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"`
	// contains filtered or unexported fields
}

func (*GetChaincodesRequest) Descriptor deprecated

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

Deprecated: Use GetChaincodesRequest.ProtoReflect.Descriptor instead.

func (*GetChaincodesRequest) GetChannel

func (x *GetChaincodesRequest) GetChannel() string

func (*GetChaincodesRequest) ProtoMessage

func (*GetChaincodesRequest) ProtoMessage()

func (*GetChaincodesRequest) ProtoReflect

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

func (*GetChaincodesRequest) Reset

func (x *GetChaincodesRequest) Reset()

func (*GetChaincodesRequest) String

func (x *GetChaincodesRequest) String() string

func (*GetChaincodesRequest) Validate

func (m *GetChaincodesRequest) Validate() error

Validate checks the field values on GetChaincodesRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetChaincodesRequest) ValidateAll

func (m *GetChaincodesRequest) ValidateAll() error

ValidateAll checks the field values on GetChaincodesRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetChaincodesRequestMultiError, or nil if none found.

type GetChaincodesRequestMultiError

type GetChaincodesRequestMultiError []error

GetChaincodesRequestMultiError is an error wrapping multiple validation errors returned by GetChaincodesRequest.ValidateAll() if the designated constraints aren't met.

func (GetChaincodesRequestMultiError) AllErrors

func (m GetChaincodesRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetChaincodesRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type GetChaincodesRequestValidationError

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

GetChaincodesRequestValidationError is the validation error returned by GetChaincodesRequest.Validate if the designated constraints aren't met.

func (GetChaincodesRequestValidationError) Cause

Cause function returns cause value.

func (GetChaincodesRequestValidationError) Error

Error satisfies the builtin error interface

func (GetChaincodesRequestValidationError) ErrorName

ErrorName returns error name.

func (GetChaincodesRequestValidationError) Field

Field function returns field value.

func (GetChaincodesRequestValidationError) Key

Key function returns key value.

func (GetChaincodesRequestValidationError) Reason

Reason function returns reason value.

type GetDeploymentSpecRequest

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

func (*GetDeploymentSpecRequest) Descriptor deprecated

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

Deprecated: Use GetDeploymentSpecRequest.ProtoReflect.Descriptor instead.

func (*GetDeploymentSpecRequest) GetChaincode

func (x *GetDeploymentSpecRequest) GetChaincode() string

func (*GetDeploymentSpecRequest) GetChannel

func (x *GetDeploymentSpecRequest) GetChannel() string

func (*GetDeploymentSpecRequest) ProtoMessage

func (*GetDeploymentSpecRequest) ProtoMessage()

func (*GetDeploymentSpecRequest) ProtoReflect

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

func (*GetDeploymentSpecRequest) Reset

func (x *GetDeploymentSpecRequest) Reset()

func (*GetDeploymentSpecRequest) String

func (x *GetDeploymentSpecRequest) String() string

func (*GetDeploymentSpecRequest) Validate

func (m *GetDeploymentSpecRequest) Validate() error

Validate checks the field values on GetDeploymentSpecRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetDeploymentSpecRequest) ValidateAll

func (m *GetDeploymentSpecRequest) ValidateAll() error

ValidateAll checks the field values on GetDeploymentSpecRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetDeploymentSpecRequestMultiError, or nil if none found.

type GetDeploymentSpecRequestMultiError

type GetDeploymentSpecRequestMultiError []error

GetDeploymentSpecRequestMultiError is an error wrapping multiple validation errors returned by GetDeploymentSpecRequest.ValidateAll() if the designated constraints aren't met.

func (GetDeploymentSpecRequestMultiError) AllErrors

func (m GetDeploymentSpecRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetDeploymentSpecRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type GetDeploymentSpecRequestValidationError

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

GetDeploymentSpecRequestValidationError is the validation error returned by GetDeploymentSpecRequest.Validate if the designated constraints aren't met.

func (GetDeploymentSpecRequestValidationError) Cause

Cause function returns cause value.

func (GetDeploymentSpecRequestValidationError) Error

Error satisfies the builtin error interface

func (GetDeploymentSpecRequestValidationError) ErrorName

ErrorName returns error name.

func (GetDeploymentSpecRequestValidationError) Field

Field function returns field value.

func (GetDeploymentSpecRequestValidationError) Key

Key function returns key value.

func (GetDeploymentSpecRequestValidationError) Reason

Reason function returns reason value.

type LSCCService

type LSCCService struct {
	UnimplementedLSCCServiceServer

	Invoker api.Invoker
}

func NewLSCC

func NewLSCC(invoker api.Invoker) *LSCCService

func (*LSCCService) Deploy

func (l *LSCCService) Deploy(ctx context.Context, deploy *DeployRequest) (response *peer.Response, err error)

func (*LSCCService) GetChaincodeData

func (l *LSCCService) GetChaincodeData(ctx context.Context, getChaincodeData *GetChaincodeDataRequest) (*peer.ChaincodeData, error)

func (*LSCCService) GetChaincodes

func (l *LSCCService) GetChaincodes(ctx context.Context, getChaincodes *GetChaincodesRequest) (*peer.ChaincodeQueryResponse, error)

func (*LSCCService) GetDeploymentSpec

func (l *LSCCService) GetDeploymentSpec(ctx context.Context, getDeploymentSpec *GetDeploymentSpecRequest) (*peer.ChaincodeDeploymentSpec, error)

func (*LSCCService) GetInstalledChaincodes

func (l *LSCCService) GetInstalledChaincodes(ctx context.Context, _ *empty.Empty) (*peer.ChaincodeQueryResponse, error)

func (*LSCCService) Install

func (*LSCCService) ServiceDef

func (l *LSCCService) ServiceDef() *service.Def

type LSCCServiceClient

type LSCCServiceClient interface {
	// GetChaincodeData returns information about instantiated chaincode on target channel
	GetChaincodeData(ctx context.Context, in *GetChaincodeDataRequest, opts ...grpc.CallOption) (*peer.ChaincodeData, error)
	// GetInstalledChaincodes returns list of installed chaincodes on peer
	GetInstalledChaincodes(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*peer.ChaincodeQueryResponse, error)
	// GetChaincodes returns list of instantiated chaincodes on channel
	GetChaincodes(ctx context.Context, in *GetChaincodesRequest, opts ...grpc.CallOption) (*peer.ChaincodeQueryResponse, error)
	// GetDeploymentSpec returns spec for installed chaincode
	GetDeploymentSpec(ctx context.Context, in *GetDeploymentSpecRequest, opts ...grpc.CallOption) (*peer.ChaincodeDeploymentSpec, error)
	// Install allows installing chaincode using deployment specification
	Install(ctx context.Context, in *peer.ChaincodeDeploymentSpec, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Deploy allows instantiating or upgrade chaincode if instantiated
	// Currently, deploy method is not canonical as lscc implementation, but currently we need to get full proposal, and it's response to broadcast to orderer
	Deploy(ctx context.Context, in *DeployRequest, opts ...grpc.CallOption) (*peer.Response, error)
}

LSCCServiceClient is the client API for LSCCService service.

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

type LSCCServiceServer

type LSCCServiceServer interface {
	// GetChaincodeData returns information about instantiated chaincode on target channel
	GetChaincodeData(context.Context, *GetChaincodeDataRequest) (*peer.ChaincodeData, error)
	// GetInstalledChaincodes returns list of installed chaincodes on peer
	GetInstalledChaincodes(context.Context, *emptypb.Empty) (*peer.ChaincodeQueryResponse, error)
	// GetChaincodes returns list of instantiated chaincodes on channel
	GetChaincodes(context.Context, *GetChaincodesRequest) (*peer.ChaincodeQueryResponse, error)
	// GetDeploymentSpec returns spec for installed chaincode
	GetDeploymentSpec(context.Context, *GetDeploymentSpecRequest) (*peer.ChaincodeDeploymentSpec, error)
	// Install allows installing chaincode using deployment specification
	Install(context.Context, *peer.ChaincodeDeploymentSpec) (*emptypb.Empty, error)
	// Deploy allows instantiating or upgrade chaincode if instantiated
	// Currently, deploy method is not canonical as lscc implementation, but currently we need to get full proposal, and it's response to broadcast to orderer
	Deploy(context.Context, *DeployRequest) (*peer.Response, error)
}

LSCCServiceServer is the server API for LSCCService service.

type UnimplementedLSCCServiceServer

type UnimplementedLSCCServiceServer struct {
}

UnimplementedLSCCServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedLSCCServiceServer) Deploy

func (*UnimplementedLSCCServiceServer) GetChaincodeData

func (*UnimplementedLSCCServiceServer) GetChaincodes

func (*UnimplementedLSCCServiceServer) GetDeploymentSpec

func (*UnimplementedLSCCServiceServer) GetInstalledChaincodes

func (*UnimplementedLSCCServiceServer) Install

Jump to

Keyboard shortcuts

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