miner

package
v0.0.0-...-de85661 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: Unlicense Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start()

func Stop

func Stop()

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) Close

func (miner *Miner) Close()

func (*Miner) Mining

func (miner *Miner) Mining() bool

func (*Miner) Pending

func (miner *Miner) Pending() (*block2.Block, *operationdb.OperationDB)

挂起返回当前挂起的块和关联状态。

func (*Miner) PendingBlock

func (miner *Miner) PendingBlock() *block2.Block

PendingBlock返回当前挂起的块。注意,要同时访问挂起块和挂起状态, 请使用pending(),因为挂起状态可以在多个方法调用之间更改

func (*Miner) SetEtherbase

func (miner *Miner) SetEtherbase(addr entity.Address)

func (*Miner) Start

func (miner *Miner) Start(coinbase entity.Address)

func (*Miner) Stop

func (miner *Miner) Stop()

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()

type MinerStop

type MinerStop struct {
}

func (*MinerStop) Stop

func (bc *MinerStop) Stop()

Jump to

Keyboard shortcuts

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