Documentation ¶
Index ¶
- Constants
- func CreateBCEngine(egName string, envCfg *xconf.EnvConf) (base.BasicEngine, error)
- func EngineConvert(engine base.BasicEngine) (base.Engine, error)
- func Engines() []string
- func NewEngine() base.BasicEngine
- func Register(name string, f NewBcEngineFunc)
- type Chain
- func (t *Chain) Context() *base.ChainCtx
- func (t *Chain) CreateParaChain() error
- func (t *Chain) PreExec(ctx xctx.Context, reqs []*protos.InvokeRequest, initiator string, ...) (*protos.InvokeResponse, error)
- func (t *Chain) ProcBlock(ctx xctx.Context, block *protos.InternalBlock) error
- func (t *Chain) SetRelyAgent(agent base.ChainRelyAgent) error
- func (t *Chain) Start()
- func (t *Chain) Stop()
- func (t *Chain) SubmitTx(ctx xctx.Context, tx *protos.Transaction) error
- type ChainManagerImpl
- func (m *ChainManagerImpl) Get(chainName string) (base.Chain, error)
- func (m *ChainManagerImpl) GetChains() []string
- func (m *ChainManagerImpl) LoadChain(chainName string) error
- func (m *ChainManagerImpl) Put(chainName string, chain base.Chain)
- func (m *ChainManagerImpl) StartChains()
- func (m *ChainManagerImpl) Stop(chainName string) error
- func (m *ChainManagerImpl) StopChains()
- type Engine
- func (t *Engine) Context() *base.EngineCtx
- func (t *Engine) CreateNetwork(envCfg *xconf.EnvConf) (netBase.Network, error)
- func (t *Engine) Exit()
- func (t *Engine) Get(name string) (base.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) Put(s string, chain base.Chain)
- func (t *Engine) Run()
- func (t *Engine) StartChains()
- func (t *Engine) Stop(name string) error
- func (t *Engine) StopChains()
- type NewBcEngineFunc
Constants ¶
View Source
const ( // 提交交易cache有效期(s) TxIdCacheExpired = 120 * time.Second // 提交交易cache GC 周期(s) TxIdCacheGCInterval = 180 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func CreateBCEngine ¶
采用工厂模式,对上层统一区块链执行引擎创建操作,方便框架开发
func EngineConvert ¶
func EngineConvert(engine base.BasicEngine) (base.Engine, error)
转换引擎句柄类型 对外提供类型转义方法,以接口形式对外暴露
func NewEngine ¶
func NewEngine() base.BasicEngine
func Register ¶
func Register(name string, f NewBcEngineFunc)
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
定义一条链的具体行为,对外暴露接口错误统一使用标准错误
func (*Chain) PreExec ¶
func (t *Chain) PreExec(ctx xctx.Context, reqs []*protos.InvokeRequest, initiator string, authRequires []string) (*protos.InvokeResponse, error)
交易预执行
func (*Chain) SetRelyAgent ¶
func (t *Chain) SetRelyAgent(agent base.ChainRelyAgent) error
供单测时设置rely agent为mock agent,非并发安全 未使用到的函数
type ChainManagerImpl ¶
type ChainManagerImpl struct {
// contains filtered or unexported fields
}
ChainMgmtImpl 用于管理链操作
func NewChainManagerImpl ¶
func NewChainManagerImpl(engCtx *base.EngineCtx, log logger.Logger) *ChainManagerImpl
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) CreateNetwork ¶
func (*Engine) StartChains ¶
func (t *Engine) StartChains()
func (*Engine) StopChains ¶
func (t *Engine) StopChains()
Click to show internal directories.
Click to hide internal directories.