executor

package
Version: v0.0.0-...-7ecb7cd Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JliSuccess = int(0)
	JliFail    = int(-1)
	TxExecJob  = C.int(0)
	TxQueryJob = C.int(1)
	Bool_true  = C.int(1)
	Bool_false = C.int(0)
)

Variables

View Source
var (
	Chain33LoaderJarPath = "." //路径信息不需要包含字符‘/’,C语言中拼接时,会添加

)

Functions

func BindTxQueryJVMEnvHandle

func BindTxQueryJVMEnvHandle(jvmGoHandle, envHandle *C.char) C.int

export BindTxQueryJVMEnvHandle

func ExecActive

func ExecActive(from *C.char, amount C.long, envHandle *C.char) C.int

export ExecActive

func ExecFrozen

func ExecFrozen(from *C.char, amount C.long, envHandle *C.char) C.int
* Account

export ExecFrozen

func ExecTransfer

func ExecTransfer(from, to *C.char, amount C.long, envHandle *C.char) C.int

export ExecTransfer

func ForwardQueryResult

func ForwardQueryResult(exceptionOccurred bool, info []string, jvmgo *C.char) bool

forward the query result to the corresponding jvm

func GetCurrentHeight

func GetCurrentHeight(envHandle *C.char) C.long

export GetCurrentHeight

func GetFrom

func GetFrom(envHandle *C.char) *C.char

调用者负责释放返回指针内存 export GetFrom

func GetFromLocal

func GetFromLocal(key *C.char, keySize C.int, valueSize *C.int, envHandle *C.char) *C.char

export GetFromLocal

func GetFromLocalInStr

func GetFromLocalInStr(key *C.char, size *C.int, envHandle *C.char) *C.char

调用者负责释放返回指针内存 export GetFromLocalInStr

func GetFromState

func GetFromState(key *C.char, keySize C.int, valueSize *C.int, envHandle *C.char) *C.char

需要调用者释放内存 export GetFromState

func GetFromStateInStr

func GetFromStateInStr(key *C.char, size *C.int, envHandle *C.char) *C.char

调用者负责释放返回指针内存 export GetFromStateInStr

func GetName

func GetName() string

GetName get name for execname

func GetRandom

func GetRandom(envHandle *C.char) *C.char
* blockchain misc

调用者负责释放返回指针内存 export GetRandom

func Init

func Init(name string, cfg *types.Chain33Config, sub []byte)

Init register function

func SetLocal

func SetLocal(key *C.char, keySize C.int, value *C.char, valueSize C.int, envHandle *C.char) C.int
* Local DB

export SetLocal

func SetLocalInStr

func SetLocalInStr(key *C.char, value *C.char, envHandle *C.char) C.int

export SetLocalInStr

func SetQueryResult

func SetQueryResult(jvmgo *C.char, exceptionOccurred C.int, info **C.char, count, sizePtr C.int) C.int

export SetQueryResult

func SetState

func SetState(key *C.char, keySize C.int, value *C.char, valueSize C.int, envHandle *C.char) C.int
* State DB

export SetState

func SetStateInStr

func SetStateInStr(key *C.char, value *C.char, envHandle *C.char) C.int

export SetStateInStr

func StopTransWithErrInfo

func StopTransWithErrInfo(errInfo *C.char, envHandle *C.char) C.int

export StopTransWithErrInfo

Types

type JVMExecutor

type JVMExecutor struct {
	drivers.DriverBase
	// contains filtered or unexported fields
}

JVMExecutor 执行器结构

func NewJVMExecutor

func NewJVMExecutor() *JVMExecutor

NewJVMExecutor new a jvm executor

func (*JVMExecutor) Allow

func (jvm *JVMExecutor) Allow(tx *types.Transaction, index int) error

Allow 允许哪些交易在本命执行器执行

func (*JVMExecutor) ExecDelLocal_CallJvmContract

func (jvm *JVMExecutor) ExecDelLocal_CallJvmContract(payload *jvmTypes.CallJvmContract, tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_CallJvmContract 本地撤销执行调用Jvm合约

func (*JVMExecutor) ExecDelLocal_CreateJvmContract

func (jvm *JVMExecutor) ExecDelLocal_CreateJvmContract(payload *jvmTypes.CreateJvmContract, tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_CreateJvmContract 本地撤销执行创建Jvm合约

func (*JVMExecutor) ExecDelLocal_UpdateJvmContract

func (jvm *JVMExecutor) ExecDelLocal_UpdateJvmContract(payload *jvmTypes.UpdateJvmContract, tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_UpdateJvmContract 本地撤销执行更新Jvm合约

func (*JVMExecutor) ExecLocal_CallJvmContract

func (jvm *JVMExecutor) ExecLocal_CallJvmContract(payload *jvmTypes.CallJvmContract, tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_CallJvmContract 本地执行调用Jvm合约

func (*JVMExecutor) ExecLocal_CreateJvmContract

func (jvm *JVMExecutor) ExecLocal_CreateJvmContract(payload *jvmTypes.CreateJvmContract, tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_CreateJvmContract 本地执行创建Jvm合约

func (*JVMExecutor) ExecLocal_UpdateJvmContract

func (jvm *JVMExecutor) ExecLocal_UpdateJvmContract(payload *jvmTypes.UpdateJvmContract, tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_UpdateJvmContract 本地执行更新Jvm合约

func (*JVMExecutor) Exec_CallJvmContract

func (jvm *JVMExecutor) Exec_CallJvmContract(callJvmContract *jvmTypes.CallJvmContract, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_CallJvmContract 调用合约

func (*JVMExecutor) Exec_CreateJvmContract

func (jvm *JVMExecutor) Exec_CreateJvmContract(createJvmContract *jvmTypes.CreateJvmContract, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_CreateJvmContract 创建合约

func (*JVMExecutor) Exec_UpdateJvmContract

func (jvm *JVMExecutor) Exec_UpdateJvmContract(updateJvmContract *jvmTypes.UpdateJvmContract, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_UpdateJvmContract 创建合约

func (*JVMExecutor) ExecutorOrder

func (jvm *JVMExecutor) ExecutorOrder() int64

ExecutorOrder 设置localdb的EnableRead

func (*JVMExecutor) GenerateExecReceipt

func (jvm *JVMExecutor) GenerateExecReceipt(execName, caller, contractAddr string, opType jvmTypes.JvmContratOpType) (*types.Receipt, error)

GenerateExecReceipt generate exec receipt

func (*JVMExecutor) GetContractAddr

func (jvm *JVMExecutor) GetContractAddr() string

func (*JVMExecutor) GetDriverName

func (jvm *JVMExecutor) GetDriverName() string

GetDriverName 获取driver 名称

func (*JVMExecutor) Query_CheckContractNameExist

func (jvm *JVMExecutor) Query_CheckContractNameExist(in *jvmTypes.CheckJVMContractNameReq) (types.Message, error)

Query_CheckContractNameExist 确认是否存在该Jvm合约,

func (*JVMExecutor) Query_JavaContract

func (jvm *JVMExecutor) Query_JavaContract(in *jvmTypes.JVMQueryReq) (types.Message, error)

查询java合约状态

type QueryResult

type QueryResult struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL