chaincode

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEndorseView

func NewEndorseView(chaincode, function string, args ...interface{}) *endorseChaincodeView

func NewInvokeView

func NewInvokeView(chaincode, function string, args ...interface{}) *invokeChaincodeView

func NewListenToEventsView

func NewListenToEventsView(chaincode string, callBack EventCallback) *listenToEventsView

NewListenToEventsView register a listener for the events generated by the passed chaincode and call the passed callback when an event is caught.

func NewQueryView

func NewQueryView(chaincode, function string, args ...interface{}) *queryChaincodeView

Types

type Chaincode

type Chaincode interface {
	IsPrivate() bool
	Endorse(function string, args ...interface{}) Endorse
	Query(function string, args ...interface{}) Query
}

type Endorse

type Endorse interface {
	WithInvokerIdentity(identity view.Identity) Endorse
	WithTransientEntry(k string, v interface{})
	WithEndorsersByMSPIDs(ds ...string)
	WithEndorsersFromMyOrg()
	WithTxID(txID fabric.TxID) Endorse
	Call() (*fabric.Envelope, error)
}

type EndorseCall

type EndorseCall struct {
	SignerIdentity     view.Identity
	Network            string
	Channel            string
	ChaincodePath      string
	ChaincodeName      string
	ChaincodeVersion   string
	TransientMap       map[string]interface{}
	Endorsers          []view.Identity
	EndorsersMSPIDs    []string
	EndorsersFromMyOrg bool
	Function           string
	Args               []interface{}
	TxID               fabric.TxID
}

type Event

type Event = committer.ChaincodeEvent

Event models a chaincode event

type EventCallback

type EventCallback func(event *Event) (bool, error)

EventCallback is used to parse the received events. It takes in input the generated event and return a boolean and an error. If the boolean is true, no more events are passed to this callback function. If an error occurred, no more events are passed as well.

type InvokeCall

type InvokeCall struct {
	InvokerIdentity    view.Identity
	Network            string
	Channel            string
	ChaincodePath      string
	ChaincodeName      string
	ChaincodeVersion   string
	TransientMap       map[string]interface{}
	EndorsersMSPIDs    []string
	EndorsersFromMyOrg bool
	Function           string
	Args               []interface{}
}

type Query

type Query interface {
	WithInvokerIdentity(identity view.Identity) Query
	WithTransientEntry(k string, v interface{})
	WithEndorsersByMSPIDs(ds ...string)
	WithEndorsersFromMyOrg()
	Call() ([]byte, error)
}

type RegisterChaincodeCall

type RegisterChaincodeCall struct {
	InvokerIdentity  view.Identity
	Network          string
	Channel          string
	ChaincodePath    string
	ChaincodeName    string
	ChaincodeVersion string
	CallBack         EventCallback
}

Jump to

Keyboard shortcuts

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