Documentation
      ¶
    
    
  
    
  
    Index ¶
- type Config
 - type Engine
 - func (e *Engine) Close() error
 - func (e *Engine) DeleteContract(contractAddr core.Address)
 - func (e *Engine) DeployContract(code []byte) (core.Address, error)
 - func (e *Engine) DeployContractWithAddress(code []byte, contractAddr core.Address) error
 - func (e *Engine) Execute(contractAddr core.Address, function string, args []byte) (interface{}, error)
 - func (e *Engine) ExecuteContract(contractAddr core.Address, function string, args ...interface{}) (interface{}, error)
 - func (e *Engine) GetContext() types.BlockchainContext
 - func (e *Engine) WithContext(ctx types.BlockchainContext) *Engine
 
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
	// 合约相关配置
	MaxContractSize  uint64         // 最大合约大小
	WASIContractsDir string         // WASI合约存储目录
	CodeManagerDir   string         // 代码管理器存储目录
	ContextType      string         // 区块链上下文类型
	ContextParams    map[string]any // 区块链上下文参数
}
    Config 引擎配置
type Engine ¶
type Engine struct {
	// contains filtered or unexported fields
}
    Engine 合约引擎,负责合约的部署和执行
func (*Engine) DeleteContract ¶
func (*Engine) DeployContract ¶
DeployContract 部署合约
func (*Engine) DeployContractWithAddress ¶
DeployContract 部署合约
func (*Engine) Execute ¶
func (e *Engine) Execute(contractAddr core.Address, function string, args []byte) (interface{}, error)
ExecuteContract 执行合约函数带原始参数,参数是json.marshal(map[string]any)
func (*Engine) ExecuteContract ¶
func (e *Engine) ExecuteContract(contractAddr core.Address, function string, args ...interface{}) (interface{}, error)
ExecuteContract 执行合约函数
func (*Engine) GetContext ¶ added in v0.1.2
func (e *Engine) GetContext() types.BlockchainContext
func (*Engine) WithContext ¶
func (e *Engine) WithContext(ctx types.BlockchainContext) *Engine
 Click to show internal directories. 
   Click to hide internal directories.