service

package
v0.6.3-kompitech1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package service is a generated protocol buffer package.

It is generated from these files:

chaincode.proto

It has these top-level messages:

ChaincodeInput
ChaincodeLocator

Index

Constants

View Source
const CtxSignerKey = `SigningIdentity`
View Source
const (
	MessageProtocolVersion = 1
)

Variables

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

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

Functions

func ContextWithDefaultSigner

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

func ContextWithSigner

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

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 {
	// 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.ClientConn) ChaincodeClient

type ChaincodeEventsServer

type ChaincodeEventsServer = chaincodeEventsServer

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 */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*ChaincodeInput) Descriptor

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

func (*ChaincodeInput) GetArgs

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

func (*ChaincodeInput) GetChaincode

func (m *ChaincodeInput) GetChaincode() string

func (*ChaincodeInput) GetChannel

func (m *ChaincodeInput) GetChannel() string

func (*ChaincodeInput) GetTransient

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

func (*ChaincodeInput) ProtoMessage

func (*ChaincodeInput) ProtoMessage()

func (*ChaincodeInput) Reset

func (m *ChaincodeInput) Reset()

func (*ChaincodeInput) String

func (m *ChaincodeInput) String() string

func (*ChaincodeInput) Validate

func (this *ChaincodeInput) Validate() error

func (*ChaincodeInput) XXX_DiscardUnknown

func (m *ChaincodeInput) XXX_DiscardUnknown()

func (*ChaincodeInput) XXX_Marshal

func (m *ChaincodeInput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ChaincodeInput) XXX_Merge

func (m *ChaincodeInput) XXX_Merge(src proto.Message)

func (*ChaincodeInput) XXX_Size

func (m *ChaincodeInput) XXX_Size() int

func (*ChaincodeInput) XXX_Unmarshal

func (m *ChaincodeInput) XXX_Unmarshal(b []byte) 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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ChaincodeLocator) Descriptor

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

func (*ChaincodeLocator) GetChaincode

func (m *ChaincodeLocator) GetChaincode() string

func (*ChaincodeLocator) GetChannel

func (m *ChaincodeLocator) GetChannel() string

func (*ChaincodeLocator) ProtoMessage

func (*ChaincodeLocator) ProtoMessage()

func (*ChaincodeLocator) Reset

func (m *ChaincodeLocator) Reset()

func (*ChaincodeLocator) String

func (m *ChaincodeLocator) String() string

func (*ChaincodeLocator) Validate

func (this *ChaincodeLocator) Validate() error

func (*ChaincodeLocator) XXX_DiscardUnknown

func (m *ChaincodeLocator) XXX_DiscardUnknown()

func (*ChaincodeLocator) XXX_Marshal

func (m *ChaincodeLocator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ChaincodeLocator) XXX_Merge

func (m *ChaincodeLocator) XXX_Merge(src proto.Message)

func (*ChaincodeLocator) XXX_Size

func (m *ChaincodeLocator) XXX_Size() int

func (*ChaincodeLocator) XXX_Unmarshal

func (m *ChaincodeLocator) XXX_Unmarshal(b []byte) error

type ChaincodeServer

type ChaincodeServer interface {
	// 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) 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 ChannelMockStubs

type ChannelMockStubs map[string]*testing.MockStub

type ChannelsMockStubs

type ChannelsMockStubs map[string]ChannelMockStubs

type MockChaincodeService

type MockChaincodeService struct {
	// channel name -> chaincode name
	ChannelCC ChannelsMockStubs
	// contains filtered or unexported fields
}

func NewMock

func NewMock() *MockChaincodeService

func (*MockChaincodeService) Chaincode

func (cs *MockChaincodeService) Chaincode(channel string, chaincode string) (*testing.MockStub, error)

func (*MockChaincodeService) Events

func (cs *MockChaincodeService) Events(in *ChaincodeLocator, stream Chaincode_EventsServer) (err error)

func (*MockChaincodeService) Invoke

func (cs *MockChaincodeService) Invoke(ctx context.Context, in *ChaincodeInput) (proposalResponse *peer.ProposalResponse, err error)

func (*MockChaincodeService) Query

func (cs *MockChaincodeService) Query(ctx context.Context, in *ChaincodeInput) (proposalResponse *peer.ProposalResponse, err error)

func (*MockChaincodeService) WithChannel

func (cs *MockChaincodeService) WithChannel(channel string, mockStubs ...*testing.MockStub) *MockChaincodeService

Jump to

Keyboard shortcuts

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