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 time;
14
15#[cfg(feature = "subnet-catalog-host")]
16pub use crate::ic_registry::RegistryHistoryCacheDisposition;
17#[cfg(feature = "subnet-catalog-host")]
18pub use crate::ic_registry::{SubnetCatalogProgress, SubnetCatalogProgressPhase};
19pub use error::CatalogError;
20#[cfg(feature = "subnet-catalog-host")]
21pub(crate) use host::subject_from_catalog_error;
22#[cfg(feature = "subnet-catalog-host")]
23pub use host::{
24 CacheDisposition, CatalogLoadOutcome, CatalogReadPolicy, CatalogSourceSelection,
25 LiveSubnetCatalogSource, SubnetCatalogCacheRequest, SubnetCatalogDetailedSourceFuture,
26 SubnetCatalogErrorCategory, SubnetCatalogErrorCode, SubnetCatalogFailureCacheDisposition,
27 SubnetCatalogFailureEvidence, SubnetCatalogField, SubnetCatalogHostError,
28 SubnetCatalogLoadFailure, SubnetCatalogLoadFailureRequest, SubnetCatalogLoadRequest,
29 SubnetCatalogLoadStage, SubnetCatalogRefreshRequest, SubnetCatalogRefreshTrigger,
30 SubnetCatalogRemediation, SubnetCatalogRetryability, SubnetCatalogSource,
31 SubnetCatalogSourceFailure, SubnetCatalogSourceFuture, SubnetCatalogSubject,
32 SubnetCatalogUnknownRetryReason, fetch_subnet_catalog_async, load_cached_subnet_catalog,
33 load_subnet_catalog, load_subnet_catalog_with_source,
34 load_subnet_catalog_with_source_and_progress, refresh_subnet_catalog,
35 refresh_subnet_catalog_with_source, subnet_catalog_path, subnet_catalog_refresh_lock_path,
36};
37#[cfg(feature = "subnet-catalog-host")]
38pub(crate) use host::{subnet_catalog_history_lock_path, subnet_catalog_history_path};
39
40pub use json::{catalog_to_pretty_json, parse_catalog_json};
41#[cfg(feature = "subnet-catalog-host")]
42pub use model::UncertifiedCatalogCollection;
43#[cfg(feature = "subnet-catalog-host")]
44pub(in crate::subnet_catalog) use model::catalog_agreement_digest;
45pub use model::{
46 CANISTER_RANGES_KEY_PREFIX, CLASSIFICATION_SCHEMA_VERSION, CatalogAssurance,
47 CatalogSnapshotAuthorityEvidence, CatalogValidationContext, ClassificationSource,
48 GeographicScope, RESOLVER_SCHEMA_VERSION, ROUTING_TABLE_KEY, RawSubnetCatalog, RoutingRange,
49 SUBNET_LIST_KEY, SUBNET_RECORD_KEY_PREFIX, SubnetCatalogProvenance,
50 SubnetCatalogRegistryRecordEvidence, SubnetCatalogRegistryRecordKind,
51 SubnetCatalogRegistryRecordSubject, SubnetCatalogRegistryValueEncoding,
52 SubnetCatalogRoutingSource, SubnetClassification, SubnetInfo, SubnetKind, SubnetSpecialization,
53 ValidatedSubnetCatalog,
54};
55pub use principal::canonical_principal_text;
56pub(crate) use principal::{parse_principal, principal_bytes};
57#[cfg(feature = "subnet-catalog-host")]
58pub use report::{
59 CatalogStaleStatus, SubnetCatalogFilters, SubnetCatalogInfoReport, SubnetCatalogInfoRequest,
60 SubnetCatalogListReport, SubnetCatalogListRequest, SubnetCatalogRefreshReport,
61 SubnetCatalogReportMetadata, SubnetCatalogSubnetRow, build_subnet_catalog_info_report,
62 build_subnet_catalog_info_report_with_source_and_progress, build_subnet_catalog_list_report,
63 build_subnet_catalog_list_report_with_source_and_progress,
64};
65pub use resolver::{ResolveAs, ResolvedCanisterRoute, ResolvedSubnet, ResolvedSubnetSubject};
66#[cfg(feature = "subnet-catalog-host")]
67pub use time::catalog_stale_status;
68
69pub const CATALOG_SCHEMA_VERSION: u32 = 1;
71pub const MAINNET_NETWORK: &str = "ic";
73pub const MAINNET_REGISTRY_CANISTER_ID: &str = "rwlgt-iiaaa-aaaaa-aaaaa-cai";
75#[cfg(feature = "subnet-catalog-host")]
76pub const DEFAULT_CATALOG_MAX_FUTURE_SKEW_SECONDS: u64 = 5 * 60;
78#[cfg(feature = "subnet-catalog-host")]
80pub const DEFAULT_STALE_AFTER_SECONDS: u64 = 7 * 24 * 60 * 60;
81#[cfg(feature = "subnet-catalog-host")]
83pub const DEFAULT_SUBNET_CATALOG_SOURCE_ENDPOINT: &str = "https://icp-api.io";
84#[cfg(feature = "subnet-catalog-host")]
85pub const MIN_SUBNET_CATALOG_AGREEMENT_ENDPOINTS: usize = 2;
87#[cfg(feature = "subnet-catalog-host")]
88pub const MAX_SUBNET_CATALOG_AGREEMENT_ENDPOINTS: usize = 3;
90#[cfg(feature = "subnet-catalog-host")]
91pub(crate) const SUBNET_CATALOG_LIST_REPORT_SCHEMA_VERSION: u32 = 1;
92#[cfg(feature = "subnet-catalog-host")]
93pub(crate) const SUBNET_CATALOG_INFO_REPORT_SCHEMA_VERSION: u32 = 1;
94#[cfg(feature = "subnet-catalog-host")]
95pub(crate) const SUBNET_CATALOG_REFRESH_REPORT_SCHEMA_VERSION: u32 = 1;
96
97#[cfg(test)]
98mod tests;