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 {
// Contract related configuration
MaxContractSize uint64 // Maximum contract size
WASIContractsDir string // WASI contract storage directory
CodeManagerDir string // Code manager storage directory
ContextType string // Blockchain context type
ContextParams map[string]any // Blockchain context parameters
}
Config represents engine configuration
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is responsible for contract deployment and execution
func (*Engine) DeleteContract ¶
func (*Engine) DeployContract ¶
DeployContract deploys a contract
func (*Engine) DeployContractWithAddress ¶
DeployContractWithAddress deploys a contract with specified address
func (*Engine) Execute ¶
func (e *Engine) Execute(contractAddr core.Address, function string, args []byte) (interface{}, error)
ExecuteContract executes a contract function with raw parameters, parameters are json.marshal(map[string]any)
func (*Engine) ExecuteContract ¶
func (e *Engine) ExecuteContract(contractAddr core.Address, function string, args ...interface{}) (interface{}, error)
ExecuteContract executes a contract function
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.