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