service

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CtxSignerKey   = contextKey(`SigningIdentity`)
	CtxDoOptionKey = contextKey(`SdkDoOption`)
)

Variables

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

Enum value maps for InvocationType.

View Source
var (
	// 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 File_service_chaincode_proto protoreflect.FileDescriptor

Functions

func ContextWithDefaultDoOption added in v0.6.12

func ContextWithDefaultDoOption(ctx context.Context, defaultDoOpts ...api.DoOption) context.Context

func ContextWithDefaultSigner

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

func ContextWithDoOption added in v0.6.12

func ContextWithDoOption(ctx context.Context, doOpts ...api.DoOption) context.Context

func ContextWithSigner

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

func DoOptionFromContext added in v0.6.12

func DoOptionFromContext(ctx context.Context) []api.DoOption

func RegisterChaincodeServer

func RegisterChaincodeServer(s *grpc.Server, srv ChaincodeServer)

func SignerFromContext

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

Types

type Chaincode

type Chaincode = ChaincodeServer

Chaincode service interface

type ChaincodeClient

type ChaincodeClient interface {
	// Exec: Query or Invoke
	Exec(ctx context.Context, in *ChaincodeExec, opts ...grpc.CallOption) (*peer.ProposalResponse, error)
	// Query chaincode on home peer. Do NOT send to orderer.
	Query(ctx context.Context, in *ChaincodeInput, opts ...grpc.CallOption) (*peer.ProposalResponse, error)
	// Invoke chaincode on peers, according to endorsement policy and the SEND to orderer
	Invoke(ctx context.Context, in *ChaincodeInput, opts ...grpc.CallOption) (*peer.ProposalResponse, error)
	// Chaincode events stream
	Events(ctx context.Context, in *ChaincodeLocator, opts ...grpc.CallOption) (Chaincode_EventsClient, error)
}

ChaincodeClient is the client API for Chaincode service.

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

func NewChaincodeClient

func NewChaincodeClient(cc grpc.ClientConnInterface) ChaincodeClient

type ChaincodeEventsServer

type ChaincodeEventsServer = chaincodeEventsServer

type ChaincodeExec added in v0.6.4

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

func (*ChaincodeExec) Descriptor deprecated added in v0.6.4

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

Deprecated: Use ChaincodeExec.ProtoReflect.Descriptor instead.

func (*ChaincodeExec) GetInput added in v0.6.4

func (x *ChaincodeExec) GetInput() *ChaincodeInput

func (*ChaincodeExec) GetType added in v0.6.4

func (x *ChaincodeExec) GetType() InvocationType

func (*ChaincodeExec) ProtoMessage added in v0.6.4

func (*ChaincodeExec) ProtoMessage()

func (*ChaincodeExec) ProtoReflect added in v0.7.0

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

func (*ChaincodeExec) Reset added in v0.6.4

func (x *ChaincodeExec) Reset()

func (*ChaincodeExec) String added in v0.6.4

func (x *ChaincodeExec) String() string

func (*ChaincodeExec) Validate added in v0.6.4

func (this *ChaincodeExec) Validate() error

type ChaincodeInput

type ChaincodeInput 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"`
	// Input contains the arguments for invocation.
	Args [][]byte `protobuf:"bytes,3,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
}

func (*ChaincodeInput) Descriptor deprecated

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

Deprecated: Use ChaincodeInput.ProtoReflect.Descriptor instead.

func (*ChaincodeInput) GetArgs

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

func (*ChaincodeInput) GetChaincode

func (x *ChaincodeInput) GetChaincode() string

func (*ChaincodeInput) GetChannel

func (x *ChaincodeInput) GetChannel() string

func (*ChaincodeInput) GetTransient

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

func (*ChaincodeInput) ProtoMessage

func (*ChaincodeInput) ProtoMessage()

func (*ChaincodeInput) ProtoReflect added in v0.7.0

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

func (*ChaincodeInput) Reset

func (x *ChaincodeInput) Reset()

func (*ChaincodeInput) String

func (x *ChaincodeInput) String() string

func (*ChaincodeInput) Validate

func (this *ChaincodeInput) Validate() error

type ChaincodeLocator

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
}

func (*ChaincodeLocator) Descriptor deprecated

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

Deprecated: Use ChaincodeLocator.ProtoReflect.Descriptor instead.

func (*ChaincodeLocator) GetChaincode

func (x *ChaincodeLocator) GetChaincode() string

func (*ChaincodeLocator) GetChannel

func (x *ChaincodeLocator) GetChannel() string

func (*ChaincodeLocator) ProtoMessage

func (*ChaincodeLocator) ProtoMessage()

func (*ChaincodeLocator) ProtoReflect added in v0.7.0

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

func (*ChaincodeLocator) Reset

func (x *ChaincodeLocator) Reset()

func (*ChaincodeLocator) String

func (x *ChaincodeLocator) String() string

func (*ChaincodeLocator) Validate

func (this *ChaincodeLocator) Validate() error

type ChaincodeServer

type ChaincodeServer interface {
	// Exec: Query or Invoke
	Exec(context.Context, *ChaincodeExec) (*peer.ProposalResponse, error)
	// Query chaincode on home peer. Do NOT send to orderer.
	Query(context.Context, *ChaincodeInput) (*peer.ProposalResponse, error)
	// Invoke chaincode on peers, according to endorsement policy and the SEND to orderer
	Invoke(context.Context, *ChaincodeInput) (*peer.ProposalResponse, error)
	// Chaincode events stream
	Events(*ChaincodeLocator, Chaincode_EventsServer) error
}

ChaincodeServer is the server API for Chaincode service.

type ChaincodeService

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

ChaincodeService implementation based of hlf-sdk-go

func New

func New(sdk api.Core) *ChaincodeService

func (*ChaincodeService) Events

func (*ChaincodeService) Exec added in v0.6.5

func (*ChaincodeService) Invoke

func (*ChaincodeService) Query

type Chaincode_EventsClient

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

type Chaincode_EventsServer

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

type InvocationType added in v0.6.4

type InvocationType int32
const (
	InvocationType_QUERY  InvocationType = 0
	InvocationType_INVOKE InvocationType = 1
)

func (InvocationType) Descriptor added in v0.7.0

func (InvocationType) Enum added in v0.7.0

func (x InvocationType) Enum() *InvocationType

func (InvocationType) EnumDescriptor deprecated added in v0.6.4

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

Deprecated: Use InvocationType.Descriptor instead.

func (InvocationType) Number added in v0.7.0

func (InvocationType) String added in v0.6.4

func (x InvocationType) String() string

func (InvocationType) Type added in v0.7.0

type UnimplementedChaincodeServer added in v0.7.0

type UnimplementedChaincodeServer struct {
}

UnimplementedChaincodeServer can be embedded to have forward compatible implementations.

func (*UnimplementedChaincodeServer) Events added in v0.7.0

func (*UnimplementedChaincodeServer) Exec added in v0.7.0

func (*UnimplementedChaincodeServer) Invoke added in v0.7.0

func (*UnimplementedChaincodeServer) Query added in v0.7.0

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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