ic_query/nns/node/report/
mod.rs1#[cfg(feature = "host")]
2mod build;
3#[cfg(feature = "host")]
4mod cache;
5#[cfg(feature = "host")]
6mod filters;
7mod model;
8#[cfg(feature = "host")]
9mod refresh;
10#[cfg(feature = "host")]
11mod resolve;
12#[cfg(feature = "host")]
13mod source;
14mod text;
15
16#[cfg(feature = "host")]
17use crate::nns::NnsInventoryRefreshRequest;
18#[cfg(feature = "host")]
19use crate::nns::{NnsInventoryCacheRequest, NnsInventoryInfoRequest};
20
21#[cfg(feature = "host")]
22pub use build::{
23 build_nns_node_info_report, build_nns_node_info_report_with_source, build_nns_node_list_report,
24 build_nns_node_list_report_with_source,
25};
26#[cfg(feature = "host")]
27pub use cache::{nns_node_cache_path, nns_node_refresh_lock_path};
28#[cfg(all(test, feature = "host"))]
29use filters::filter_node_list_report;
30#[cfg(feature = "host")]
31pub use refresh::{refresh_nns_node_report, refresh_nns_node_report_with_source};
32#[cfg(all(test, feature = "host"))]
33use resolve::resolve_node;
34#[cfg(feature = "host")]
35pub use source::NnsNodeSource;
36
37#[cfg(feature = "host")]
38pub use model::{NnsNodeHostError, NnsNodeRefreshReport};
39pub use model::{
40 NnsNodeInfoReport, NnsNodeListFilters, NnsNodeListReport, NnsNodeListRequest, NnsNodeRow,
41};
42#[cfg(feature = "host")]
43pub use text::nns_node_refresh_report_text;
44pub use text::{
45 nns_node_info_report_text, nns_node_list_report_text, nns_node_list_report_verbose_text,
46};
47
48pub const DEFAULT_NNS_NODE_SOURCE_ENDPOINT: &str = "https://icp-api.io";
49#[cfg(feature = "host")]
50pub const DEFAULT_NODE_REFRESH_LOCK_STALE_SECONDS: u64 = 30 * 60;
51#[cfg(feature = "host")]
52pub const NNS_NODE_LIST_REPORT_SCHEMA_VERSION: u32 = 1;
53#[cfg(feature = "host")]
54pub const NNS_NODE_INFO_REPORT_SCHEMA_VERSION: u32 = 1;
55#[cfg(feature = "host")]
56pub const NNS_NODE_REFRESH_REPORT_SCHEMA_VERSION: u32 = 1;
57pub const NNS_NODE_SUBNET_KIND_APPLICATION: &str = "application";
58pub const NNS_NODE_SUBNET_KIND_CLOUD_ENGINE: &str = "cloud_engine";
59pub const NNS_NODE_SUBNET_KIND_SYSTEM: &str = "system";
60pub const NNS_NODE_SUBNET_KIND_UNKNOWN: &str = "unknown";
61#[cfg(feature = "host")]
62const NNS_NODE_CACHE_DIR: &str = "node";
63#[cfg(feature = "host")]
64const NNS_NODE_CACHE_FILE: &str = "nodes.json";
65
66#[cfg(feature = "host")]
67impl_nns_mainnet_network_enforcer!(NnsNodeHostError);
68
69#[cfg(all(test, feature = "host"))]
70mod tests;