hellocc

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	HelloDataType = "Hello!"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppDataHandlerRegistry

type AppDataHandlerRegistry interface {
	Register(dataType string, handler appdata.Handler) error
}

AppDataHandlerRegistry is used to register a Gossip handler for application-specific data

type GossipProvider

type GossipProvider interface {
	GetGossipService() gossipapi.GossipService
}

GossipProvider provides a Gossip service

type HelloCC

type HelloCC struct {
	GossipProvider
	StateDBProvider
	// contains filtered or unexported fields
}

HelloCC is a sample chaincode that broadcasts a Hello message to other peers on a channel and the other peers respond with a hello

func New

func New(name string, handlerRegistry AppDataHandlerRegistry, gossipProvider GossipProvider, stateDBProvider StateDBProvider) *HelloCC

New returns a new Hello chaincode instance

func (*HelloCC) Chaincode

func (cc *HelloCC) Chaincode() shim.Chaincode

Chaincode returns the chaincode

func (*HelloCC) GetDBArtifacts

func (cc *HelloCC) GetDBArtifacts(collNames []string) map[string]*ccapi.DBArtifacts

GetDBArtifacts returns Couch DB indexes (if applicable)

func (*HelloCC) Init

Init is not used

func (*HelloCC) Invoke

func (cc *HelloCC) Invoke(stub shim.ChaincodeStubInterface) pb.Response

Invoke invokes the chaincode with a given function

func (*HelloCC) Name

func (cc *HelloCC) Name() string

Name returns the name of this chaincode

func (*HelloCC) Version

func (cc *HelloCC) Version() string

Version returns the version of the chaincode

type StateDBProvider

type StateDBProvider interface {
	StateDBForChannel(channelID string) statedb.StateDB
}

StateDBProvider returns a state database for a given channel

Jump to

Keyboard shortcuts

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