runtime

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SeralizeObject

func SeralizeObject(m StorageObject) ([]byte, error)

func WrapObject

func WrapObject(v interface{}) wrappingObject

Types

type ChaincodeRuntime

type ChaincodeRuntime struct {
	Storage StateMap
	Tx      TransactionInterface
	Core    CoreInterface
}

func NewRuntime

func NewRuntime(root string, stub shim.ChaincodeStubInterface, cfg *Config) *ChaincodeRuntime

func (*ChaincodeRuntime) Stub

func (*ChaincodeRuntime) SubRuntime

func (r *ChaincodeRuntime) SubRuntime(node string) *ChaincodeRuntime

type Config

type Config struct {
	ReadOnly bool
}

func NewConfig

func NewConfig() *Config

func (*Config) SetReadOnly

func (c *Config) SetReadOnly(flag bool)

type CoreInterface

type CoreInterface interface {
	SetEvent(name string, payload []byte) error
	GetRawStub() interface{}
}

type ExtendedObject

type ExtendedObject struct {
	Ext interface{}
}

allowing one or more "extended object" can be persisted When load return this error, the rest bytes is unmarshalled with the object in Ext field, and Load will be called again NOTICE: if there is no any rest bytes, Load is just called with the provided Ext field (without any change), and any failure in Unmarshalling just caused the whole Get process return failure NOTICE: Load return more ExtendedObject when there is no more bytes left will cause Get returun ExtendedObject as an error

func (ExtendedObject) Error

func (ExtendedObject) Error() string

type StateMap

type StateMap interface {
	SubMap(string) StateMap
	StoragePath() string
	GetRaw(string) ([]byte, error)
	SetRaw(string, []byte) error
	Get(string, StorageObject) error
	Set(string, StorageObject) error
	Delete(string) error
}

func NewShimMap

func NewShimMap(root string, stub shim.ChaincodeStubInterface, readOnly bool) StateMap

default

type StateMap_Legacy

type StateMap_Legacy interface {
	SubMap(string) StateMap_Legacy
	StoragePath() string
	GetRaw(string) ([]byte, error)
	SetRaw(string, []byte) error
	Get(string, p.Message) error
	Set(string, p.Message) error
}

func NewShimMapLegacy

func NewShimMapLegacy(root string, stub shim.ChaincodeStubInterface, readOnly bool) StateMap_Legacy

default

type StorageObject

type StorageObject interface {
	GetObject() interface{}
	Save() interface{}
	Load(interface{}) error
}

type TransactionInterface

type TransactionInterface interface {
	GetArgs() [][]byte
	GetStringArgs() []string
	GetTxID() string
	GetTxTime() (time.Time, error)
}

simply reorganize the interface in chaincodestub...

Jump to

Keyboard shortcuts

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