Documentation ¶
Index ¶
- func NewCachingStub(stub shim.ChaincodeStubInterface) shim.ChaincodeStubInterface
- func SeralizeObject(m StorageObject) ([]byte, error)
- func WrapObject(v interface{}) wrappingObject
- type CachingSupport
- type ChaincodeRuntime
- type Config
- type CoreInterface
- type ExtendedObject
- type StateMap
- type StateMap_Legacy
- type StorageObject
- type TransactionInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCachingStub ¶ added in v0.2.3
func NewCachingStub(stub shim.ChaincodeStubInterface) shim.ChaincodeStubInterface
NewCachingStub create an stub with local caching
func SeralizeObject ¶
func SeralizeObject(m StorageObject) ([]byte, error)
func WrapObject ¶
func WrapObject(v interface{}) wrappingObject
Types ¶
type CachingSupport ¶ added in v0.2.3
type CachingSupport interface {
CanReadUnCommit()
}
CachingSupport enable an implement indicate it has support caching, i.e. GetState can read uncommited value
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 (r *ChaincodeRuntime) Stub() shim.ChaincodeStubInterface
func (*ChaincodeRuntime) SubRuntime ¶
func (r *ChaincodeRuntime) SubRuntime(node string) *ChaincodeRuntime
type CoreInterface ¶
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
NewShimMap create default shimMap
func NewShimMapWithCache ¶ added in v0.2.3
func NewShimMapWithCache(root string, stub shim.ChaincodeStubInterface) StateMap
NewShimMapWithCache create shimMap with a wrapping stub along with write-cache which provide a more consistent data-isolation (invoked chaincode read uncommited data) on different chain-platform but tamper a little so it is not made an default option
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
NewShimMapLegacy create legacy interface