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;
14#[cfg(feature = "subnet-catalog-host")]
15mod time;
16
17#[cfg(feature = "subnet-catalog-host")]
18pub use crate::ic_registry::RegistryHistoryCacheDisposition;
19#[cfg(feature = "subnet-catalog-host")]
20pub use crate::ic_registry::{SubnetCatalogProgress, SubnetCatalogProgressPhase};
21pub use error::CatalogError;
22#[cfg(feature = "subnet-catalog-host")]
23pub(crate) use host::subject_from_catalog_error;
24#[cfg(feature = "subnet-catalog-host")]
25pub use host::{
26 CacheDisposition, CatalogLoadOutcome, CatalogReadPolicy, CatalogSourceSelection,
27 LiveSubnetCatalogSource, SubnetCatalogCacheRequest, SubnetCatalogDetailedSourceFuture,
28 SubnetCatalogErrorCategory, SubnetCatalogErrorCode, SubnetCatalogFailureCacheDisposition,
29 SubnetCatalogField, SubnetCatalogHostError, SubnetCatalogLoadFailure,
30 SubnetCatalogLoadFailureRequest, SubnetCatalogLoadRequest, SubnetCatalogLoadStage,
31 SubnetCatalogRefreshRequest, SubnetCatalogRefreshTrigger, SubnetCatalogRemediation,
32 SubnetCatalogRetryability, SubnetCatalogSource, SubnetCatalogSourceFailure,
33 SubnetCatalogSourceFuture, SubnetCatalogSubject, SubnetCatalogUnknownRetryReason,
34 fetch_subnet_catalog_async, load_cached_subnet_catalog, load_cached_subnet_catalog_detailed,
35 load_subnet_catalog, load_subnet_catalog_detailed, load_subnet_catalog_detailed_with_progress,
36 load_subnet_catalog_detailed_with_source, load_subnet_catalog_with_source,
37 refresh_subnet_catalog, refresh_subnet_catalog_with_source, subnet_catalog_path,
38 subnet_catalog_refresh_lock_path,
39};
40#[cfg(feature = "subnet-catalog-host")]
41pub(crate) use host::{subnet_catalog_history_lock_path, subnet_catalog_history_path};
42
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_progress, build_subnet_catalog_info_report_with_source,
68 build_subnet_catalog_info_report_with_source_and_progress, build_subnet_catalog_list_report,
69 build_subnet_catalog_list_report_with_progress, build_subnet_catalog_list_report_with_source,
70 build_subnet_catalog_list_report_with_source_and_progress,
71};
72pub use resolver::{ResolveAs, ResolvedCanisterRoute, ResolvedSubnet, ResolvedSubnetSubject};
73#[cfg(feature = "subnet-catalog-host")]
74pub use text::{
75 subnet_catalog_info_report_text, subnet_catalog_list_report_text,
76 subnet_catalog_list_report_verbose_text, subnet_catalog_refresh_report_text,
77};
78#[cfg(feature = "subnet-catalog-host")]
79pub use time::catalog_stale_status;
80
81pub const CATALOG_SCHEMA_VERSION: u32 = 1;
83pub const MAINNET_NETWORK: &str = "ic";
85pub const MAINNET_REGISTRY_CANISTER_ID: &str = "rwlgt-iiaaa-aaaaa-aaaaa-cai";
87#[cfg(feature = "subnet-catalog-host")]
88pub const DEFAULT_CATALOG_MAX_FUTURE_SKEW_SECONDS: u64 = 5 * 60;
90#[cfg(feature = "subnet-catalog-host")]
92pub const DEFAULT_STALE_AFTER_SECONDS: u64 = 7 * 24 * 60 * 60;
93#[cfg(feature = "subnet-catalog-host")]
95pub const DEFAULT_SUBNET_CATALOG_SOURCE_ENDPOINT: &str = "https://icp-api.io";
96#[cfg(feature = "subnet-catalog-host")]
97pub const MIN_SUBNET_CATALOG_AGREEMENT_ENDPOINTS: usize = 2;
99#[cfg(feature = "subnet-catalog-host")]
100pub const MAX_SUBNET_CATALOG_AGREEMENT_ENDPOINTS: usize = 3;
102#[cfg(feature = "subnet-catalog-host")]
103pub(crate) const SUBNET_CATALOG_LIST_REPORT_SCHEMA_VERSION: u32 = 1;
104#[cfg(feature = "subnet-catalog-host")]
105pub(crate) const SUBNET_CATALOG_INFO_REPORT_SCHEMA_VERSION: u32 = 1;
106#[cfg(feature = "subnet-catalog-host")]
107pub(crate) const SUBNET_CATALOG_REFRESH_REPORT_SCHEMA_VERSION: u32 = 1;
108
109#[cfg(test)]
110mod core_tests;
111#[cfg(all(test, feature = "subnet-catalog-host"))]
112mod tests;