Documentation ¶
Overview ¶
Package consensus 系统基础共识包
Index ¶
- Variables
- func Reg(name string, create Create)
- type BaseClient
- func (bc *BaseClient) AddTxsToBlock(block *types.Block, txs []*types.Transaction) []*types.Transaction
- func (bc *BaseClient) CheckBlock(block *types.BlockDetail) error
- func (bc *BaseClient) CheckTxDup(txs []*types.Transaction) (transactions []*types.Transaction)
- func (bc *BaseClient) Close()
- func (bc *BaseClient) ConsensusTicketMiner(iscaughtup *types.IsCaughtUp)
- func (bc *BaseClient) EventLoop()
- func (bc *BaseClient) ExecConsensus(data *types.ChainExecutor) (types.Message, error)
- func (bc *BaseClient) GetAPI() client.QueueProtocolAPI
- func (bc *BaseClient) GetCurrentBlock() (b *types.Block)
- func (bc *BaseClient) GetCurrentHeight() int64
- func (bc *BaseClient) GetGenesisBlockTime() int64
- func (bc *BaseClient) GetQueueClient() queue.Client
- func (bc *BaseClient) InitBlock()
- func (bc *BaseClient) InitClient(c queue.Client, minerstartCB func())
- func (bc *BaseClient) InitMiner()
- func (bc *BaseClient) IsCaughtUp() bool
- func (bc *BaseClient) IsMining() bool
- func (bc *BaseClient) Lock()
- func (bc *BaseClient) RandInt64() int64
- func (bc *BaseClient) RequestBlock(start int64) (*types.Block, error)
- func (bc *BaseClient) RequestLastBlock() (*types.Block, error)
- func (bc *BaseClient) RequestTx(listSize int, txHashList [][]byte) []*types.Transaction
- func (bc *BaseClient) SetChild(c Miner)
- func (bc *BaseClient) SetCurrentBlock(b *types.Block)
- func (bc *BaseClient) SetQueueClient(c queue.Client)
- func (bc *BaseClient) Unlock()
- func (bc *BaseClient) UpdateCurrentBlock(b *types.Block)
- func (bc *BaseClient) Wait()
- func (bc *BaseClient) WriteBlock(prev []byte, block *types.Block) error
- type Create
- type Miner
Constants ¶
This section is empty.
Variables ¶
View Source
var QueryData = types.NewQueryData("Query_")
QueryData 检索数据
Functions ¶
Types ¶
type BaseClient ¶
BaseClient ...
func (*BaseClient) AddTxsToBlock ¶
func (bc *BaseClient) AddTxsToBlock(block *types.Block, txs []*types.Transaction) []*types.Transaction
AddTxsToBlock 添加交易到区块中
func (*BaseClient) CheckBlock ¶
func (bc *BaseClient) CheckBlock(block *types.BlockDetail) error
CheckBlock 检查区块
func (*BaseClient) CheckTxDup ¶
func (bc *BaseClient) CheckTxDup(txs []*types.Transaction) (transactions []*types.Transaction)
CheckTxDup 为了不引起交易检查时候产生的无序
func (*BaseClient) ConsensusTicketMiner ¶
func (bc *BaseClient) ConsensusTicketMiner(iscaughtup *types.IsCaughtUp)
ConsensusTicketMiner ...
func (*BaseClient) ExecConsensus ¶
func (bc *BaseClient) ExecConsensus(data *types.ChainExecutor) (types.Message, error)
ExecConsensus 执行共识
func (*BaseClient) GetCurrentBlock ¶
func (bc *BaseClient) GetCurrentBlock() (b *types.Block)
GetCurrentBlock 获取当前区块
func (*BaseClient) GetCurrentHeight ¶
func (bc *BaseClient) GetCurrentHeight() int64
GetCurrentHeight 获取当前高度
func (*BaseClient) GetGenesisBlockTime ¶
func (bc *BaseClient) GetGenesisBlockTime() int64
GetGenesisBlockTime 获取创世区块时间
func (*BaseClient) GetQueueClient ¶
func (bc *BaseClient) GetQueueClient() queue.Client
GetQueueClient 获取客户端队列
func (*BaseClient) InitClient ¶
func (bc *BaseClient) InitClient(c queue.Client, minerstartCB func())
InitClient 初始化
func (*BaseClient) RequestBlock ¶
func (bc *BaseClient) RequestBlock(start int64) (*types.Block, error)
RequestBlock 请求区块
func (*BaseClient) RequestLastBlock ¶
func (bc *BaseClient) RequestLastBlock() (*types.Block, error)
RequestLastBlock 获取最新的block从blockchain模块
func (*BaseClient) RequestTx ¶
func (bc *BaseClient) RequestTx(listSize int, txHashList [][]byte) []*types.Transaction
RequestTx Mempool中取交易列表
func (*BaseClient) SetCurrentBlock ¶
func (bc *BaseClient) SetCurrentBlock(b *types.Block)
SetCurrentBlock 设置当前区块
func (*BaseClient) SetQueueClient ¶
func (bc *BaseClient) SetQueueClient(c queue.Client)
SetQueueClient 设置客户端队列
func (*BaseClient) UpdateCurrentBlock ¶
func (bc *BaseClient) UpdateCurrentBlock(b *types.Block)
UpdateCurrentBlock 更新当前区块
func (*BaseClient) WriteBlock ¶
func (bc *BaseClient) WriteBlock(prev []byte, block *types.Block) error
WriteBlock 向blockchain写区块
Click to show internal directories.
Click to hide internal directories.