worker

package
v0.0.2-0...-1c7e8a7 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: Unlicense Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const RoundsPerAlgo = 69

Variables

This section is empty.

Functions

func Check

func Check(err error) bool

func Debug

func Debug(a ...interface{})

func Debugc

func Debugc(fn func() string)

func Debugf

func Debugf(format string, a ...interface{})

func Debugs

func Debugs(a interface{})

func Error

func Error(a ...interface{})

func Errorc

func Errorc(fn func() string)

func Errorf

func Errorf(format string, a ...interface{})

func Errors

func Errors(a interface{})

func Fatal

func Fatal(a ...interface{})

func Fatalc

func Fatalc(fn func() string)

func Fatalf

func Fatalf(format string, a ...interface{})

func Fatals

func Fatals(a interface{})

func Info

func Info(a ...interface{})

func Infoc

func Infoc(fn func() string)

func Infof

func Infof(format string, a ...interface{})

func Infos

func Infos(a interface{})

func Trace

func Trace(a ...interface{})

func Tracec

func Tracec(fn func() string)

func Tracef

func Tracef(format string, a ...interface{})

func Traces

func Traces(a interface{})

func Warn

func Warn(a ...interface{})

func Warnc

func Warnc(fn func() string)

func Warnf

func Warnf(format string, a ...interface{})

func Warns

func Warns(a interface{})

Types

type Counter

type Counter struct {
	C             atomic.Int32
	Algos         atomic.Value // []int32
	RoundsPerAlgo atomic.Int32
	// contains filtered or unexported fields
}

func NewCounter

func NewCounter(roundsPerAlgo int32) (c *Counter)

NewCounter returns an initialized algorithm rolling counter that ensures each miner does equal amounts of every algorithm

func (*Counter) GetAlgoVer

func (c *Counter) GetAlgoVer() (ver int32)

GetAlgoVer returns the next algo version based on the current configuration

type Worker

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

func New

func New(id string, quit qu.C) (w *Worker, conn net.Conn)

New initialises the state for a worker, loading the work function handler that runs a round of processing between checking quit signal and work semaphore

func NewWithConnAndSemaphore

func NewWithConnAndSemaphore(id string, conn *stdconn.StdConn, quit qu.C) *Worker

NewWithConnAndSemaphore is exposed to enable use an actual network connection while retaining the same RPC API to allow a worker to be configured to run on a bare metal system with a different launcher main

func (*Worker) NewJob

func (w *Worker) NewJob(job *job.Container, reply *bool) (err error)

NewJob is a delivery of a new job for the worker, this makes the miner start mining from pause or pause, prepare the work and restart

func (*Worker) Pause

func (w *Worker) Pause(_ int, reply *bool) (err error)

Pause signals the worker to stop working, releases its semaphore and the worker is then idle

func (*Worker) SendPass

func (w *Worker) SendPass(pass string, reply *bool) (err error)

SendPass gives the encryption key configured in the kopach controller ( pod) configuration to allow workers to dispatch their solutions

func (*Worker) Stop

func (w *Worker) Stop(_ int, reply *bool) (err error)

Stop signals the worker to quit

Jump to

Keyboard shortcuts

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