Versions in this module Expand all Collapse all v1 v1.0.2 Jan 27, 2022 v1.0.1 Dec 1, 2021 Changes in this version + const StatusError + const StatusErrorThreshold + const StatusOK + var MaxLimits = Limits + func Register(name string, f NewManagerFunc) + func ToPbLimits(limits Limits) []*protos.ResourceLimit + func ValidContractName(contractName string) error + type ChainCore interface + GetAccountAddresses func(accountName string) ([]string, error) + QueryBlock func(blockid []byte) (ledger.BlockHandle, error) + QueryTransaction func(txid []byte) (*pb.Transaction, error) + VerifyContractOwnerPermission func(contractName string, authRequire []string) error + VerifyContractPermission func(initiator string, authRequire []string, contractName, methodName string) (bool, error) + type Context interface + Invoke func(method string, args map[string][]byte) (*Response, error) + Release func() error + ResourceUsed func() Limits + type ContextConfig struct + AuthRequire []string + Caller string + CanInitialize bool + ContractCodeFromCache bool + ContractName string + ContractSet map[string]bool + Initiator string + Module string + ResourceLimits Limits + State StateSandbox + TransferAmount string + type ContractConfig struct + EVM EVMConfig + EnableDebugLog bool + EnableUpgrade bool + LogDriver logs.Logger + Native NativeConfig + Wasm WasmConfig + Xkernel XkernelConfig + func DefaultContractConfig() *ContractConfig + type ContractEventState interface + AddEvent func(events ...*protos.ContractEvent) + type CrossQueryState interface + type EVMConfig struct + Driver string + Enable bool + func (e *EVMConfig) DriverName() string + func (e *EVMConfig) IsEnable() bool + type Iterator interface + Close func() + Error func() error + Key func() []byte + Next func() bool + Value func() []byte + type KContext interface + AddResourceUsed func(delta Limits) + Args func() map[string][]byte + AuthRequire func() []string + Call func(module, contract, method string, args map[string][]byte) (*Response, error) + Caller func() string + EmitAsyncTask func(event string, args interface{}) error + Initiator func() string + ResourceLimit func() Limits + type KernMethod func(ctx KContext) (*Response, error) + type KernRegistry interface + GetKernMethod func(contract, method string) (KernMethod, error) + RegisterKernMethod func(contract, method string, handler KernMethod) + RegisterShortcut func(oldmethod, contract, method string) + UnregisterKernMethod func(ctract, method string) + type Limits struct + Cpu int64 + Disk int64 + Memory int64 + XFee int64 + func FromPbLimits(rlimits []*protos.ResourceLimit) Limits + func (l *Limits) Add(l1 Limits) *Limits + func (l *Limits) Sub(l1 Limits) *Limits + func (l *Limits) TotalGas(gasPrice *protos.GasPrice) int64 + func (l Limits) Exceed(l1 Limits) bool + type LogConfig struct + Async bool + Console bool + Filename string + Filepath string + Fmt string + Level string + Module string + RotateBackups int + RotateInterval int + type Manager interface + GetKernRegistry func() KernRegistry + NewContext func(cfg *ContextConfig) (Context, error) + NewStateSandbox func(cfg *SandboxConfig) (StateSandbox, error) + func CreateManager(name string, cfg *ManagerConfig) (Manager, error) + type ManagerConfig struct + BCName string + Basedir string + Config *ContractConfig + Core ChainCore + EnvConf *xconfig.EnvConf + XMReader ledger.XMReader + type NativeConfig struct + Docker NativeDockerConfig + Driver string + Enable bool + StopTimeout int + func (n *NativeConfig) DriverName() string + func (n *NativeConfig) IsEnable() bool + type NativeDockerConfig struct + Cpus float32 + Enable bool + ImageName string + Memory string + type NewManagerFunc func(cfg *ManagerConfig) (Manager, error) + type RWSet struct + RSet []*ledger.VersionedData + WSet []*ledger.PureData + type Response struct + Body []byte + Message string + Status int + type SandboxConfig struct + UTXOReader UtxoReader + XMReader ledger.XMReader + type State interface + type StateSandbox interface + Flush func() error + RWSet func() *RWSet + UTXORWSet func() *UTXORWSet + type UTXORWSet struct + Rset []*protos.TxInput + WSet []*protos.TxOutput + type UTXOState interface + Transfer func(from string, to string, amount *big.Int) error + type UtxoReader interface + SelectUtxo func(string, *big.Int, bool, bool) ([]*protos.TxInput, [][]byte, *big.Int, error) + type WasmConfig struct + Driver string + Enable bool + XVM XVMConfig + func (w *WasmConfig) DriverName() string + func (w *WasmConfig) IsEnable() bool + type XMState interface + Del func(bucket string, key []byte) error + Get func(bucket string, key []byte) ([]byte, error) + Put func(bucket string, key, value []byte) error + Select func(bucket string, startKey []byte, endKey []byte) (Iterator, error) + type XVMConfig struct + OptLevel int + type XkernelConfig struct + Driver string + Enable bool + Registry KernRegistry + func (x *XkernelConfig) DriverName() string + func (x *XkernelConfig) IsEnable() bool