contracts

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: GPL-3.0, GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

* @author PalletOne core developers <dev@pallet.one> * @date 2018

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contract

type Contract struct {
	core.IAdapterJury
	// contains filtered or unexported fields
}

func Initialize

func Initialize(idag dboperation.IContractDag, jury core.IAdapterJury, cfg *contractcfg.Config) (*Contract, error)

Initialize 初始化合约管理模块以及加载系统合约, 由上层应用指定dag以及初始合约配置信息 Initialize the contract management module and load the system contract, Specify dag and initial contract configuration information by the upper application

func (*Contract) Close

func (c *Contract) Close() error

func (*Contract) Deploy

func (c *Contract) Deploy(rwM rwset.TxManager, chainID string, templateId []byte, txId string, args [][]byte, timeout time.Duration) (deployId []byte, deployPayload *md.ContractDeployPayload, e error)

Deploy 将指定的合约模板部署到本地,生成对应Docker镜像及启动带有初始化合约参数的容器,用于合约的执行。 txid由上层应用指定,合约部署超时时间根据具体服务器配置指定,默认40秒。接口返回合约部署ID(每次部署其返回ID不同)以及部署单元 Deploy the specified contract template locally, generate the corresponding Docker image and launch a container with initialization contract parameters for contract execution. The txid is specified by the upper application. The contract deployment timeout is specified according to the configuration of server.The default is 40 seconds. The interface returns the contract deployment ID (there is a different return ID for each deployment) and the deployment unit

func (*Contract) Install

func (c *Contract) Install(channelId, ccName, ccPath, ccVersion, ccDescription, ccAbi, ccLanguage string) (payload *md.ContractTplPayload, err error)

Install 合约安装,将指定的合约路径文件打包,并与合约名称、版本一起构成合约模板单元 chainID 链码ID,用于多链 Contract installation, packaging the specified contract path file, and forming a contract template unit together with the contract name and version Chain code ID for multiple chains

func (*Contract) Invoke

func (c *Contract) Invoke(ctx *ContractProcessContext, chainID string, deployId []byte, txid string, args [][]byte, timeout time.Duration) (*md.ContractInvokeResult, error)

Invoke 合约invoke调用,根据指定合约调用参数执行已经部署的合约,函数返回合约调用单元。 The contract invoke call, execute the deployed contract according to the specified contract call parameters, and the function returns the contract call unit.

func (*Contract) Stop

func (c *Contract) Stop(rwM rwset.TxManager, chainID string, deployId []byte, txid string, deleteImage bool) (*md.ContractStopPayload, error)

Stop 停止指定合约。根据需求可以对镜像文件进行删除操作 Stop the specified contract. The image file can be deleted according to requirements.

type ContractInf

type ContractInf interface {
	Close() error
	Install(chainID string, ccName string, ccPath string, ccVersion string, ccDescription, ccAbi, ccLanguage string) (payload *md.ContractTplPayload, err error)
	Deploy(rwM rwset.TxManager, chainID string, templateId []byte, txId string, args [][]byte, timeout time.Duration) (deployId []byte, deployPayload *md.ContractDeployPayload, e error)
	Invoke(ctx *ContractProcessContext, chainID string, deployId []byte, txid string, args [][]byte, timeout time.Duration) (*md.ContractInvokeResult, error)
	Stop(rwM rwset.TxManager, chainID string, deployId []byte, txid string, deleteImage bool) (*md.ContractStopPayload, error)
}

type ContractProcessContext added in v1.0.6

type ContractProcessContext struct {
	RequestId common.Hash
	Dag       dboperation.IContractDag
	//TxPool       txspool.ITxPool
	Ele          *md.ElectionNode
	RwM          rwset.TxManager
	Contract     *Contract
	ErrMsgEnable bool
}

Directories

Path Synopsis
example
go/createToken/account
* @author PalletOne core developer <dev@pallet.one> * @date 2018
* @author PalletOne core developer <dev@pallet.one> * @date 2018
* @author PalletOne core developers <dev@pallet.one> * @date 2018
* @author PalletOne core developers <dev@pallet.one> * @date 2018
Package shim provides APIs for the chaincode to access its state variables, transaction context and call other chaincodes.
Package shim provides APIs for the chaincode to access its state variables, transaction context and call other chaincodes.
deposit/v1
Package deposit implements some functions for deposit contract.
Package deposit implements some functions for deposit contract.
deposit/v2
Package v2 implements some functions for v2 contract.
Package v2 implements some functions for v2 contract.
installcc
PCGTta3M4t3yXu8uRgkKvaWd2d8DSHHyWEW
PCGTta3M4t3yXu8uRgkKvaWd2d8DSHHyWEW

Jump to

Keyboard shortcuts

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