142 lines
5.5 KiB
Go
142 lines
5.5 KiB
Go
|
// msg.go
|
||
|
package msg
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
|
||
|
"github.com/decred/dcrd/chaincfg/chainhash"
|
||
|
)
|
||
|
|
||
|
type StratumJob struct {
|
||
|
Job_id string `json:"job_id, omitemtpy"`
|
||
|
Version int32 `json:"version, omitemtpy"`
|
||
|
Prevblock chainhash.Hash `json:"prevblock, omitemtpy"`
|
||
|
Coinbase1 string `json:"coinbase1, omitemtpy"`
|
||
|
Coinbase2 string `json:"coinbase2, omitemtpy"`
|
||
|
Bits uint32 `json:"bits, omitemtpy"`
|
||
|
Timestamp time.Time `json:"ts, omitemtpy"`
|
||
|
Extranonce1 string `json:"extranonce1, omitemtpy"`
|
||
|
Extranonce2_size uint64 `json:"extranonce2_size, omitemtpy"`
|
||
|
Extranonce2 string `json:"extranonce2, omitemtpy"`
|
||
|
Nonce string `json:"nonce, omitemtpy`
|
||
|
Target string `json:"target, omitemtpy"`
|
||
|
Difficulty float64 `json:"difficulty, omitemtpy"`
|
||
|
PrevblockS string `json:"prevblocks,omitempty"`
|
||
|
PrevblockBig string `json:"prevblockbig,omitempty"`
|
||
|
Transactions *[]string `json:"transactions,omitempty"`
|
||
|
BitsS string `json:"bitss,omitempty"`
|
||
|
Height uint32 `json:"height,omitempty"`
|
||
|
TransData *[]string `json:"data,omitempty"`
|
||
|
Payloadstart string `json:"payloadstart,omitempty"`
|
||
|
TimestampS string `json:"timestamps, omitempty"`
|
||
|
Segwit string `json:"default_witness_commitment, omitempty"`
|
||
|
IsClean bool `json:"isclean, omitempty"`
|
||
|
Mintime uint32 `json:"mintime, omitempty"`
|
||
|
JobDifficulty float64 `json:"diff, omitempty"`
|
||
|
}
|
||
|
|
||
|
type NexaStratumJob struct {
|
||
|
Header string `json:"header, omitempty"`
|
||
|
NBits string `json:"nBits, omitempty"`
|
||
|
Id uint64 `json:"id, omitempty"`
|
||
|
CurTime uint64 `json:"timestamp, omitempty"`
|
||
|
Target string `json:"target, omitempty"`
|
||
|
Height uint32 `json:"height, omitempty"`
|
||
|
Nonce string `json:"nonce, omitempty"`
|
||
|
Extranonce1 string `json:"extranonce1, omitempty"`
|
||
|
Extranonce2_size uint64 `json:"extranonce2_size, omitempty"`
|
||
|
Extranonce2 string `json:"extranonce2, omitempty"`
|
||
|
JobDifficulty float64 `json:"diff, omitempty"`
|
||
|
}
|
||
|
|
||
|
type BlockNexaMsg struct {
|
||
|
Id uint64 `json:"id"`
|
||
|
User string `json:"user"`
|
||
|
Miner string `json:"miner"`
|
||
|
Index string `json:"index"`
|
||
|
Header string `json:"header"`
|
||
|
Nonce string `json:"nonce"`
|
||
|
Pow string `json:"pow"`
|
||
|
SubIdx int64 `json:"subidx"`
|
||
|
}
|
||
|
|
||
|
type Sha3xStratumJob struct {
|
||
|
Header string `json:"header, omitempty"`
|
||
|
NBits string `json:"nBits, omitempty"`
|
||
|
Id uint64 `json:"id, omitempty"`
|
||
|
CurTime uint64 `json:"timestamp, omitempty"`
|
||
|
Target string `json:"target, omitempty"`
|
||
|
Height uint32 `json:"height, omitempty"`
|
||
|
Nonce string `json:"nonce, omitempty"`
|
||
|
Extranonce1 string `json:"extranonce1, omitempty"`
|
||
|
Extranonce2_size uint64 `json:"extranonce2_size, omitempty"`
|
||
|
Extranonce2 string `json:"extranonce2, omitempty"`
|
||
|
JobDifficulty float64 `json:"diff, omitempty"`
|
||
|
U64target uint64 `json:"u64target, omitempty"`
|
||
|
}
|
||
|
|
||
|
type BlockSha3xMsg struct {
|
||
|
Id uint64 `json:"id"`
|
||
|
User string `json:"user"`
|
||
|
Miner string `json:"miner"`
|
||
|
Index string `json:"index"`
|
||
|
Header string `json:"header"`
|
||
|
Nonce uint64 `json:"nonce"`
|
||
|
Pow string `json:"pow"`
|
||
|
SubIdx int64 `json:"subidx"`
|
||
|
Height uint64 `json:"height"`
|
||
|
SubmitIdx uint64 `json:"submitidx"`
|
||
|
}
|
||
|
|
||
|
type MonoreBlockTemplate struct {
|
||
|
BlockhashingBlob string `json:"blockhashing_blob"`
|
||
|
BlocktemplateBlob string `json:"blocktemplate_blob"`
|
||
|
Difficulty uint64 `json:"difficulty"`
|
||
|
DiffcultyTop64 uint64 `json:"difficulty_top64"`
|
||
|
ExpectedReward uint64 `json:"expected_reward"`
|
||
|
Height uint64 `json:"height"`
|
||
|
NextSeedHash string `json:"next_seed_hash"`
|
||
|
PrevHash string `json:"prev_hash"`
|
||
|
ReservedOffset uint64 `json:"reserved_offset"`
|
||
|
SeedHash string `json:"seed_hash"`
|
||
|
SeedHeight uint64 `json:"seed_height"`
|
||
|
Status string `json:"status"`
|
||
|
Untrusted bool `json:"untrusted"`
|
||
|
WideDifficulty string `json:"wide_difficulty"`
|
||
|
}
|
||
|
|
||
|
type MoneroStratumJob struct {
|
||
|
Id uint64 `json:"id"`
|
||
|
JobId string `json:"job_id"`
|
||
|
BlockhashingBlob string `json:"blockhashing_blob"`
|
||
|
BlocktemplateBlob string `json:"blocktemplate_blob"`
|
||
|
Difficulty uint64 `json:"difficulty"`
|
||
|
DiffcultyTop64 uint64 `json:"difficulty_top64"`
|
||
|
ExpectedReward uint64 `json:"expected_reward"`
|
||
|
Height uint64 `json:"height"`
|
||
|
NextSeedHash string `json:"next_seed_hash"`
|
||
|
PrevHash string `json:"prev_hash"`
|
||
|
ReservedOffset uint64 `json:"reserved_offset"`
|
||
|
SeedHash string `json:"seed_hash"`
|
||
|
SeedHeight uint64 `json:"seed_height"`
|
||
|
Status string `json:"status"`
|
||
|
Untrusted bool `json:"untrusted"`
|
||
|
WideDifficulty string `json:"wide_difficulty"`
|
||
|
Target string `json:"target"`
|
||
|
Nonce string `json:"nonce"`
|
||
|
CompleteHeader []byte `json:"completeHeader"`
|
||
|
}
|
||
|
|
||
|
type BlockMoneroMsg struct {
|
||
|
Id uint64 `json:"id"`
|
||
|
User string `json:"user"`
|
||
|
Miner string `json:"miner"`
|
||
|
Index string `json:"index"`
|
||
|
Header string `json:"header"`
|
||
|
Nonce string `json:"nonce"`
|
||
|
Pow string `json:"pow"`
|
||
|
SubIdx int64 `json:"subidx"`
|
||
|
Height uint64 `json:"height"`
|
||
|
SubmitIdx uint64 `json:"submitidx"`
|
||
|
}
|