consensus

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2021 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consensus

type Consensus struct {
	MemCache *cache.Cache
}

func (*Consensus) ChooseConsensusPeer

func (this *Consensus) ChooseConsensusPeer(dataBlock *entity.DataBlock) []string

* 主节点挑选副节点

func (*Consensus) CreateConsensusLog

func (this *Consensus) CreateConsensusLog(chainMessage *msg.ChainMessage, dataBlock *entity.DataBlock, myselfPeer *entity1.MyselfPeer, status string) *entity.ConsensusLog

* 创建新的ConsensusLog,存入数据库中

func (*Consensus) GetConsensusLog

func (this *Consensus) GetConsensusLog(chainMessage *msg.ChainMessage) (*entity.ConsensusLog, error)

* 从消息中提取ConsensusLog

func (*Consensus) GetDataBlock

func (this *Consensus) GetDataBlock(chainMessage *msg.ChainMessage) (*entity.DataBlock, error)

* 从消息中提取datablock

func (*Consensus) GetDataBlockCacheKey

func (this *Consensus) GetDataBlockCacheKey(blockId string, sliceNumber uint64) string

* 获取datablock缓存的key

func (*Consensus) GetLogCacheKey

func (this *Consensus) GetLogCacheKey(log *entity.ConsensusLog) string

* 获取日志缓存的key

func (*Consensus) NearestConsensusPeer

func (this *Consensus) NearestConsensusPeer(key string, createTimestamp uint64) []string

* 获取最近的peer集合

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL