canic_host/subnet_catalog/view/
mod.rs1use serde::Serialize;
7use std::path::PathBuf;
8
9#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
16#[serde(tag = "phase", rename_all = "snake_case")]
17pub enum CatalogAcquisitionStage {
18 CacheLookup,
19 Collecting {
20 endpoint: String,
21 },
22 Collected {
23 endpoint: String,
24 registry_version: u64,
25 query_calls: u64,
26 },
27 Complete {
28 cache_disposition: String,
29 },
30}
31
32#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
39pub struct CatalogAcquisitionProgress {
40 pub stage: CatalogAcquisitionStage,
41 pub completed_endpoints: usize,
42 pub active_endpoints: Vec<String>,
43 pub registry: Vec<RegistryCollectionProgress>,
44 pub elapsed_seconds: u64,
45 pub deadline_seconds: u64,
46}
47
48#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
55pub struct SubnetCatalogObservation {
56 pub cache_path: PathBuf,
57 pub cache_disposition: String,
58 pub fetched_at: String,
59 pub observed_at_unix_secs: u64,
60 pub age_seconds: Option<u64>,
61 pub max_age_seconds: u64,
62 pub registry_version: u64,
63 pub catalog_digest: String,
64 pub assurance: String,
65 pub source_endpoints: Vec<String>,
66}
67
68#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
76pub struct RegistryCollectionProgress {
77 pub endpoint: String,
78 pub query_calls: u64,
79 pub stage: RegistryCollectionStage,
80}
81
82#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
90#[serde(tag = "phase", rename_all = "snake_case")]
91pub enum RegistryCollectionStage {
92 Started,
93 Pinned {
94 registry_version: u64,
95 },
96 History {
97 registry_version: u64,
98 through_version: u64,
99 reused: bool,
100 },
101 Record {
102 registry_version: u64,
103 key: String,
104 completed: bool,
105 },
106 Retry {
107 method: String,
108 next_attempt: u8,
109 delay_millis: u64,
110 },
111}