-
Notifications
You must be signed in to change notification settings - Fork 8
/
state.go
40 lines (35 loc) · 1.69 KB
/
state.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
38
39
40
package types
import (
"github.com/samber/mo"
)
// WebsocketBlockchainState is how blockchain_state comes across in the websockets (wrapped)
// https://github.com/Chia-Network/chia-blockchain/blob/main/chia/rpc/full_node_rpc_api.py#L123
type WebsocketBlockchainState struct {
BlockchainState BlockchainState `json:"blockchain_state"`
}
// BlockchainState blockchain state
// https://github.com/Chia-Network/chia-blockchain/blob/main/chia/rpc/full_node_rpc_api.py#L123
type BlockchainState struct {
Difficulty uint64 `json:"difficulty"`
GenesisChallengeInitialized bool `json:"genesis_challenge_initialized"`
MempoolSize uint64 `json:"mempool_size"`
MempoolCost uint64 `json:"mempool_cost"`
MempoolMinFees MempoolMinFees `json:"mempool_min_fees"`
MempoolMaxTotalCost uint64 `json:"mempool_max_total_cost"`
Peak mo.Option[BlockRecord] `json:"peak"`
Space Uint128 `json:"space"`
SubSlotIters uint64 `json:"sub_slot_iters"`
Sync Sync `json:"sync"`
BlockMaxCost uint64 `json:"block_max_cost"`
}
// MempoolMinFees minimum fees to get in the mempool at varying costs
type MempoolMinFees struct {
Cost5m float64 `json:"cost_5000000"`
}
// Sync struct within blockchain state
type Sync struct {
SyncMode bool `json:"sync_mode"`
SyncProgressHeight uint32 `json:"sync_progress_height"`
SyncTipHeight uint32 `json:"sync_tip_height"`
Synced bool `json:"synced"`
}