Documentation ¶
Index ¶
- func Start()
- func Stop()
- type Backend
- type Miner
- func (miner *Miner) Close()
- func (miner *Miner) Mining() bool
- func (miner *Miner) Pending() (*block2.Block, *operationdb.OperationDB)
- func (miner *Miner) PendingBlock() *block2.Block
- func (miner *Miner) SetEtherbase(addr entity.Address)
- func (miner *Miner) Start(coinbase entity.Address)
- func (miner *Miner) Stop()
- func (miner *Miner) SubscribePendingLogs(ch chan<- []*block2.Log) event.Subscription
- type MinerStart
- type MinerStop
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend interface { BlockChain() *blockchain.BlockChain TxPool() *blockchain.TxPool StateAtBlock(block *block2.Block, reexec uint64, base *operationdb.OperationDB, checkLive bool, preferDisk bool) (statedb *operationdb.OperationDB, err error) }
后端包含所有的处理区块的方法
type Miner ¶
type Miner struct {
// contains filtered or unexported fields
}
func New ¶
func New(oct Backend, config *blockchainconfig.Config, chainConfig *entity.ChainConfig, engine consensus.Engine) *Miner
func (*Miner) Pending ¶
func (miner *Miner) Pending() (*block2.Block, *operationdb.OperationDB)
挂起返回当前挂起的块和关联状态。
func (*Miner) PendingBlock ¶
PendingBlock返回当前挂起的块。注意,要同时访问挂起块和挂起状态, 请使用pending(),因为挂起状态可以在多个方法调用之间更改
func (*Miner) SetEtherbase ¶
func (*Miner) SubscribePendingLogs ¶
func (miner *Miner) SubscribePendingLogs(ch chan<- []*block2.Log) event.Subscription
SubscribePendingLogs开始将挂起事务的日志传递到给定通道。
type MinerStart ¶
type MinerStart struct { }
func (*MinerStart) Start ¶
func (bc *MinerStart) Start()
Click to show internal directories.
Click to hide internal directories.