Documentation ¶
Index ¶
- Variables
- func Reg(name string, create ConsensusCreate)
- 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 (client *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) WriteBlock(prev []byte, block *types.Block) error
- type ConsensusCreate
- type Miner
Constants ¶
This section is empty.
Variables ¶
View Source
var QueryData = types.NewQueryData("Query_")
Functions ¶
func Reg ¶
func Reg(name string, create ConsensusCreate)
Types ¶
type BaseClient ¶
func NewBaseClient ¶
func NewBaseClient(cfg *types.Consensus) *BaseClient
func (*BaseClient) AddTxsToBlock ¶
func (bc *BaseClient) AddTxsToBlock(block *types.Block, txs []*types.Transaction) []*types.Transaction
func (*BaseClient) CheckBlock ¶
func (bc *BaseClient) CheckBlock(block *types.BlockDetail) error
func (*BaseClient) CheckTxDup ¶
func (bc *BaseClient) CheckTxDup(txs []*types.Transaction) (transactions []*types.Transaction)
为了不引起交易检查时候产生的无序
func (*BaseClient) Close ¶
func (bc *BaseClient) Close()
func (*BaseClient) ConsensusTicketMiner ¶
func (bc *BaseClient) ConsensusTicketMiner(iscaughtup *types.IsCaughtUp)
func (*BaseClient) ExecConsensus ¶
func (bc *BaseClient) ExecConsensus(data *types.ChainExecutor) (types.Message, error)
func (*BaseClient) GetAPI ¶
func (bc *BaseClient) GetAPI() client.QueueProtocolAPI
func (*BaseClient) GetCurrentBlock ¶
func (bc *BaseClient) GetCurrentBlock() (b *types.Block)
func (*BaseClient) GetCurrentHeight ¶
func (bc *BaseClient) GetCurrentHeight() int64
func (*BaseClient) GetGenesisBlockTime ¶
func (client *BaseClient) GetGenesisBlockTime() int64
func (*BaseClient) GetQueueClient ¶
func (bc *BaseClient) GetQueueClient() queue.Client
func (*BaseClient) InitClient ¶
func (bc *BaseClient) InitClient(c queue.Client, minerstartCB func())
func (*BaseClient) InitMiner ¶
func (bc *BaseClient) InitMiner()
func (*BaseClient) IsCaughtUp ¶
func (bc *BaseClient) IsCaughtUp() bool
func (*BaseClient) IsMining ¶
func (bc *BaseClient) IsMining() bool
func (*BaseClient) Lock ¶
func (bc *BaseClient) Lock()
func (*BaseClient) RandInt64 ¶
func (bc *BaseClient) RandInt64() int64
func (*BaseClient) RequestBlock ¶
func (bc *BaseClient) RequestBlock(start int64) (*types.Block, error)
func (*BaseClient) RequestLastBlock ¶
func (bc *BaseClient) RequestLastBlock() (*types.Block, error)
获取最新的block从blockchain模块
func (*BaseClient) RequestTx ¶
func (bc *BaseClient) RequestTx(listSize int, txHashList [][]byte) []*types.Transaction
Mempool中取交易列表
func (*BaseClient) SetChild ¶
func (bc *BaseClient) SetChild(c Miner)
func (*BaseClient) SetCurrentBlock ¶
func (bc *BaseClient) SetCurrentBlock(b *types.Block)
func (*BaseClient) SetQueueClient ¶
func (bc *BaseClient) SetQueueClient(c queue.Client)
func (*BaseClient) Unlock ¶
func (bc *BaseClient) Unlock()
func (*BaseClient) UpdateCurrentBlock ¶
func (bc *BaseClient) UpdateCurrentBlock(b *types.Block)
func (*BaseClient) WriteBlock ¶
func (bc *BaseClient) WriteBlock(prev []byte, block *types.Block) error
向blockchain写区块
type ConsensusCreate ¶
func Load ¶
func Load(name string) (create ConsensusCreate, err error)
Click to show internal directories.
Click to hide internal directories.