miner

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DifficultyMetrics

type DifficultyMetrics struct {
	LeadingZeros     int64
	DifficultyNumber int64
}

type Manager

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

func GetManager

func GetManager() *Manager

func (*Manager) Reset

func (m *Manager) Reset()

func (*Manager) Start

func (m *Manager) Start(blockData common.BlockData)

func (*Manager) Stop

func (m *Manager) Stop()

type Miner

type Miner struct {
	Config *config.Config
	Logger *logging.Logger
	// contains filtered or unexported fields
}

func New

func New(waitGroup *sync.WaitGroup, resultChan chan Result, doneChan chan any, blockData common.BlockData) *Miner

func (*Miner) Start

func (m *Miner) Start()

type Result

type Result struct {
	BlockData common.BlockData
	Nonce     [16]byte
}

type State

type State struct {
	Nonce            [16]byte
	BlockNumber      int64
	CurrentHash      []byte
	LeadingZeros     int64
	DifficultyNumber int64
	EpochTime        int64
}

Jump to

Keyboard shortcuts

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