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