service

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2019 License: MIT Imports: 15 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

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
	Query(ctx context.Context, in *ChaincodeInput, opts ...grpc.CallOption) (*protos.ProposalResponse, error)
	Invoke(ctx context.Context, in *ChaincodeInput, opts ...grpc.CallOption) (*protos.ProposalResponse, error)
	Events(ctx context.Context, in *ChaincodeLocator, opts ...grpc.CallOption) (Chaincode_EventsClient, error)
}

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" json:"chaincode,omitempty"`
	// Channel name
	Channel string `protobuf:"bytes,2,opt,name=channel" 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 `` /* 145-byte string literal not displayed */
}

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

type ChaincodeLocator

type ChaincodeLocator struct {
	// Chaincode name
	Chaincode string `protobuf:"bytes,1,opt,name=chaincode" json:"chaincode,omitempty"`
	// Channel name
	Channel string `protobuf:"bytes,2,opt,name=channel" json:"channel,omitempty"`
}

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

type ChaincodeServer

type ChaincodeServer interface {
	// Query chaincode on home peer
	Query(context.Context, *ChaincodeInput) (*protos.ProposalResponse, error)
	Invoke(context.Context, *ChaincodeInput) (*protos.ProposalResponse, error)
	Events(*ChaincodeLocator, Chaincode_EventsServer) error
}

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() (*protos1.ChaincodeEvent, error)
	grpc.ClientStream
}

type Chaincode_EventsServer

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

type ChannelMockStubs added in v0.6.0

type ChannelMockStubs map[string]*testing.MockStub

type ChannelsMockStubs added in v0.6.0

type ChannelsMockStubs map[string]ChannelMockStubs

type MockChaincodeService added in v0.6.0

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

func NewMock added in v0.6.0

func NewMock() *MockChaincodeService

func (*MockChaincodeService) Chaincode added in v0.6.0

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

func (*MockChaincodeService) Events added in v0.6.0

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

func (*MockChaincodeService) Invoke added in v0.6.0

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

func (*MockChaincodeService) Query added in v0.6.0

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

func (*MockChaincodeService) WithChannel added in v0.6.0

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