47 lines
1.3 KiB
Go
47 lines
1.3 KiB
Go
package block
|
|
|
|
type StartMiningRequest struct {
|
|
MinerAddress string `json:"miner_address"`
|
|
Difficulty int `json:"difficulty"`
|
|
}
|
|
|
|
type SubmitMiningRequest struct {
|
|
MinerAddress string `json:"miner_address"`
|
|
Hash string `json:"hash"`
|
|
Nonce int64 `json:"nonce"`
|
|
PreviousHash *string `json:"previous_hash,omitempty"`
|
|
Timestamp int64 `json:"timestamp"`
|
|
}
|
|
|
|
type BlockResponse struct {
|
|
Hash string `json:"hash"`
|
|
PreviousHash *string `json:"previous_hash,omitempty"`
|
|
MerkleRoot string `json:"merkle_root"`
|
|
Timestamp int64 `json:"timestamp"`
|
|
Difficulty int `json:"difficulty"`
|
|
Nonce int64 `json:"nonce"`
|
|
MinerAddress string `json:"miner_address"`
|
|
Reward float64 `json:"reward"`
|
|
Height int `json:"height"`
|
|
TransactionCount int `json:"transaction_count"`
|
|
Confirmations int `json:"confirmations"`
|
|
}
|
|
|
|
type MiningStatsResponse struct {
|
|
MinerAddress string `json:"miner_address"`
|
|
TotalBlocksMined int `json:"total_blocks_mined"`
|
|
TotalRewardsEarned float64 `json:"total_rewards_earned"`
|
|
LastBlockMined *int64 `json:"last_block_mined,omitempty"`
|
|
CurrentDifficulty int `json:"current_difficulty"`
|
|
}
|
|
|
|
type MiningJobResponse struct {
|
|
JobId string `json:"job_id"`
|
|
Target string `json:"target"`
|
|
Difficulty int `json:"difficulty"`
|
|
PreviousHash string `json:"previous_hash"`
|
|
Height int `json:"height"`
|
|
Timestamp int64 `json:"timestamp"`
|
|
ExpiresAt int64 `json:"expires_at"`
|
|
}
|