Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextStore ¶
ContextStore keeps track of which stub belongs to which channel ID + transaction ID context
func NewContextStore ¶
func NewContextStore() *ContextStore
NewContextStore returns a new store for keeping track of transaction context stubs
func (*ContextStore) Get ¶
func (store *ContextStore) Get(context *contract.TransactionContext) (shim.ChaincodeStubInterface, error)
Get returns the specified stub from the context store
func (*ContextStore) Put ¶
func (store *ContextStore) Put(channelID string, txID string, stub shim.ChaincodeStubInterface) error
Put stores the passed stub in the context store
type FabricProxy ¶
type FabricProxy struct {
// contains filtered or unexported fields
}
FabricProxy routes calls from Wasm contract to the correct Fabric stub
func NewFabricProxy ¶
func NewFabricProxy(contextStore *ContextStore) *FabricProxy
NewFabricProxy returns a new proxy to handle calls to the Fabric contract API
func (*FabricProxy) FabricCall ¶
func (proxy *FabricProxy) FabricCall(ctx context.Context, binding, namespace, operation string, payload []byte) (result []byte, err error)
FabricCall is the waPC HostCall function for interacting with the ledger
type WasmContract ¶
type WasmContract struct {
// contains filtered or unexported fields
}
WasmContract provides the Init and Invoke functions required by Fabric and represents a smart contract in Wasm.
func NewWasmContract ¶
func NewWasmContract(contextStore *ContextStore, invoker WasmGuestInvoker) *WasmContract
NewWasmContract returns a new smart contract to invoke Wasm transactions
func (*WasmContract) Init ¶
func (wc *WasmContract) Init(APIstub shim.ChaincodeStubInterface) pb.Response
Init does nothing
func (*WasmContract) Invoke ¶
func (wc *WasmContract) Invoke(APIstub shim.ChaincodeStubInterface) pb.Response
Invoke calls a Wasm transaction
type WasmGuest ¶
type WasmGuest struct {
// contains filtered or unexported fields
}
WasmGuest encapsulates external dependencies required to invoke operations in Wasm guest code. Currently this uses a pool of waPC instances.
func NewWasmGuest ¶
func NewWasmGuest(wasmFile string, proxy *FabricProxy) (*WasmGuest, error)
NewWasmGuest returns a new WasmGuest capable of invoking Wasm operations