ic_query/subnet_catalog/
mod.rs1mod error;
4#[cfg(feature = "subnet-catalog-host")]
5mod host;
6mod json;
7mod model;
8mod principal;
9#[cfg(feature = "subnet-catalog-host")]
10mod report;
11mod resolver;
12#[cfg(feature = "subnet-catalog-host")]
13mod text;
14mod time;
15
16pub use error::CatalogError;
17#[cfg(feature = "subnet-catalog-host")]
18pub use host::{
19 CacheDisposition, CatalogAuthorityEvidence, CatalogLoadOutcome, CatalogReadPolicy,
20 CatalogSourceSelection, SubnetCatalogCacheRequest, SubnetCatalogErrorCategory,
21 SubnetCatalogErrorCode, SubnetCatalogHostError, SubnetCatalogLoadRequest,
22 SubnetCatalogRefreshRequest, SubnetCatalogRemediation, SubnetCatalogRetryability,
23 SubnetCatalogSource, SubnetCatalogSourceFuture, fetch_subnet_catalog_async,
24 load_cached_subnet_catalog, load_subnet_catalog, load_subnet_catalog_async,
25 load_subnet_catalog_with_source, load_subnet_catalog_with_source_async, refresh_subnet_catalog,
26 refresh_subnet_catalog_async, refresh_subnet_catalog_with_source,
27 refresh_subnet_catalog_with_source_async, subnet_catalog_path,
28 subnet_catalog_refresh_lock_path,
29};
30pub use json::{catalog_to_pretty_json, parse_catalog_json};
31#[cfg(feature = "subnet-catalog-host")]
32pub use model::UncertifiedCatalogCollection;
33#[cfg(feature = "subnet-catalog-host")]
34pub(in crate::subnet_catalog) use model::catalog_agreement_digest;
35pub use model::{
36 CLASSIFICATION_SCHEMA_VERSION, CatalogAssurance, CatalogValidationContext,
37 ClassificationSource, GeographicScope, RESOLVER_SCHEMA_VERSION, RawSubnetCatalog, RoutingRange,
38 SubnetCatalogProvenance, SubnetInfo, SubnetKind, SubnetSpecialization, ValidatedSubnetCatalog,
39};
40pub use principal::canonical_principal_text;
41pub(crate) use principal::{parse_principal, principal_bytes};
42#[cfg(feature = "subnet-catalog-host")]
43pub use report::{
44 CatalogStaleStatus, SubnetCatalogFilters, SubnetCatalogInfoReport, SubnetCatalogInfoRequest,
45 SubnetCatalogListReport, SubnetCatalogListRequest, SubnetCatalogRefreshReport,
46 SubnetCatalogSubnetRow, build_subnet_catalog_info_report,
47 build_subnet_catalog_info_report_with_source, build_subnet_catalog_list_report,
48 build_subnet_catalog_list_report_with_source,
49};
50pub use resolver::{ResolveAs, ResolvedCanisterRoute, ResolvedSubnet, ResolvedSubnetSubject};
51#[cfg(feature = "subnet-catalog-host")]
52pub use text::{
53 subnet_catalog_info_report_text, subnet_catalog_list_report_text,
54 subnet_catalog_list_report_verbose_text, subnet_catalog_refresh_report_text,
55};
56#[cfg(feature = "subnet-catalog-host")]
57pub use time::catalog_stale_status;
58pub(crate) use time::format_utc_timestamp_secs;
59#[cfg(any(
60 feature = "dashboard-host",
61 feature = "icrc-host",
62 feature = "sns-host",
63 feature = "subnet-catalog-host"
64))]
65pub(crate) use time::parse_utc_timestamp_secs;
66
67pub const CATALOG_SCHEMA_VERSION: u32 = 2;
68pub const MAINNET_NETWORK: &str = "ic";
69pub const MAINNET_REGISTRY_CANISTER_ID: &str = "rwlgt-iiaaa-aaaaa-aaaaa-cai";
70#[cfg(feature = "subnet-catalog-host")]
71pub const DEFAULT_CATALOG_MAX_FUTURE_SKEW_SECONDS: u64 = 5 * 60;
73#[cfg(feature = "subnet-catalog-host")]
74pub const DEFAULT_STALE_AFTER_SECONDS: u64 = 7 * 24 * 60 * 60;
75#[cfg(feature = "subnet-catalog-host")]
76pub const DEFAULT_REFRESH_LOCK_STALE_SECONDS: u64 = 30 * 60;
77#[cfg(feature = "subnet-catalog-host")]
78pub const DEFAULT_SUBNET_CATALOG_SOURCE_ENDPOINT: &str = "https://icp-api.io";
79#[cfg(feature = "subnet-catalog-host")]
80pub const MIN_SUBNET_CATALOG_AGREEMENT_ENDPOINTS: usize = 2;
82#[cfg(feature = "subnet-catalog-host")]
83pub const MAX_SUBNET_CATALOG_AGREEMENT_ENDPOINTS: usize = 3;
85#[cfg(feature = "subnet-catalog-host")]
86pub(crate) const SUBNET_CATALOG_LIST_REPORT_SCHEMA_VERSION: u32 = 2;
87#[cfg(feature = "subnet-catalog-host")]
88pub(crate) const SUBNET_CATALOG_INFO_REPORT_SCHEMA_VERSION: u32 = 2;
89#[cfg(feature = "subnet-catalog-host")]
90pub(crate) const SUBNET_CATALOG_REFRESH_REPORT_SCHEMA_VERSION: u32 = 2;
91
92#[cfg(test)]
93mod core_tests;
94#[cfg(all(test, feature = "subnet-catalog-host"))]
95mod tests;