Documentation
¶
Index ¶
- Variables
- func Check(err error) bool
- func Debug(a ...interface{})
- func Debugc(fn func() string)
- func Debugf(format string, a ...interface{})
- func Debugs(a interface{})
- func Error(a ...interface{})
- func Errorc(fn func() string)
- func Errorf(format string, a ...interface{})
- func Errors(a interface{})
- func Fatal(a ...interface{})
- func Fatalc(fn func() string)
- func Fatalf(format string, a ...interface{})
- func Fatals(a interface{})
- func Info(a ...interface{})
- func Infoc(fn func() string)
- func Infof(format string, a ...interface{})
- func Infos(a interface{})
- func Trace(a ...interface{})
- func Tracec(fn func() string)
- func Tracef(format string, a ...interface{})
- func Traces(a interface{})
- func Warn(a ...interface{})
- func Warnc(fn func() string)
- func Warnf(format string, a ...interface{})
- func Warns(a interface{})
- type CoinBaseMap
- type CoinBases
- type Container
- func (j *Container) GetBitses() blockchain.TargetBits
- func (j *Container) GetControllerListenerPort() uint16
- func (j *Container) GetHashes() (out map[int32]*chainhash.Hash)
- 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) String() (s string)
- func (j *Container) Struct() (out Job)
- type Job
Constants ¶
This section is empty.
Variables ¶
var Magic = []byte{'w', 'o', 'r', 'k'}
Functions ¶
Types ¶
type CoinBaseMap ¶
type CoinBases ¶
type CoinBases struct { CoinBaseMap sync.Mutex }
func NewCoinBases ¶
func NewCoinBases() CoinBases
func (*CoinBases) Load ¶
func (cbs *CoinBases) Load() CoinBaseMap
func (*CoinBases) Store ¶
func (cbs *CoinBases) Store(cbm CoinBaseMap)
type Container ¶
type Container struct {
simplebuffer.Container
}
func Get ¶
func Get(cx *conte.Xt, mB *util.Block, msg simplebuffer.Serializers, cbs CoinBases) (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 ¶
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 (*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 blockchain.TargetBits Hashes map[int32]*chainhash.Hash CoinBases map[int32]*util.Tx }
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.