ic_query/subnet_catalog/
mod.rs1mod error;
2#[cfg(feature = "host")]
3mod host;
4mod json;
5mod model;
6mod principal;
7#[cfg(feature = "host")]
8mod report;
9mod resolver;
10#[cfg(feature = "host")]
11mod text;
12#[cfg(feature = "host")]
13mod time;
14
15pub use error::CatalogError;
16#[cfg(all(test, feature = "host"))]
17pub(crate) use host::refresh_subnet_catalog_with_source;
18#[cfg(feature = "host")]
19pub use host::{
20 CachedSubnetCatalog, SubnetCatalogCacheRequest, SubnetCatalogHostError,
21 SubnetCatalogRefreshRequest, load_cached_subnet_catalog, load_or_refresh_subnet_catalog,
22 refresh_subnet_catalog, subnet_catalog_path, subnet_catalog_refresh_lock_path,
23};
24#[cfg(feature = "host")]
25pub(crate) use host::{
26 LiveNnsRegistryRefreshSource, SubnetCatalogRefreshSource,
27 load_or_refresh_subnet_catalog_with_source,
28};
29pub use json::{catalog_to_pretty_json, parse_catalog_json};
30pub use model::{
31 ClassificationSource, GeographicScope, RoutingRange, SubnetCatalog, SubnetInfo, SubnetKind,
32 SubnetSpecialization,
33};
34pub use principal::canonical_principal_text;
35pub(crate) use principal::{parse_principal, principal_bytes};
36#[cfg(feature = "host")]
37pub(crate) use report::CatalogStaleStatus;
38#[cfg(all(test, feature = "host"))]
39pub(crate) use report::build_subnet_catalog_list_report_with_source;
40#[cfg(feature = "host")]
41pub use report::{
42 SubnetCatalogFilters, SubnetCatalogInfoReport, SubnetCatalogInfoRequest,
43 SubnetCatalogListReport, SubnetCatalogListRequest, SubnetCatalogRefreshReport,
44 SubnetCatalogSubnetRow, build_subnet_catalog_info_report, build_subnet_catalog_list_report,
45};
46pub use resolver::{ResolveAs, ResolvedSubnet, ResolvedSubnetSubject};
47#[cfg(all(test, feature = "host"))]
48pub(crate) use text::compact_principal;
49#[cfg(feature = "host")]
50pub use text::{
51 subnet_catalog_info_report_text, subnet_catalog_list_report_text,
52 subnet_catalog_list_report_verbose_text, subnet_catalog_refresh_report_text,
53};
54#[cfg(all(test, feature = "host"))]
55pub(crate) use time::parse_stale_after_duration;
56#[cfg(feature = "host")]
57pub(crate) use time::{catalog_stale_status, format_utc_timestamp_secs};
58
59pub const CATALOG_SCHEMA_VERSION: u32 = 1;
60pub const MAINNET_NETWORK: &str = "ic";
61pub const MAINNET_REGISTRY_CANISTER_ID: &str = "rwlgt-iiaaa-aaaaa-aaaaa-cai";
62#[cfg(feature = "host")]
63pub const DEFAULT_STALE_AFTER_SECONDS: u64 = 7 * 24 * 60 * 60;
64#[cfg(feature = "host")]
65pub const DEFAULT_REFRESH_LOCK_STALE_SECONDS: u64 = 30 * 60;
66#[cfg(feature = "host")]
67pub const DEFAULT_SUBNET_CATALOG_SOURCE_ENDPOINT: &str = "https://icp-api.io";
68#[cfg(feature = "host")]
69pub(crate) const SUBNET_CATALOG_LIST_REPORT_SCHEMA_VERSION: u32 = 1;
70#[cfg(feature = "host")]
71pub(crate) const SUBNET_CATALOG_INFO_REPORT_SCHEMA_VERSION: u32 = 1;
72#[cfg(feature = "host")]
73pub(crate) const SUBNET_CATALOG_REFRESH_REPORT_SCHEMA_VERSION: u32 = 1;
74
75#[cfg(test)]
76mod core_tests;
77#[cfg(all(test, feature = "host"))]
78mod tests;