executor

package
Version: v1.65.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: BSD-3-Clause Imports: 24 Imported by: 3

Documentation

Index

Constants

View Source
const SymbolBty = "bty"

SymbolBty ...

Variables

This section is empty.

Functions

func CalcTxHashsHash

func CalcTxHashsHash(txHashs [][]byte) []byte

CalcTxHashsHash 计算几个txhash的hash值 作校验使用

func FilterParaCrossAssetTxHashes added in v1.65.3

func FilterParaCrossAssetTxHashes(txs []*types.Transaction) ([][]byte, error)

FilterParaCrossAssetTxHashes 只过滤跨链资产转移的类型

func FilterParaCrossTxHashes

func FilterParaCrossTxHashes(txs []*types.Transaction) [][]byte

FilterParaCrossTxHashes only all para chain cross txs like xx.paracross exec

func FilterParaMainCrossTxHashes

func FilterParaMainCrossTxHashes(title string, txs []*types.Transaction) [][]byte

FilterParaMainCrossTxHashes ForkParacrossCommitTx之前允许txgroup里面有main chain tx的跨链

func FilterTxsForPara

func FilterTxsForPara(cfg *types.Chain33Config, main *types.ParaTxDetail) []*types.Transaction

FilterTxsForPara include some main tx in tx group before ForkParacrossCommitTx

func GetBlock

func GetBlock(api client.QueueProtocolAPI, blockHash []byte) (*types.BlockDetail, error)

GetBlock get block detail by block hash

func GetMostCommit added in v1.65.1

func GetMostCommit(commits [][]byte) (int, string)

GetMostCommit ...

func GetName

func GetName() string

GetName return paracross name

func GetTx

func GetTx(api client.QueueProtocolAPI, txHash []byte) (*types.TransactionDetail, error)

GetTx get tx by tx hash

func Init

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

Init paracross exec register

func InitExecType

func InitExecType()

InitExecType ...

func NewMainAccount

func NewMainAccount(cfg *types.Chain33Config, paraTitle, paraExecName, paraSymbol string, db db.KV) (*account.DB, error)

NewMainAccount create new Main account 以后如果支持从平行链资产转移到主链, 构建平行链资产在主链的paracross帐号 execName: paracross symbol: user.p.{guodun}.coins.{guodun} user.p.{guodun}.token.{TEST} 完整的帐号地址 mavl-paracross-user.p.{guodun}.coins.guodun-{user-address} 对应平行链上子地址 mavl-coins-{guodun}-exec-{Address(paracross)}:{Address(paracross)}

func NewParaAccount

func NewParaAccount(cfg *types.Chain33Config, paraTitle, mainExecName, mainSymbol string, db db.KV) (*account.DB, error)

NewParaAccount create new paracross account 其中带{}, 都表示变量, 用需要用真实的地址, 符号代替 构建主链资产在平行链paracross帐号 execName: user.p.{guodun}.paracross symbol: coins.bty, token.{TEST} 完整的帐号地址 mavl-{paracross}-coins.bty-{user-address} 不带title{paracross} 对应主链上paracross 子帐号 malv-coins-bty-exec-{Address(paracross)}:{Address(user.p.{guodun}.paracross)}

func NewStageTable

func NewStageTable(kvdb db.KV) *table.Table

NewStageTable 新建表

Types

type Paracross

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

Paracross exec

func (*Paracross) Allow

func (c *Paracross) Allow(tx *types.Transaction, index int) error

Allow add paracross allow rule

func (*Paracross) CheckReceiptExecOk

func (c *Paracross) CheckReceiptExecOk() bool

CheckReceiptExecOk return true to check if receipt ty is ok

func (*Paracross) ExecDelLocal_AssetTransfer

