1mod 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(crate) use host::subject_from_catalog_error;
19#[cfg(feature = "subnet-catalog-host")]
20pub use host::{
21 CacheDisposition, CatalogAuthorityEvidence, CatalogLoadOutcome, CatalogReadPolicy,
22 CatalogSourceSelection, SubnetCatalogCacheRequest, SubnetCatalogDetailedSourceFuture,
23 SubnetCatalogErrorCategory, SubnetCatalogErrorCode, SubnetCatalogFailureCacheDisposition,
24 SubnetCatalogField, SubnetCatalogHostError, SubnetCatalogLoadFailure,
25 SubnetCatalogLoadFailureRequest, SubnetCatalogLoadRequest, SubnetCatalogLoadStage,
26 SubnetCatalogRefreshRequest, SubnetCatalogRefreshTrigger, SubnetCatalogRemediation,
27 SubnetCatalogRetryability, SubnetCatalogSource, SubnetCatalogSourceFailure,
28 SubnetCatalogSourceFuture, SubnetCatalogSubject, SubnetCatalogUnknownRetryReason,
29 fetch_subnet_catalog_async, load_cached_subnet_catalog, load_cached_subnet_catalog_detailed,
30 load_subnet_catalog, load_subnet_catalog_async, load_subnet_catalog_detailed,
31 load_subnet_catalog_detailed_async, load_subnet_catalog_detailed_with_source,
32 load_subnet_catalog_detailed_with_source_async, load_subnet_catalog_with_source,
33 load_subnet_catalog_with_source_async, refresh_subnet_catalog, refresh_subnet_catalog_async,
34 refresh_subnet_catalog_with_source, refresh_subnet_catalog_with_source_async,
35 subnet_catalog_path, subnet_catalog_refresh_lock_path,
36};
37pub use json::{catalog_to_pretty_json, parse_catalog_json};
38#[cfg(feature = "subnet-catalog-host")]
39pub use model::UncertifiedCatalogCollection;
40#[cfg(feature = "certified-subnet-catalog-host")]
41pub(crate) use model::canonicalize_subnet_catalog_content;
42#[cfg(feature = "subnet-catalog-host")]
43pub(in crate::subnet_catalog) use model::catalog_agreement_digest;
44pub use model::{
45 CLASSIFICATION_SCHEMA_VERSION, CatalogAssurance, CatalogValidationContext,
46 CertifiedRegistryCatalogEvidence, ClassificationSource, GeographicScope,
47 RESOLVER_SCHEMA_VERSION, RawSubnetCatalog, RoutingRange, SubnetCatalogProvenance,
48 SubnetCatalogRegistryRecordEvidence, SubnetCatalogRegistryRecordKind,
49 SubnetCatalogRegistryRecordSubject, SubnetCatalogRegistryValueEncoding,
50 SubnetCatalogRoutingSource, SubnetInfo, SubnetKind, SubnetSpecialization,
51 ValidatedSubnetCatalog,
52};
53pub use principal::canonical_principal_text;
54pub(crate) use principal::{parse_principal, principal_bytes};
55#[cfg(feature = "subnet-catalog-host")]
56pub use report::{
57 CatalogStaleStatus, SubnetCatalogFilters, SubnetCatalogInfoReport, SubnetCatalogInfoRequest,
58 SubnetCatalogListReport, SubnetCatalogListRequest, SubnetCatalogRefreshReport,
59 SubnetCatalogSubnetRow, build_subnet_catalog_info_report,
60 build_subnet_catalog_info_report_with_source, build_subnet_catalog_list_report,
61 build_subnet_catalog_list_report_with_source,
62};
63pub use resolver::{ResolveAs, ResolvedCanisterRoute, ResolvedSubnet, ResolvedSubnetSubject};
64#[cfg(feature = "subnet-catalog-host")]
65pub use text::{
66 subnet_catalog_info_report_text, subnet_catalog_list_report_text,
67 subnet_catalog_list_report_verbose_text, subnet_catalog_refresh_report_text,
68};
69#[cfg(feature = "subnet-catalog-host")]
70pub use time::catalog_stale_status;
71pub(crate) use time::format_utc_timestamp_secs;
72#[cfg(any(
73 feature = "dashboard-host",
74 feature = "icrc-host",
75 feature = "sns-host",
76 feature = "subnet-catalog-host"
77))]
78pub(crate) use time::parse_utc_timestamp_secs;
79
80pub const CATALOG_SCHEMA_VERSION: u32 = 1;
81pub const MAINNET_NETWORK: &str = "ic";
82pub const MAINNET_REGISTRY_CANISTER_ID: &str = "rwlgt-iiaaa-aaaaa-aaaaa-cai";
83#[cfg(feature = "subnet-catalog-host")]
84pub const DEFAULT_CATALOG_MAX_FUTURE_SKEW_SECONDS: u64 = 5 * 60;
86#[cfg(feature = "subnet-catalog-host")]
87pub const DEFAULT_STALE_AFTER_SECONDS: u64 = 7 * 24 * 60 * 60;
88#[cfg(feature = "subnet-catalog-host")]
89pub const DEFAULT_REFRESH_LOCK_STALE_SECONDS: u64 = 30 * 60;
90#[cfg(feature = "subnet-catalog-host")]
91pub const DEFAULT_SUBNET_CATALOG_SOURCE_ENDPOINT: &str = "https://icp-api.io";
92#[cfg(feature = "subnet-catalog-host")]
93pub const MIN_SUBNET_CATALOG_AGREEMENT_ENDPOINTS: usize = 2;
95#[cfg(feature = "subnet-catalog-host")]
96pub const MAX_SUBNET_CATALOG_AGREEMENT_ENDPOINTS: usize = 3;
98#[cfg(feature = "subnet-catalog-host")]
99pub(crate) const SUBNET_CATALOG_LIST_REPORT_SCHEMA_VERSION: u32 = 1;
100#[cfg(feature = "subnet-catalog-host")]
101pub(crate) const SUBNET_CATALOG_INFO_REPORT_SCHEMA_VERSION: u32 = 1;
102#[cfg(feature = "subnet-catalog-host")]
103pub(crate) const SUBNET_CATALOG_REFRESH_REPORT_SCHEMA_VERSION: u32 = 1;
104
105#[cfg(test)]
106mod core_tests;
107#[cfg(all(test, feature = "subnet-catalog-host"))]
108mod tests;