184 lines
6.9 KiB
Go
184 lines
6.9 KiB
Go
// msg.go
|
|
package msg
|
|
|
|
import (
|
|
"encoding/json"
|
|
"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, omitemtpy"`
|
|
}
|
|
|
|
type NexaStratumJob struct {
|
|
Header string `json:"header, omitempty"`
|
|
NBits string `json:"nBits, omitempty"`
|
|
Id uint64 `json:"id, omitempty"`
|
|
CurTime uint64 `json:"timestamp, omitemtpy"`
|
|
Target string `json:"target, omitempty"`
|
|
Height uint32 `json:"height, omitemtpy"`
|
|
Nonce string `json:"nonce, omitemtpy"`
|
|
Extranonce1 string `json:"extranonce1, omitemtpy"`
|
|
Extranonce2_size uint64 `json:"extranonce2_size, omitemtpy"`
|
|
Extranonce2 string `json:"extranonce2, omitemtpy"`
|
|
JobDifficulty float64 `json:"diff, omitemtpy"`
|
|
}
|
|
|
|
type EnxStratumJob struct {
|
|
Job_id uint32 `json:"job_id, omitemtpy"`
|
|
CurTime uint64 `json:"timestamp, omitemtpy"`
|
|
PrevBlockHash string `json:"prev_hash, omitemtpy"`
|
|
Target string `json:"target, omitempty"`
|
|
Height uint64 `json:"height, omitemtpy"`
|
|
Nonce string `json:"nonce, omitemtpy"`
|
|
Extranonce1 string `json:"extranonce1, omitemtpy"`
|
|
Extranonce2_size uint64 `json:"extranonce2_size, omitemtpy"`
|
|
Extranonce2 string `json:"extranonce2, omitemtpy"`
|
|
Bits uint32 `json:"bits, omitemtpy"`
|
|
Data string `json:"data, omitemtpy"`
|
|
Gbt_id uint32 `json:"gbt_id, omitemtpy"`
|
|
}
|
|
|
|
type AlphStratumJob struct {
|
|
JobId string `json:"jobId, omitempty"`
|
|
FromGroup uint32 `json:"fromGroup, omitempty"`
|
|
ToGroup uint32 `json:"toGroup, omitempty"`
|
|
HeaderBlob string `json:"headerBlob, omitempty"`
|
|
TxsBlob string `json:"txsBlob, omitempty"`
|
|
Height uint32 `json:"height, omitempty"`
|
|
TargetBlob string `json:"targetBlob, omitempty"`
|
|
JobDifficulty float64 `json:"diff, omitemtpy"`
|
|
Nonce string `json:"nonce, omitempty"`
|
|
Extranonce1 string `json:"extranonce1, omitempty"`
|
|
Extranonce2_size uint64 `json:"extranonce2_size, omitemtpy"`
|
|
}
|
|
|
|
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 BlockAlphMsg struct {
|
|
Id string `json:"id"`
|
|
User string `json:"user"`
|
|
Miner string `json:"miner"`
|
|
Index string `json:"index"`
|
|
FromGroup uint32 `json:"fromGroup"`
|
|
ToGroup uint32 `json:"toGroup"`
|
|
Header string `json:"header"`
|
|
Nonce string `json:"nonce"`
|
|
Txs string `json:"txs"`
|
|
Hash string `json:"hash"`
|
|
SubIdx int64 `json:"subidx"`
|
|
}
|
|
|
|
type BlockEnxMsg 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 GbtMsg struct {
|
|
Capabilities []string `json:"capabilities"`
|
|
Version int32 `json:"version"`
|
|
Rules []string `json:"rules"`
|
|
Vbavailable *json.RawMessage `json:"vbavailble"`
|
|
Vbrequired int `json:"varequired"`
|
|
Previousblockhash string `json:"previousblockhash"`
|
|
Transactions *[]json.RawMessage `json:"transactions"`
|
|
Coinbaseaux *json.RawMessage `json:"coinbaseaux"`
|
|
Coinbasevalue uint64 `json:"coinbasevalue"`
|
|
Coinbasetxn *json.RawMessage `json:"coinbasetxn"`
|
|
Longpollid string `json:"longpollid"`
|
|
Target string `json:"target"`
|
|
Mintime uint32 `json:"mintime"`
|
|
Mutable []string `json:"mutable"`
|
|
Noncerange string `json:"noncerange"`
|
|
sigoplimit uint32 `json:"sigolimit"`
|
|
Sizelimit uint32 `json:"sizelimit"`
|
|
Curtime uint32 `json:"curtime"`
|
|
Bits string `json:"bits"`
|
|
Height uint32 `json:"height"`
|
|
//Masternode MasterNode `json:"masternode"`
|
|
//Superblocks []SuperBlocks `json:"superblock"`
|
|
Coinbase *json.RawMessage `json:"coinbase"`
|
|
Segwit string `json:"default_witness_commitment"`
|
|
PoolSource string `json:"poolsource"`
|
|
}
|
|
|
|
type GbtTransaction struct {
|
|
Data string `json:"data"`
|
|
Hash string `json:"hash"`
|
|
Depends *[]json.RawMessage `json:"depends"`
|
|
Fee int `json:"fee"`
|
|
Sigops int `json:"sigops"`
|
|
Txid string `json:"txid"`
|
|
}
|
|
|
|
type BlockGrsMsg struct {
|
|
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"`
|
|
|
|
Data []byte `json:"data"`
|
|
}
|
|
|
|
type GetBlockHeaderMsg struct {
|
|
Height int `json:"height"`
|
|
Nonce string `json:"nonce"`
|
|
Confirmations int `json:"confirmations"`
|
|
}
|
|
|
|
type GetBlockHeaderMsgInt struct {
|
|
Height int `json:"height"`
|
|
Nonce uint32 `json:"nonce"`
|
|
Confirmations int `json:"confirmations"`
|
|
}
|
|
|
|
type GetBlockStatsMsg struct {
|
|
Height int `json:"height"`
|
|
Subsidy float64 `json:"subsidy"`
|
|
Totalfee float64 `json:"totalfee"`
|
|
}
|