func (e *Paracross) ExecDelLocal_AssetTransfer(payload *types.AssetsTransfer, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_AssetTransfer asset transfer del local db process

func (*Paracross) ExecDelLocal_AssetWithdraw

func (e *Paracross) ExecDelLocal_AssetWithdraw(payload *types.AssetsWithdraw, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_AssetWithdraw asset withdraw local db process

func (*Paracross) ExecDelLocal_Commit

func (e *Paracross) ExecDelLocal_Commit(payload *pt.ParacrossCommitAction, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Commit consensus commit tx del local db process

func (*Paracross) ExecDelLocal_CrossAssetTransfer

func (e *Paracross) ExecDelLocal_CrossAssetTransfer(payload *pt.CrossAssetTransfer, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_CrossAssetTransfer asset transfer del local db process

func (*Paracross) ExecDelLocal_Miner

func (e *Paracross) ExecDelLocal_Miner(payload *pt.ParacrossMinerAction, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Miner miner tx del local db process

func (*Paracross) ExecDelLocal_NodeConfig

func (e *Paracross) ExecDelLocal_NodeConfig(payload *pt.ParaNodeAddrConfig, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_NodeConfig node config tx delete process

func (*Paracross) ExecDelLocal_NodeGroupConfig

func (e *Paracross) ExecDelLocal_NodeGroupConfig(payload *pt.ParaNodeGroupConfig, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_NodeGroupConfig node group config tx delete process

func (*Paracross) ExecDelLocal_SelfStageConfig

func (e *Paracross) ExecDelLocal_SelfStageConfig(payload *pt.ParaStageConfig, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_SelfStageConfig transfer asset to exec local db process

func (*Paracross) ExecDelLocal_SupervisionNodeConfig added in v1.65.3

func (e *Paracross) ExecDelLocal_SupervisionNodeConfig(payload *pt.ParaNodeAddrConfig, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

func (*Paracross) ExecDelLocal_Transfer

func (e *Paracross) ExecDelLocal_Transfer(payload *types.AssetsTransfer, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Transfer asset transfer del local process

func (*Paracross) ExecDelLocal_TransferToExec

func (e *Paracross) ExecDelLocal_TransferToExec(payload *types.AssetsTransferToExec, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_TransferToExec asset transfer to exec del local db process

func (*Paracross) ExecDelLocal_Withdraw

func (e *Paracross) ExecDelLocal_Withdraw(payload *types.AssetsWithdraw, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Withdraw asset withdraw del local db process

func (*Paracross) ExecLocal_AssetTransfer

func (e *Paracross) ExecLocal_AssetTransfer(payload *types.AssetsTransfer, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_AssetTransfer asset transfer local proc

func (*Paracross) ExecLocal_AssetWithdraw

func (e *Paracross) ExecLocal_AssetWithdraw(payload *types.AssetsWithdraw, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_AssetWithdraw asset withdraw process

func (*Paracross) ExecLocal_Commit

func (e *Paracross) ExecLocal_Commit(payload *pt.ParacrossCommitAction, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Commit commit tx local db process

func (*Paracross) ExecLocal_CrossAssetTransfer

func (e *Paracross) ExecLocal_CrossAssetTransfer(payload *pt.CrossAssetTransfer, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_CrossAssetTransfer asset transfer local proc

func (*Paracross) ExecLocal_Miner

func (e *Paracross) ExecLocal_Miner(payload *pt.ParacrossMinerAction, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Miner miner tx local db process

func (*Paracross) ExecLocal_NodeConfig

func (e *Paracross) ExecLocal_NodeConfig(payload *pt.ParaNodeAddrConfig, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_NodeConfig node config add process

func (*Paracross) ExecLocal_NodeGroupConfig

func (e *Paracross) ExecLocal_NodeGroupConfig(payload *pt.ParaNodeGroupConfig, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_NodeGroupConfig node group config add process

func (*Paracross) ExecLocal_SelfStageConfig

func (e *Paracross) ExecLocal_SelfStageConfig(payload *pt.ParaStageConfig, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_SelfStageConfig transfer asset to exec local db process

func (*Paracross) ExecLocal_SupervisionNodeConfig added in v1.65.3

func (e *Paracross) ExecLocal_SupervisionNodeConfig(payload *pt.ParaNodeAddrConfig, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

func (*Paracross) ExecLocal_Transfer

func (e *Paracross) ExecLocal_Transfer(payload *types.AssetsTransfer, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Transfer asset transfer local db process

func (*Paracross) ExecLocal_TransferToExec

func (e *Paracross) ExecLocal_TransferToExec(payload *types.AssetsTransferToExec, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_TransferToExec transfer asset to exec local db process

func (*Paracross) ExecLocal_Withdraw

func (e *Paracross) ExecLocal_Withdraw(payload *types.AssetsWithdraw, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Withdraw asset withdraw local db process

func (*Paracross) Exec_AssetTransfer

func (e *Paracross) Exec_AssetTransfer(payload *types.AssetsTransfer, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_AssetTransfer asset transfer exec process

func (*Paracross) Exec_AssetWithdraw

func (e *Paracross) Exec_AssetWithdraw(payload *types.AssetsWithdraw, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_AssetWithdraw asset withdraw exec process

func (*Paracross) Exec_Commit

func (e *Paracross) Exec_Commit(payload *pt.ParacrossCommitAction, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Commit consensus commit tx exec process

func (*Paracross) Exec_CrossAssetTransfer

func (e *Paracross) Exec_CrossAssetTransfer(payload *pt.CrossAssetTransfer, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_CrossAssetTransfer parallel chain asset transfer exec process

func (*Paracross) Exec_Miner

func (e *Paracross) Exec_Miner(payload *pt.ParacrossMinerAction, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Miner miner tx exec process

func (*Paracross) Exec_NodeConfig

func (e *Paracross) Exec_NodeConfig(payload *pt.ParaNodeAddrConfig, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_NodeConfig exec super node config

func (*Paracross) Exec_NodeGroupConfig

func (e *Paracross) Exec_NodeGroupConfig(payload *pt.ParaNodeGroupConfig, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_NodeGroupConfig node group config process

func (*Paracross) Exec_ParaBindMiner added in v1.65.1

func (e *Paracross) Exec_ParaBindMiner(payload *pt.ParaBindMinerCmd, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_ParaBindMiner node group config process

func (*Paracross) Exec_SelfStageConfig

func (e *Paracross) Exec_SelfStageConfig(payload *pt.ParaStageConfig, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_SelfStageConfig node group config process

func (*Paracross) Exec_SupervisionNodeConfig added in v1.65.3

func (e *Paracross) Exec_SupervisionNodeConfig(payload *pt.ParaNodeAddrConfig, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_SupervisionNodeConfig exec Supervision node config

func (*Paracross) Exec_Transfer

func (e *Paracross) Exec_Transfer(payload *types.AssetsTransfer, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Transfer exec asset transfer process

func (*Paracross) Exec_TransferToExec

func (e *Paracross) Exec_TransferToExec(payload *types.AssetsTransferToExec, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_TransferToExec exec transfer asset

func (*Paracross) Exec_Withdraw

func (e *Paracross) Exec_Withdraw(payload *types.AssetsWithdraw, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Withdraw exec asset withdraw

func (*Paracross) GetDriverName

func (c *Paracross) GetDriverName() string

GetDriverName return paracross driver name

func (*Paracross) IsFriend

func (c *Paracross) IsFriend(myexec, writekey []byte, tx *types.Transaction) bool

IsFriend call exec is same seariase exec

func (*Paracross) Query_GetAssetTxResult

func (p *Paracross) Query_GetAssetTxResult(in *types.ReqString) (types.Message, error)

Query_GetAssetTxResult query get asset tx reseult

func (*Paracross) Query_GetBlock2MainInfo

func (p *Paracross) Query_GetBlock2MainInfo(req *types.ReqBlocks) (*pt.ParaBlock2MainInfo, error)

Query_GetBlock2MainInfo ...

func (*Paracross) Query_GetDoneTitleHeight

func (p *Paracross) Query_GetDoneTitleHeight(in *pt.ReqParacrossTitleHeight) (types.Message, error)

Query_GetDoneTitleHeight query title height

func (*Paracross) Query_GetHeight

func (p *Paracross) Query_GetHeight(req *types.ReqString) (*pt.ParacrossConsensusStatus, error)

Query_GetHeight ...

func (*Paracross) Query_GetMainBlockHash

func (p *Paracross) Query_GetMainBlockHash(in *types.Transaction) (types.Message, error)

Query_GetMainBlockHash query get mainblockHash by tx

func (*Paracross) Query_GetNodeAddrInfo

func (p *Paracross) Query_GetNodeAddrInfo(in *pt.ReqParacrossNodeInfo) (types.Message, error)

Query_GetNodeAddrInfo get specific node addr info

func (*Paracross) Query_GetNodeBindMinerList added in v1.65.1

func (p *Paracross) Query_GetNodeBindMinerList(in *pt.ParaNodeBindOne) (types.Message, error)

Query_GetNodeBindMinerList query get super node bind miner list

func (*Paracross) Query_GetNodeGroupAddrs

func (p *Paracross) Query_GetNodeGroupAddrs(in *pt.ReqParacrossNodeInfo) (types.Message, error)

Query_GetNodeGroupAddrs get node group addrs

func (*Paracross) Query_GetNodeGroupStatus

func (p *Paracross) Query_GetNodeGroupStatus(in *pt.ReqParacrossNodeInfo) (types.Message, error)

Query_GetNodeGroupStatus get specific node addr info

func (*Paracross) Query_GetNodeIDInfo

func (p *Paracross) Query_GetNodeIDInfo(in *pt.ReqParacrossNodeInfo) (types.Message, error)

Query_GetNodeIDInfo get specific node addr info

func (*Paracross) Query_GetSelfConsOneStage

func (p *Paracross) Query_GetSelfConsOneStage(in *types.Int64) (types.Message, error)

Query_GetSelfConsOneStage get self consensus one stage

func (*Paracross) Query_GetSelfConsStages

func (p *Paracross) Query_GetSelfConsStages(in *types.ReqNil) (types.Message, error)

Query_GetSelfConsStages get self consensus stages configed

func (*Paracross) Query_GetSupervisionNodeGroupAddrs added in v1.65.3

func (p *Paracross) Query_GetSupervisionNodeGroupAddrs(in *pt.ReqParacrossNodeInfo) (types.Message, error)

Query_GetNodeGroupAddrs get node group addrs

func (*Paracross) Query_GetTitle

func (p *Paracross) Query_GetTitle(in *types.ReqString) (types.Message, error)

Query_GetTitle query paracross title

func (*Paracross) Query_GetTitleByHash

func (p *Paracross) Query_GetTitleByHash(in *pt.ReqParacrossTitleHash) (types.Message, error)

Query_GetTitleByHash query paracross title by block hash

func (*Paracross) Query_GetTitleHeight

func (p *Paracross) Query_GetTitleHeight(in *pt.ReqParacrossTitleHeight) (types.Message, error)

Query_GetTitleHeight query paracross status with title and height

func (*Paracross) Query_ListNodeGroupStatus

func (p *Paracross) Query_ListNodeGroupStatus(in *pt.ReqParacrossNodeInfo) (types.Message, error)

Query_ListNodeGroupStatus list node info by status

func (*Paracross) Query_ListNodeStatusInfo

func (p *Paracross) Query_ListNodeStatusInfo(in *pt.ReqParacrossNodeInfo) (types.Message, error)

Query_ListNodeStatusInfo list node info by status

func (*Paracross) Query_ListSelfStages

func (p *Paracross) Query_ListSelfStages(in *pt.ReqQuerySelfStages) (types.Message, error)

Query_ListSelfStages 批量查询

func (*Paracross) Query_ListSupervisionNodeStatusInfo added in v1.65.3

func (p *Paracross) Query_ListSupervisionNodeStatusInfo(in *pt.ReqParacrossNodeInfo) (types.Message, error)

Query_ListSupervisionNodeStatusInfo list node info by status

func (*Paracross) Query_ListTitles

func (p *Paracross) Query_ListTitles(in *types.ReqNil) (types.Message, error)

Query_ListTitles query paracross titles list

type StageRow

type StageRow struct {
	*pt.LocalSelfConsStageInfo
}

StageRow table meta 结构

func NewStageRow

func NewStageRow() *StageRow

NewStageRow 新建一个meta 结构

func (*StageRow) CreateRow

func (r *StageRow) CreateRow() *table.Row

CreateRow 新建数据行(注意index 数据一定也要保存到数据中,不能就保存heightindex)

func (*StageRow) Get

func (r *StageRow) Get(key string) ([]byte, error)

Get 按照indexName 查询 indexValue

func (*StageRow) SetPayload

func (r *StageRow) SetPayload(data types.Message) error

SetPayload 设置数据

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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