1 Star 0 Fork 0

艾鸥科技 / go-aiou

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
consensus.go 693 Bytes
一键复制 编辑 原始数据 按行查看 历史
张卓 提交于 2020-05-10 14:55 . init
package consensus
import (
"gitee.com/aiou-official/go-aiou/chainbase"
"gitee.com/aiou-official/go-aiou/common/config"
"gitee.com/aiou-official/go-aiou/consensus/pob"
"gitee.com/aiou-official/go-aiou/p2p"
)
// Type is the type of consensus
type Type uint8
// The types of consensus
const (
_ Type = iota
Pob
)
// Consensus is a consensus server.
type Consensus interface {
Start() error
Stop()
}
// New returns the different consensus strategy.
func New(cType Type, conf *config.Config, chainBase *chainbase.ChainBase, service p2p.Service) Consensus {
switch cType {
case Pob:
return pob.New(conf, chainBase, service)
default:
return pob.New(conf, chainBase, service)
}
}
1
https://gitee.com/aiou-official/go-aiou.git
git@gitee.com:aiou-official/go-aiou.git
aiou-official
go-aiou
go-aiou
376a44096468

搜索帮助