mining

package
v0.0.0-...-33416f3 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMinerAlreadyRunning = errors.New("miner is already running")
	ErrInvalidBlock        = errors.New("generated invalid block")
	ErrNoTransactions      = errors.New("no transactions available")
)
View Source
var (
	ErrMinerAlreadyRunning = errors.New("miner is already running")
	ErrInvalidBlock        = errors.New("generated invalid block")
	ErrNoTransactions      = errors.New("no transactions available")
)

Functions

This section is empty.

Types

type Miner

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

func NewMiner

func NewMiner(blockchain *core.Blockchain, mempool *mempool.TransactionPool, minerAddress string) *Miner

func (*Miner) GetMetrics

func (m *Miner) GetMetrics() (hashRate float64, blockTime float64, difficulty uint32)

func (*Miner) Start

func (m *Miner) Start(ctx context.Context) error

type ProofOfWork

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

func NewProofOfWork

func NewProofOfWork(block *core.Block) *ProofOfWork

func (*ProofOfWork) Mine

func (pow *ProofOfWork) Mine() (uint64, []byte)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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