miner

package
v0.2.10-beta.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package miner is responsible for creating valid blocks that contain valid activation transactions and transactions

Index

Constants

View Source
const (

	// AtxsPerBlockLimit indicates the maximum number of ATXs a Ballot can reference.
	AtxsPerBlockLimit = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockBuilder

type BlockBuilder struct {
	log.Log

	TransactionPool txPool
	// contains filtered or unexported fields
}

BlockBuilder is the struct that orchestrates the building of blocks, it is responsible for receiving hare results. referencing txs and atxs from mem pool and referencing them in the created block it is also responsible for listening to the clock and querying when a block should be created according to the block oracle.

func NewBlockBuilder

func NewBlockBuilder(
	config Config,
	sgn signer,
	publisher pubsub.Publisher,
	beginRoundEvent chan types.LayerID,
	msh meshProvider,
	bbp baseBlockProvider,
	blockOracle blockOracle,
	beaconProvider system.BeaconGetter,
	syncer system.SyncStateProvider,
	projector projector,
	txPool txPool,
	logger log.Log,
) *BlockBuilder

NewBlockBuilder creates a struct of block builder type.

func (*BlockBuilder) Close

func (t *BlockBuilder) Close() error

Close stops listeners and stops trying to create block in layers.

func (*BlockBuilder) Start

func (t *BlockBuilder) Start(ctx context.Context) error

Start starts the process of creating a block, it listens for txs and atxs received by gossip, and starts querying block oracle when it should create a block. This function returns an error if Start was already called once.

type Config added in v0.1.15

type Config struct {
	DBPath         string
	MinerID        types.NodeID
	AtxsPerBlock   int
	LayersPerEpoch uint32
	TxsPerBlock    int
}

Config is the block builders configuration struct.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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