Documentation ¶
Index ¶
- func Contain(obj interface{}, target interface{}) (bool, error)
- func GenGenesisSnap(db hpbdb.Database, recents *lru.ARCCache, signatures *lru.ARCCache, ...) (*snapshots.HpbNodeSnap, error)
- func GetAllCadNodeSnap(db hpbdb.Database, recents *lru.ARCCache, chain consensus.ChainReader, ...) (*snapshots.CadNodeSnap, error)
- func GetCadNodeFromNetwork(random []byte, rankingdata map[common.Address]float64) ([]*snapshots.CadWinner, []byte, error)
- func GetCadNodeSnap(db hpbdb.Database, recents *lru.ARCCache, chain consensus.ChainReader, ...) (*snapshots.CadNodeSnap, error)
- func GetCandDataFromCacheAndDb(db hpbdb.Database, recents *lru.ARCCache, hash common.Hash) (*snapshots.CadNodeSnap, error)
- func GetDataFromCacheAndDb(db hpbdb.Database, recents *lru.ARCCache, signatures *lru.ARCCache, ...) (*snapshots.HpbNodeSnap, error)
- func GetHpbNodeSnap(db hpbdb.Database, recents *lru.ARCCache, signatures *lru.ARCCache, ...) (*snapshots.HpbNodeSnap, error)
- func StoreCanDataToCacheAndDb(recents *lru.ARCCache, db hpbdb.Database, snap *snapshots.CadNodeSnap, ...) error
- func StoreDataToCacheAndDb(recents *lru.ARCCache, db hpbdb.Database, snap *snapshots.HpbNodeSnap, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenGenesisSnap ¶
func GenGenesisSnap(db hpbdb.Database, recents *lru.ARCCache, signatures *lru.ARCCache, config *config.PrometheusConfig, chain consensus.ChainReader) (*snapshots.HpbNodeSnap, error)
生成初始化的区块
func GetAllCadNodeSnap ¶
func GetAllCadNodeSnap(db hpbdb.Database, recents *lru.ARCCache, chain consensus.ChainReader, number uint64, hash common.Hash) (*snapshots.CadNodeSnap, error)
获取候选选举的快照
func GetCadNodeFromNetwork ¶
func GetCadNodeFromNetwork(random []byte, rankingdata map[common.Address]float64) ([]*snapshots.CadWinner, []byte, error)
从网络中获取最优化的
func GetCadNodeSnap ¶
func GetCadNodeSnap(db hpbdb.Database, recents *lru.ARCCache, chain consensus.ChainReader, number uint64, hash common.Hash) (*snapshots.CadNodeSnap, error)
获取候选选举的快照
func GetCandDataFromCacheAndDb ¶
func GetCandDataFromCacheAndDb(db hpbdb.Database, recents *lru.ARCCache, hash common.Hash) (*snapshots.CadNodeSnap, error)
从数据库和缓存中获取数据
func GetDataFromCacheAndDb ¶
func GetDataFromCacheAndDb(db hpbdb.Database, recents *lru.ARCCache, signatures *lru.ARCCache, config *config.PrometheusConfig, hash common.Hash) (*snapshots.HpbNodeSnap, error)
从数据库和缓存中获取数据
func GetHpbNodeSnap ¶
func GetHpbNodeSnap(db hpbdb.Database, recents *lru.ARCCache, signatures *lru.ARCCache, config *config.PrometheusConfig, chain consensus.ChainReader, number uint64, hash common.Hash, parents []*types.Header) (*snapshots.HpbNodeSnap, error)
func StoreCanDataToCacheAndDb ¶
func StoreCanDataToCacheAndDb(recents *lru.ARCCache, db hpbdb.Database, snap *snapshots.CadNodeSnap, latestCheckPointHash common.Hash) error
将数据存入到缓存和数据库中
func StoreDataToCacheAndDb ¶
func StoreDataToCacheAndDb(recents *lru.ARCCache, db hpbdb.Database, snap *snapshots.HpbNodeSnap, latestCheckPointHash common.Hash) error
将数据存入到缓存和数据库中
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.