diff --git a/crates/icp-canister-interfaces/src/internet_identity.rs b/crates/icp-canister-interfaces/src/internet_identity.rs index d6208fc9..ccc03cd7 100644 --- a/crates/icp-canister-interfaces/src/internet_identity.rs +++ b/crates/icp-canister-interfaces/src/internet_identity.rs @@ -3,13 +3,21 @@ use candid::Principal; pub const INTERNET_IDENTITY_FRONTEND_CID: &str = "uqzsh-gqaaa-aaaaq-qaada-cai"; pub const INTERNET_IDENTITY_FRONTEND_PRINCIPAL: Principal = Principal::from_slice(&[0, 0, 0, 0, 2, 16, 0, 6, 1, 1]); +pub const INTERNET_IDENTITY_CID: &str = "rdmx6-jaaaa-aaaaa-aaadq-cai"; +pub const INTERNET_IDENTITY_PRINCIPAL: Principal = + Principal::from_slice(&[0, 0, 0, 0, 0, 0, 0, 7, 1, 1]); #[cfg(test)] mod tests { use super::*; #[test] - fn internet_identity_frontend_cid_and_principal_match() { + fn internet_identity_cid_and_principal_match() { + assert_eq!(INTERNET_IDENTITY_CID, INTERNET_IDENTITY_PRINCIPAL.to_text()); + } + + #[test] + fn internet_identity_frontend_cid_is_valid() { assert_eq!( INTERNET_IDENTITY_FRONTEND_CID, INTERNET_IDENTITY_FRONTEND_PRINCIPAL.to_text() diff --git a/crates/icp-cli/tests/network_tests.rs b/crates/icp-cli/tests/network_tests.rs index 320e3157..ebf0d38e 100644 --- a/crates/icp-cli/tests/network_tests.rs +++ b/crates/icp-cli/tests/network_tests.rs @@ -4,7 +4,8 @@ use candid::Principal; use icp_canister_interfaces::{ cycles_ledger::CYCLES_LEDGER_PRINCIPAL, cycles_minting_canister::CYCLES_MINTING_CANISTER_PRINCIPAL, icp_ledger::ICP_LEDGER_PRINCIPAL, - internet_identity::INTERNET_IDENTITY_FRONTEND_PRINCIPAL, registry::REGISTRY_PRINCIPAL, + internet_identity::INTERNET_IDENTITY_FRONTEND_PRINCIPAL, + internet_identity::INTERNET_IDENTITY_PRINCIPAL, registry::REGISTRY_PRINCIPAL, }; use indoc::{formatdoc, indoc}; use predicates::{ @@ -494,6 +495,10 @@ async fn network_starts_with_canisters_preset() { .await .unwrap(); // Internet identity + agent + .read_state_canister_module_hash(INTERNET_IDENTITY_PRINCIPAL) + .await + .unwrap(); agent .read_state_canister_module_hash(INTERNET_IDENTITY_FRONTEND_PRINCIPAL) .await diff --git a/crates/icp/src/manifest/network.rs b/crates/icp/src/manifest/network.rs index cacd7782..16ddc05d 100644 --- a/crates/icp/src/manifest/network.rs +++ b/crates/icp/src/manifest/network.rs @@ -64,7 +64,8 @@ pub enum ManagedMode { gateway: Option, /// Artificial delay to add to every update call artificial_delay_ms: Option, - /// Set up the Internet Identity canister + /// Set up the Internet Identity canister. Makes internet identity available at + /// id.ai.localhost: ii: Option, /// Set up the NNS nns: Option, diff --git a/crates/icp/src/network/config.rs b/crates/icp/src/network/config.rs index c66ac4b2..c9bb5c08 100644 --- a/crates/icp/src/network/config.rs +++ b/crates/icp/src/network/config.rs @@ -75,7 +75,7 @@ pub struct NetworkDescriptorModel { pub candid_ui_canister_id: Option, /// Canister ID of the deployed proxy canister, if any. pub proxy_canister_id: Option, - /// Whether the Internet Identity canister is deployed on this network. + /// Whether Internet Identity is deployed on this network. #[serde(default)] pub ii: bool, /// Path to the status directory shared with the network launcher. diff --git a/docs/concepts/environments.md b/docs/concepts/environments.md index 0ea345a9..1c4488aa 100644 --- a/docs/concepts/environments.md +++ b/docs/concepts/environments.md @@ -29,7 +29,7 @@ Managed networks can run natively on your machine or inside a [docker container] Unless a custom Docker image is used, the following settings can be specified: -* `ii` (bool): Enable the Internet Identity canister +* `ii` (bool): Enable Internet Identity * `nns` (bool): Enable the NNS and SNS system * `artificial-delay-ms` (int): Add artificial latency to update calls to simulate mainnet conditions * `subnets` ([]string): Configure the subnet layout (by default, one application subnet is created). See [Deploying to Specific Subnets](../guides/deploying-to-specific-subnets.md) for mainnet subnet selection. @@ -83,7 +83,7 @@ networks: mode: managed gateway: port: 9999 # Different port - ii: true # Use the Internet Identity canister + ii: true # Enable Internet Identity canisters artificial-delay-ms: 1000 # Slow down the network to simulate mainnet latency ``` diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index 4e934b2d..3b049386 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md @@ -214,7 +214,7 @@ networks: | `gateway.port` | integer | No | Port number (default: 8000, use 0 for random) | | `gateway.domains` | array | No | Custom domain names the gateway responds to (e.g. `my-app.localhost`) | | `artificial-delay-ms` | integer | No | Artificial delay for update calls (ms) | -| `ii` | boolean | No | Install Internet Identity canister (default: false). Also implicitly enabled by `nns`, `bitcoind-addr`, and `dogecoind-addr`. | +| `ii` | boolean | No | Install Internet Identity canister (default: false). Also implicitly enabled by `nns`, `bitcoind-addr`, and `dogecoind-addr`. When enabled, the internet identity frontend is available at id.ai.localhost: | | `nns` | boolean | No | Install NNS and SNS canisters (default: false). Implies `ii` and adds an SNS subnet. | | `subnets` | array | No | Configure subnet types. See [Subnet Configuration](#subnet-configuration). | | `bitcoind-addr` | array | No | Bitcoin P2P node addresses (e.g. `127.0.0.1:18444`). Adds a bitcoin and II subnet. | diff --git a/docs/schemas/icp-yaml-schema.json b/docs/schemas/icp-yaml-schema.json index 6a058f01..63a012e9 100644 --- a/docs/schemas/icp-yaml-schema.json +++ b/docs/schemas/icp-yaml-schema.json @@ -634,7 +634,7 @@ "description": "HTTP gateway configuration" }, "ii": { - "description": "Set up the Internet Identity canister", + "description": "Set up the Internet Identity canister. Makes internet identity available at\nid.ai.localhost:", "type": [ "boolean", "null" diff --git a/docs/schemas/network-yaml-schema.json b/docs/schemas/network-yaml-schema.json index 6182c0f9..e3e6af38 100644 --- a/docs/schemas/network-yaml-schema.json +++ b/docs/schemas/network-yaml-schema.json @@ -242,7 +242,7 @@ "description": "HTTP gateway configuration" }, "ii": { - "description": "Set up the Internet Identity canister", + "description": "Set up the Internet Identity canister. Makes internet identity available at\nid.ai.localhost:", "type": [ "boolean", "null"