Skip to main content

ic_query/nns/node/report/
mod.rs

1#[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")]
17pub use build::{
18    build_nns_node_info_report, build_nns_node_info_report_with_source, build_nns_node_list_report,
19    build_nns_node_list_report_with_source,
20};
21#[cfg(feature = "host")]
22pub use cache::{nns_node_cache_path, nns_node_refresh_lock_path};
23#[cfg(all(test, feature = "host"))]
24use filters::filter_node_list_report;
25#[cfg(feature = "host")]
26pub use refresh::{refresh_nns_node_report, refresh_nns_node_report_with_source};
27#[cfg(all(test, feature = "host"))]
28use resolve::resolve_node;
29#[cfg(feature = "host")]
30pub use source::{LiveNnsNodeSource, NnsNodeSource, NnsNodeSourceRequest};
31
32pub use model::{
33    NnsNodeCacheRequest, NnsNodeInfoReport, NnsNodeInfoRequest, NnsNodeListFilters,
34    NnsNodeListReport, NnsNodeListRequest, NnsNodeRow,
35};
36#[cfg(feature = "host")]
37pub use model::{NnsNodeHostError, NnsNodeRefreshReport, NnsNodeRefreshRequest};
38#[cfg(feature = "host")]
39pub use text::nns_node_refresh_report_text;
40pub use text::{
41    nns_node_info_report_text, nns_node_list_report_text, nns_node_list_report_verbose_text,
42};
43
44pub const DEFAULT_NNS_NODE_SOURCE_ENDPOINT: &str = "https://icp-api.io";
45#[cfg(feature = "host")]
46pub const DEFAULT_NODE_REFRESH_LOCK_STALE_SECONDS: u64 = 30 * 60;
47#[cfg(feature = "host")]
48pub const NNS_NODE_LIST_REPORT_SCHEMA_VERSION: u32 = 1;
49#[cfg(feature = "host")]
50pub const NNS_NODE_INFO_REPORT_SCHEMA_VERSION: u32 = 1;
51#[cfg(feature = "host")]
52pub const NNS_NODE_REFRESH_REPORT_SCHEMA_VERSION: u32 = 1;
53pub const NNS_NODE_SUBNET_KIND_APPLICATION: &str = "application";
54pub const NNS_NODE_SUBNET_KIND_CLOUD_ENGINE: &str = "cloud_engine";
55pub const NNS_NODE_SUBNET_KIND_SYSTEM: &str = "system";
56pub const NNS_NODE_SUBNET_KIND_UNKNOWN: &str = "unknown";
57#[cfg(feature = "host")]
58const NNS_NODE_CACHE_DIR: &str = "node";
59#[cfg(feature = "host")]
60const NNS_NODE_CACHE_FILE: &str = "nodes.json";
61
62#[cfg(feature = "host")]
63impl_nns_mainnet_network_enforcer!(NnsNodeHostError);
64
65#[cfg(all(test, feature = "host"))]
66mod tests;