Documentation ¶
Index ¶
- Variables
- type Container
- func (j *Container) GetBitses() map[int32]uint32
- func (j *Container) GetControllerListenerPort() uint16
- func (j *Container) GetIPs() []*net.IP
- func (j *Container) GetNewHeight() (out int32)
- func (j *Container) GetP2PListenersPort() uint16
- func (j *Container) GetPrevBlockHash() (out *chainhash.Hash)
- func (j *Container) GetRPCListenersPort() uint16
- func (j *Container) GetTxs() (out []*wire.MsgTx)
- func (j *Container) String() (s string)
- func (j *Container) Struct() (out Job)
- type Job
Constants ¶
This section is empty.
Variables ¶
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 (*Container) GetControllerListenerPort ¶
func (*Container) GetNewHeight ¶
func (*Container) GetP2PListenersPort ¶
func (*Container) GetPrevBlockHash ¶
func (*Container) GetRPCListenersPort ¶
func (*Container) Struct ¶
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 ¶
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.