miner

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBlockIsFull = errors.New("block is full")
View Source
var ErrNoTransactions = errors.New("no transactions")
View Source
var ErrStateChanged = errors.New("state changed")

Functions

func FeaturesToInt16 added in v0.5.0

func FeaturesToInt16(a []settings.Feature) []int16

func Run

func Run(ctx context.Context, a types.Miner, s Mine, internalCh chan<- messages.InternalMessage)

Types

type Constraints

type Constraints struct {
	MaxScriptRunsInBlock        int
	MaxScriptsComplexityInBlock state.MaxScriptsComplexityInBlock
	ClassicAmountOfTxsInBlock   int
	MaxTxsSizeInBytes           int
}

func DefaultConstraints

func DefaultConstraints() Constraints

type Features added in v0.5.0

type Features []settings.Feature

func ParseVoteFeatures added in v0.5.0

func ParseVoteFeatures(s string) (Features, error)

func ValidateFeatures added in v0.6.0

func ValidateFeatures(state featureState, features Features) (Features, error)

type MicroMiner added in v0.6.0

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

func NewMicroMiner added in v0.6.0

func NewMicroMiner(services services.Services) *MicroMiner

func (*MicroMiner) Micro added in v0.6.0

func (a *MicroMiner) Micro(
	minedBlock *proto.Block,
	rest proto.MiningLimits,
	keyPair proto.KeyPair,
	blockFinalization *proto.FinalizationVoting,
) (*proto.Block, *proto.MicroBlock, proto.MiningLimits, error)

type MicroblockMiner

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

func NewMicroblockMiner

func NewMicroblockMiner(services services.Services, features Features, reward int64) *MicroblockMiner

func (*MicroblockMiner) MineKeyBlock added in v0.6.0

func (a *MicroblockMiner) MineKeyBlock(
	_ context.Context, t proto.Timestamp, k proto.KeyPair, parent proto.BlockID, baseTarget types.BaseTarget,
	gs []byte, _ []byte,
) (*proto.Block, proto.MiningLimits, error)

type Mine added in v0.8.0

type Mine interface {
	Mine() chan scheduler.Emit
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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