Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewExecutor ¶
func NewExecutor(abci iabci.AppBlockChain, selector iconsensus.Sortitionor, p *Params) iconsensus.Consensus
NewExecutor return consensus interface and register message handle channel.
Types ¶
type FakeDepositFetcher ¶
type FakeDepositFetcher struct { }
FakeDepositFetcher just for test.
func (FakeDepositFetcher) GetDepositUnit ¶
GetDepositUnit return 1. for test.
type Params ¶
type Params struct {
// contains filtered or unexported fields
}
Params contains some infos of the miner, such as pk, sk, voteThreshold...
func CreateParams ¶
func CreateParams(pk, sk []byte, voteThreshold int, integrationTest bool, shardIndex shard.Index, manager iheartbeat.HeartBeat, pubSubMgr *message.PubSubManager, metrics *metrics.Metrics) *Params
CreateParams will return a pointer to Params, which initialization data is provided by the incoming parameters.
type SimpleBlockInfo ¶
type SimpleBlockInfo struct {
// contains filtered or unexported fields
}
SimpleBlockInfo is used for test, (tools, testctl...), it will record cur round block and write them to local file.
func (*SimpleBlockInfo) String ¶
func (sb *SimpleBlockInfo) String() string
type Sortitionor ¶
type Sortitionor struct {
// contains filtered or unexported fields
}
Sortitionor The sortitionor interface is implemented, to determine whether the miner can propose potential block and belong to a shard.
func NewSortitionor ¶
func NewSortitionor(expNumShard uint32, leaderRate uint32) *Sortitionor
NewSortitionor will return a pointer to DummySortitionor.
func (*Sortitionor) IsLeader ¶
func (ds *Sortitionor) IsLeader(seed []byte, index shard.Index) bool
IsLeader return whether the miner is leader. TODO(#155): Current algorithm is not correct
func (*Sortitionor) SetLeaderRate ¶
func (ds *Sortitionor) SetLeaderRate(n int, index shard.Index)
SetLeaderRate is just for testnet2.0 n is the whole number of miners