Documentation ¶
Index ¶
- Constants
- func EngineConvert(engine engines.BCEngine) (common.Engine, error)
- func NewEngine() engines.BCEngine
- type Chain
- func (t *Chain) Context() *common.ChainCtx
- func (t *Chain) CreateParaChain() error
- func (t *Chain) PreExec(ctx xctx.XContext, reqs []*protos.InvokeRequest, initiator string, ...) (*protos.InvokeResponse, error)
- func (t *Chain) ProcBlock(ctx xctx.XContext, block *lpb.InternalBlock) error
- func (t *Chain) SetRelyAgent(agent common.ChainRelyAgent) error
- func (t *Chain) Start()
- func (t *Chain) Stop()
- func (t *Chain) SubmitTx(ctx xctx.XContext, tx *lpb.Transaction) error
- type ChainManagerImpl
- func (m *ChainManagerImpl) Get(chainName string) (common.Chain, error)
- func (m *ChainManagerImpl) GetChains() []string
- func (m *ChainManagerImpl) LoadChain(chainName string) error
- func (m *ChainManagerImpl) Put(chainName string, chain common.Chain)
- func (m *ChainManagerImpl) StartChains()
- func (m *ChainManagerImpl) Stop(chainName string) error
- func (m *ChainManagerImpl) StopChains()
- type Engine
- func (t *Engine) Context() *common.EngineCtx
- func (t *Engine) Exit()
- func (t *Engine) Get(name string) (common.Chain, error)
- func (t *Engine) GetChains() []string
- func (t *Engine) Init(envCfg *xconf.EnvConf) error
- func (t *Engine) LoadChain(name string) error
- func (t *Engine) Run()
- func (t *Engine) SetRelyAgent(agent common.EngineRelyAgent) error
- func (t *Engine) Stop(name string) error
Constants ¶
View Source
const ( // 提交交易cache有效期(s) TxIdCacheExpired = 120 * time.Second // 提交交易cache GC 周期(s) TxIdCacheGCInterval = 180 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func EngineConvert ¶
转换引擎句柄类型 对外提供类型转义方法,以接口形式对外暴露
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
定义一条链的具体行为,对外暴露接口错误统一使用标准错误
func (*Chain) PreExec ¶
func (t *Chain) PreExec(ctx xctx.XContext, reqs []*protos.InvokeRequest, initiator string, authRequires []string) (*protos.InvokeResponse, error)
交易预执行
func (*Chain) SetRelyAgent ¶
func (t *Chain) SetRelyAgent(agent common.ChainRelyAgent) error
供单测时设置rely agent为mock agent,非并发安全
type ChainManagerImpl ¶
type ChainManagerImpl struct {
// contains filtered or unexported fields
}
ChainMgmtImpl 用于管理链操作
func (*ChainManagerImpl) Get ¶
func (m *ChainManagerImpl) Get(chainName string) (common.Chain, error)
func (*ChainManagerImpl) GetChains ¶
func (m *ChainManagerImpl) GetChains() []string
func (*ChainManagerImpl) LoadChain ¶
func (m *ChainManagerImpl) LoadChain(chainName string) error
func (*ChainManagerImpl) StartChains ¶
func (m *ChainManagerImpl) StartChains()
func (*ChainManagerImpl) Stop ¶
func (m *ChainManagerImpl) Stop(chainName string) error
func (*ChainManagerImpl) StopChains ¶
func (m *ChainManagerImpl) StopChains()
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
xuperos执行引擎,为公链场景订制区块链引擎
func (*Engine) SetRelyAgent ¶
func (t *Engine) SetRelyAgent(agent common.EngineRelyAgent) error
供单测时设置rely agent为mock agent,非并发安全
Click to show internal directories.
Click to hide internal directories.