Skip to main content

ic_query/nns/node_provider/report/
mod.rs

1#[cfg(feature = "host")]
2mod build;
3#[cfg(feature = "host")]
4mod cache;
5mod model;
6#[cfg(feature = "host")]
7mod refresh;
8#[cfg(feature = "host")]
9mod resolve;
10#[cfg(feature = "host")]
11mod source;
12mod text;
13
14#[cfg(feature = "host")]
15pub use build::{build_nns_node_provider_info_report, build_nns_node_provider_list_report};
16#[cfg(all(test, feature = "host"))]
17use build::{
18    build_nns_node_provider_info_report_with_source,
19    build_nns_node_provider_list_report_with_source,
20};
21#[cfg(feature = "host")]
22pub use cache::{nns_node_provider_cache_path, nns_node_provider_refresh_lock_path};
23#[cfg(feature = "host")]
24pub use refresh::refresh_nns_node_provider_report;
25#[cfg(all(test, feature = "host"))]
26use refresh::refresh_nns_node_provider_report_with_source;
27#[cfg(all(test, feature = "host"))]
28use resolve::resolve_node_provider;
29#[cfg(all(test, feature = "host"))]
30use source::NnsNodeProviderSource;
31
32#[cfg(all(test, feature = "host"))]
33use crate::ic_registry::{MainnetNodeProviderList, MainnetRegistryFetchRequest};
34
35pub use model::{
36    NnsNodeProviderCacheRequest, NnsNodeProviderInfoReport, NnsNodeProviderInfoRequest,
37    NnsNodeProviderListReport, NnsNodeProviderListRequest, NnsNodeProviderRow,
38};
39#[cfg(feature = "host")]
40pub use model::{
41    NnsNodeProviderHostError, NnsNodeProviderRefreshReport, NnsNodeProviderRefreshRequest,
42};
43#[cfg(feature = "host")]
44pub use text::nns_node_provider_refresh_report_text;
45pub use text::{
46    nns_node_provider_info_report_text, nns_node_provider_list_report_text,
47    nns_node_provider_list_report_verbose_text,
48};
49
50pub const DEFAULT_NNS_SOURCE_ENDPOINT: &str = "https://icp-api.io";
51#[cfg(feature = "host")]
52pub const DEFAULT_NODE_PROVIDER_REFRESH_LOCK_STALE_SECONDS: u64 = 30 * 60;
53#[cfg(feature = "host")]
54pub const NNS_NODE_PROVIDER_LIST_REPORT_SCHEMA_VERSION: u32 = 1;
55#[cfg(feature = "host")]
56pub const NNS_NODE_PROVIDER_INFO_REPORT_SCHEMA_VERSION: u32 = 1;
57#[cfg(feature = "host")]
58pub const NNS_NODE_PROVIDER_REFRESH_REPORT_SCHEMA_VERSION: u32 = 1;
59#[cfg(feature = "host")]
60const NNS_NODE_PROVIDER_CACHE_DIR: &str = "node-provider";
61#[cfg(feature = "host")]
62const NNS_NODE_PROVIDER_CACHE_FILE: &str = "providers.json";
63
64#[cfg(feature = "host")]
65impl_nns_mainnet_network_enforcer!(NnsNodeProviderHostError);
66
67#[cfg(all(test, feature = "host"))]
68mod tests;