job

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2019 License: Unlicense Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Container

type Container struct {
	simplebuffer.Container
}

func Get

func Get(cx *conte.Xt, mB *util.Block, msg simplebuffer.Serializers) (out Container)

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 All of the fields are in the same order that they will be serialized to

func LoadMinerContainer

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

func (*Container) GetBitses

func (j *Container) GetBitses() map[int32]uint32

func (*Container) GetControllerListenerPort

func (j *Container) GetControllerListenerPort() uint16

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) GetTxs

func (j *Container) GetTxs() (out []*wire.MsgTx)

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          map[int32]uint32
	Txs             []*wire.MsgTx
}

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