job

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: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Magic = []byte{'w', 'o', 'r', 'k'}

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 Container

type Container struct {
	simplebuffer.Container
}

func Get

func Get(cx *conte.Xt, mB *util.Block, msg simplebuffer.Serializers, cbs *map[int32]*util.Tx) (
	out Container,
	txr []*util.Tx,
)

Get returns a message broadcast by a node and each field is decoded where possible avoiding memory allocation (slicing the data). Yes, this is not concurrent safe, put a mutex in to share it. Using the same principles as used in FlatBuffers, we define a message type that instead of using a reflect based encoder, there is a creation function, and a set of methods that extracts the individual requested field without copying memory, or deserialize their contents which will be concurrent safe The varying coinbase payment values are in transaction 0 last output, the individual varying transactions are stored separately and will be reassembled at the end

func LoadContainer

func LoadContainer(b []byte) (out Container)

LoadContainer takes a message byte slice payload and loads it into a container ready to be decoded

func (*Container) GetBitses

func (j *Container) GetBitses() blockchain.TargetBits

func (*Container) GetControllerListenerPort

func (j *Container) GetControllerListenerPort() uint16

func (*Container) GetHashes

func (j *Container) GetHashes() (out map[int32]*chainhash.Hash)

GetHashes returns the merkle roots per version

func (*Container) GetIPs

func (j *Container) GetIPs() []*net.IP

func (*Container) GetNewHeight

func (j *Container) GetNewHeight() (out int32)

func (*Container) GetP2PListenersPort

func (j *Container) GetP2PListenersPort() uint16

func (*Container) GetPrevBlockHash

func (j *Container) GetPrevBlockHash() (out *chainhash.Hash)

func (*Container) GetRPCListenersPort

func (j *Container) GetRPCListenersPort() uint16

func (*Container) String

func (j *Container) String() (s string)

func (*Container) Struct

func (j *Container) Struct() (out Job)

Struct returns a handy Go struct version This can be used at the start of a new block to get a handy struct, the first work received triggers startup and locks the worker into sending solutions there, until there is a new PrevBlockHash, the work controller (kopach) only responds to updates from this first one (or if it stops sending) - the controller keeps track of individual controller servers multicasting and when it deletes a newly gone dark controller when it comes to send if it isn't found it falls back to the next available to submit

type Job

type Job struct {
	IPs             []*net.IP
	P2PListenerPort uint16
	RPCListenerPort uint16
	SubmitPort      uint16
	Height          int32
	PrevBlockHash   *chainhash.Hash
	Bitses          blockchain.TargetBits
	Hashes          map[int32]*chainhash.Hash
	CoinBases       map[int32]*util.Tx
}

func (*Job) GetMsgBlock

func (j *Job) GetMsgBlock(version int32) (out *wire.MsgBlock)

GetMsgBlock takes the handy go struct version and returns a wire.MsgBlock ready for giving nonce extranonce and computing the merkel root based on the extranonce in the coinbase as needs to be done when mining, so this would be called for each round for each algorithm to start.

Jump to

Keyboard shortcuts

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