cpuminer

package module
v0.0.0-...-d7099a7 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

Package cpuminer is a port(-ish) of the orginal cpuminer project, written by Jeff Garzik and pooler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Routines          int // Number of miner routines to run. Defaults to 1.
	CoinbaseAddress   string
	CoinbaseSignature string

	// Maximum time to spend scanning the current work. Defaults to 1 minute.
	ScanTime time.Duration

	RpcURL      string
	Credentials Credentials
}

type Credentials

type Credentials func() (user, pass string, err error)

Credentials resolves the basic-auth pair for Core's RPC on each call. Core rewrites its cookie on every restart, so pinning a pair captured when mining started would 401 after the first restart.

func StaticCredentials

func StaticCredentials(user, pass string) Credentials

StaticCredentials returns a resolver that always yields the same pair.

type Miner

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

func New

func New(cfg Config) (*Miner, error)

func (*Miner) AcceptedBlocks

func (m *Miner) AcceptedBlocks() <-chan chainhash.Hash

func (*Miner) GetHashes

func (m *Miner) GetHashes() uint64

GetHashes returns the total number of hashes performed by the miner

func (*Miner) Start

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

type Work

type Work struct {
	Target *big.Int

	Height int
	Txs    string
	WorkID string

	JobID string
	// contains filtered or unexported fields
}

Work represents a unit of mining work

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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