ucc

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: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chaincodes

func Chaincodes() []api.UserCC

Chaincodes returns all registered in-process chaincodes

func Get

func Get(name, version string) (api.UserCC, bool)

Get returns the in-process chaincode for the given name and version

func GetByPackageID added in v0.1.4

func GetByPackageID(id string) (api.UserCC, bool)

GetByPackageID returns the in-process chaincode for the given package ID

func Register

func Register(ccCreator interface{})

Register registers an in-process user chaincode creator function. The user chaincode will be initialized during peer startup with all of its declared dependencies.

func WaitForReady

func WaitForReady()

WaitForReady blocks until the chaincodes are all registered

Types

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry maintains a registry of in-process user chaincode

func (*Registry) Chaincodes

func (r *Registry) Chaincodes() []api.UserCC

Chaincodes returns all registered in-process chaincodes

func (*Registry) ChannelJoined

func (r *Registry) ChannelJoined(channelID string)

ChannelJoined is called when the peer joins a channel

func (*Registry) Get

func (r *Registry) Get(name, version string) (api.UserCC, bool)

Get returns the in-process chaincode for the given ID

func (*Registry) GetByPackageID added in v0.1.4

func (r *Registry) GetByPackageID(id string) (api.UserCC, bool)

GetByPackageID returns the in-process chaincode for the given package ID

func (*Registry) Initialize

func (r *Registry) Initialize() *Registry

Initialize is called on peer startup

func (*Registry) WaitForReady

func (r *Registry) WaitForReady()

WaitForReady blocks until the chaincodes are all registered

type Version added in v0.1.2

type Version string

Version represents the chaincode version

func (Version) Matches added in v0.1.2

func (v Version) Matches(other string) bool

Matches returns true if the major and minor versions match. For example:

'v1' and 'v1.2.0' => false 'v1' and 'v1.0.0' => true 'v1' and 'v1.0.1' => true 'v1.0' and 'v1.0.1' => true 'v1.1' and 'v1.1.4' => true 'v1.1' and 'v1.2.0' => false

func (Version) Validate added in v0.1.2

func (v Version) Validate() error

Validate validates the format of the version string

Jump to

Keyboard shortcuts

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