Documentation ¶
Index ¶
- type Cluster
- type ClusterMember
- type Snapshot
- type Snapshots
- func (sn *Snapshots) AddSnapshot(refBlockNo types.BlockNo) ([]string, error)
- func (sn *Snapshots) Del(refBlockNo types.BlockNo) error
- func (sn *Snapshots) GC(blockNo types.BlockNo)
- func (sn *Snapshots) NeedToRefresh(blockNo types.BlockNo) bool
- func (sn *Snapshots) SetStateDB(sdb *state.ChainStateDB)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
Cluster represents a cluster of block producers.
func NewCluster ¶
NewCluster returns a new bp.Cluster.
func (*Cluster) BpID2Index ¶
BpID2Index returns the index corresponding to id.
func (*Cluster) BpIndex2ID ¶
BpIndex2ID returns the ID correspinding to idx.
type ClusterMember ¶ added in v0.9.4
ClusterMember is an interface which corresponds to BP member udpate.
type Snapshot ¶ added in v0.9.4
Snapshot represents the set of the elected BP at refBlockNo.
func NewSnapshot ¶ added in v0.9.4
NewSnapshot returns a Snapshot corresponding to blockNo and period.
type Snapshots ¶ added in v0.9.4
type Snapshots struct {
// contains filtered or unexported fields
}
Snapshots is a map from block no to *Snapshot.
func NewSnapshots ¶ added in v0.9.4
func NewSnapshots(c ClusterMember, cdb consensus.ChainDB) *Snapshots
NewSnapshots returns a new Snapshots.
func (*Snapshots) AddSnapshot ¶ added in v0.9.4
AddSnapshot add a new BP list corresponding to refBlockNO to sn.
func (*Snapshots) Del ¶ added in v0.9.4
Del removes a snapshot corresponding to refBlockNo from sn.snaps.
func (*Snapshots) NeedToRefresh ¶ added in v0.9.4
NeedToRefresh reports whether blockNo corresponds to a BP regime change point.
func (*Snapshots) SetStateDB ¶ added in v0.9.4
func (sn *Snapshots) SetStateDB(sdb *state.ChainStateDB)
SetStateDB sets sdb to sn.sdb.