-
Notifications
You must be signed in to change notification settings - Fork 8
/
farmer.go
37 lines (33 loc) · 1.87 KB
/
farmer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package types
import (
"github.com/samber/mo"
)
// EventFarmerSubmittedPartial is the event data for `submitted_partial` from the farmer
// https://github.com/Chia-Network/chia-blockchain/blob/main/chia/farmer/farmer_api.py#L270
type EventFarmerSubmittedPartial struct {
LauncherID Bytes32 `json:"launcher_id"`
PoolURL string `json:"pool_url"`
CurrentDifficulty uint64 `json:"current_difficulty"` // https://github.com/Chia-Network/chia-blockchain/blob/main/chia/protocols/pool_protocol.py#L97
PointsAcknowledgedSinceStart uint64 `json:"points_acknowledged_since_start"`
}
// EventFarmerProof is the farmer event `proof`
// https://github.com/Chia-Network/chia-blockchain/blob/main/chia/farmer/farmer_api.py#L367
type EventFarmerProof struct {
Proof DeclareProofOfSpace `json:"proof"`
PassedFilter bool `json:"passed_filter"`
}
// DeclareProofOfSpace matches to the farmer protocol type
// https://github.com/Chia-Network/chia-blockchain/blob/main/chia/protocols/farmer_protocol.py#L33
// @TODO Streamable
type DeclareProofOfSpace struct {
ChallengeHash Bytes32 `json:"challenge_hash"`
ChallengeChainSP Bytes32 `json:"challenge_chain_sp"`
SignagePointIndex uint8 `json:"signage_point_index"`
RewardChainSP Bytes32 `json:"reward_chain_sp"`
ProofOfSpace ProofOfSpace `json:"proof_of_space"`
ChallengeChainSPSignature G2Element `json:"challenge_chain_sp_signature"`
RewardChainSPSignature G2Element `json:"reward_chain_sp_signature"`
FarmerPuzzleHash Bytes32 `json:"farmer_puzzle_hash"`
PoolTarget mo.Option[PoolTarget] `json:"pool_target,omitempty"`
PoolSignature mo.Option[G2Element] `json:"pool_signature,omitempty"`
}