producer

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package producer implements Hubble block creation and producing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	AccountManager() *accounts.Manager
	BlockChain() *core.BlockChain
	TxPool() *core.TxPool
	ChainDb() vntdb.Database
}

Backend wraps all methods required for producing.

type Producer

type Producer struct {
	// contains filtered or unexported fields
}

Producer creates blocks and searches for proof-of-work values.

func New

func New(vnt Backend, config *params.ChainConfig, mux *event.TypeMux, engine consensus.Engine) *Producer

func (*Producer) Pending

func (self *Producer) Pending() (*types.Block, *state.StateDB)

Pending returns the currently pending block and associated state.

func (*Producer) PendingBlock

func (self *Producer) PendingBlock() *types.Block

PendingBlock returns the currently pending block.

Note, to access both the pending block and the pending state simultaneously, please use Pending(), as the pending state can change between multiple method calls

func (*Producer) Producing

func (self *Producer) Producing() bool

func (*Producer) SetCoinbase

func (self *Producer) SetCoinbase(addr common.Address)

func (*Producer) SetExtra

func (self *Producer) SetExtra(extra []byte) error

func (*Producer) Start

func (self *Producer) Start(coinbase common.Address)

func (*Producer) Stop

func (self *Producer) Stop()

type Result

type Result struct {
	Work  *Work
	Block *types.Block
}

type Work

type Work struct {
	Block *types.Block // the new block
	// contains filtered or unexported fields
}

Work is the workers current environment and holds all of the current state information

Jump to

Keyboard shortcuts

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