chaincode

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chaincode

type Chaincode struct {
	NumRetries uint
	RetrySleep time.Duration
	// contains filtered or unexported fields
}

func NewChaincode

func NewChaincode(name string, sp view.ServiceProvider, network Network, channel Channel) *Chaincode

func (*Chaincode) IsAvailable

func (c *Chaincode) IsAvailable() (bool, error)

func (*Chaincode) IsPrivate

func (c *Chaincode) IsPrivate() bool

func (*Chaincode) NewDiscover

func (c *Chaincode) NewDiscover() driver.ChaincodeDiscover

func (*Chaincode) NewInvocation

func (c *Chaincode) NewInvocation(function string, args ...interface{}) driver.ChaincodeInvocation

func (*Chaincode) Version

func (c *Chaincode) Version() (string, error)

Version returns the version of this chaincode. It uses discovery to extract this information from the endorsers

type Channel

type Channel interface {
	// Name returns the name of the channel
	Name() string

	// Config returns the channel configuration
	Config() *config.Channel

	// NewPeerClientForAddress creates an instance of a Client using the
	// provided peer connection config
	NewPeerClientForAddress(cc grpc.ConnectionConfig) (peer.Client, error)

	// IsFinal takes in input a transaction id and waits for its confirmation
	// with the respect to the passed context that can be used to set a deadline
	// for the waiting time.
	IsFinal(ctx context.Context, txID string) error

	MSPManager() driver.MSPManager

	Chaincode(name string) driver.Chaincode
}

type Discovery

type Discovery struct {
	FilterByMSPIDs      []string
	ImplicitCollections []string
	QueryForPeers       bool

	DefaultTTL time.Duration
	// contains filtered or unexported fields
}

func NewDiscovery

func NewDiscovery(chaincode *Chaincode) *Discovery

func (*Discovery) Call

func (d *Discovery) Call() ([]driver.DiscoveredPeer, error)

func (*Discovery) ChaincodeVersion

func (d *Discovery) ChaincodeVersion() (string, error)

func (*Discovery) GetEndorsers

func (d *Discovery) GetEndorsers() ([]driver.DiscoveredPeer, error)

func (*Discovery) GetPeers

func (d *Discovery) GetPeers() ([]driver.DiscoveredPeer, error)

func (*Discovery) Response

func (d *Discovery) Response() (discovery.Response, error)

func (*Discovery) WithFilterByMSPIDs

func (d *Discovery) WithFilterByMSPIDs(mspIDs ...string) driver.ChaincodeDiscover

func (*Discovery) WithForQuery

func (d *Discovery) WithForQuery() driver.ChaincodeDiscover

func (*Discovery) WithImplicitCollections

func (d *Discovery) WithImplicitCollections(mspIDs ...string) driver.ChaincodeDiscover

type Invoke

type Invoke struct {
	Chaincode                      *Chaincode
	ServiceProvider                view2.ServiceProvider
	Network                        Network
	Channel                        Channel
	TxID                           driver.TxID
	SignerIdentity                 view.Identity
	ChaincodePath                  string
	ChaincodeName                  string
	ChaincodeVersion               string
	TransientMap                   map[string][]byte
	EndorsersMSPIDs                []string
	ImplicitCollectionMSPIDs       []string
	EndorsersFromMyOrg             bool
	EndorsersByConnConfig          []*grpc.ConnectionConfig
	DiscoveredEndorsersByEndpoints []string
	Function                       string
	Args                           []interface{}
	MatchEndorsementPolicy         bool
	NumRetries                     int
	RetrySleep                     time.Duration
	Context                        context.Context
}

func NewInvoke

func NewInvoke(chaincode *Chaincode, function string, args ...interface{}) *Invoke

func (*Invoke) Endorse

func (i *Invoke) Endorse() (driver.Envelope, error)

func (*Invoke) Query

func (i *Invoke) Query() ([]byte, error)

func (*Invoke) Submit

func (i *Invoke) Submit() (string, []byte, error)

func (*Invoke) WithContext added in v0.3.0

func (i *Invoke) WithContext(context context.Context) driver.ChaincodeInvocation

func (*Invoke) WithDiscoveredEndorsersByEndpoints

func (i *Invoke) WithDiscoveredEndorsersByEndpoints(endpoints ...string) driver.ChaincodeInvocation

WithDiscoveredEndorsersByEndpoints sets the endpoints to be used to filter the result of discovery. Discovery is used to identify the chaincode's endorsers, if not set otherwise.

func (*Invoke) WithEndorsersByConnConfig

func (i *Invoke) WithEndorsersByConnConfig(ccs ...*grpc.ConnectionConfig) driver.ChaincodeInvocation

func (*Invoke) WithEndorsersByMSPIDs

func (i *Invoke) WithEndorsersByMSPIDs(mspIDs ...string) driver.ChaincodeInvocation

func (*Invoke) WithEndorsersFromMyOrg

func (i *Invoke) WithEndorsersFromMyOrg() driver.ChaincodeInvocation

func (*Invoke) WithImplicitCollections

func (i *Invoke) WithImplicitCollections(mspIDs ...string) driver.ChaincodeInvocation

func (*Invoke) WithMatchEndorsementPolicy added in v0.2.0

func (i *Invoke) WithMatchEndorsementPolicy() driver.ChaincodeInvocation

func (*Invoke) WithNumRetries added in v0.2.0

func (i *Invoke) WithNumRetries(numRetries uint) driver.ChaincodeInvocation

func (*Invoke) WithRetrySleep added in v0.2.0

func (i *Invoke) WithRetrySleep(duration time.Duration) driver.ChaincodeInvocation

func (*Invoke) WithSignerIdentity

func (i *Invoke) WithSignerIdentity(id view.Identity) driver.ChaincodeInvocation

func (*Invoke) WithTransientEntry

func (i *Invoke) WithTransientEntry(k string, v interface{}) driver.ChaincodeInvocation

func (*Invoke) WithTxID

func (i *Invoke) WithTxID(id driver.TxID) driver.ChaincodeInvocation

type Network

type Network interface {
	Name() string
	PickPeer(funcType driver.PeerFunctionType) *grpc.ConnectionConfig
	LocalMembership() driver.LocalMembership
	// Broadcast sends the passed blob to the ordering service to be ordered
	Broadcast(context context.Context, blob interface{}) error
	SignerService() driver.SignerService
	Config() *config.Config
}

type SerializableSigner

type SerializableSigner interface {
	Sign(message []byte) ([]byte, error)

	Serialize() ([]byte, error)
}

type SignerProvider

type SignerProvider interface {
	GetSigningIdentity(identity view.Identity) (*view2.SigningIdentity, error)
}

Jump to

Keyboard shortcuts

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