Skip to content

Commit 0dc8b2d

Browse files
authored
docs: Add docs and tests for ii change (#475)
1 parent ae885de commit 0dc8b2d

File tree

8 files changed

+23
-9
lines changed

8 files changed

+23
-9
lines changed

crates/icp-canister-interfaces/src/internet_identity.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,21 @@ use candid::Principal;
33
pub const INTERNET_IDENTITY_FRONTEND_CID: &str = "uqzsh-gqaaa-aaaaq-qaada-cai";
44
pub const INTERNET_IDENTITY_FRONTEND_PRINCIPAL: Principal =
55
Principal::from_slice(&[0, 0, 0, 0, 2, 16, 0, 6, 1, 1]);
6+
pub const INTERNET_IDENTITY_CID: &str = "rdmx6-jaaaa-aaaaa-aaadq-cai";
7+
pub const INTERNET_IDENTITY_PRINCIPAL: Principal =
8+
Principal::from_slice(&[0, 0, 0, 0, 0, 0, 0, 7, 1, 1]);
69

710
#[cfg(test)]
811
mod tests {
912
use super::*;
1013

1114
#[test]
12-
fn internet_identity_frontend_cid_and_principal_match() {
15+
fn internet_identity_cid_and_principal_match() {
16+
assert_eq!(INTERNET_IDENTITY_CID, INTERNET_IDENTITY_PRINCIPAL.to_text());
17+
}
18+
19+
#[test]
20+
fn internet_identity_frontend_cid_is_valid() {
1321
assert_eq!(
1422
INTERNET_IDENTITY_FRONTEND_CID,
1523
INTERNET_IDENTITY_FRONTEND_PRINCIPAL.to_text()

crates/icp-cli/tests/network_tests.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ use candid::Principal;
44
use icp_canister_interfaces::{
55
cycles_ledger::CYCLES_LEDGER_PRINCIPAL,
66
cycles_minting_canister::CYCLES_MINTING_CANISTER_PRINCIPAL, icp_ledger::ICP_LEDGER_PRINCIPAL,
7-
internet_identity::INTERNET_IDENTITY_FRONTEND_PRINCIPAL, registry::REGISTRY_PRINCIPAL,
7+
internet_identity::INTERNET_IDENTITY_FRONTEND_PRINCIPAL,
8+
internet_identity::INTERNET_IDENTITY_PRINCIPAL, registry::REGISTRY_PRINCIPAL,
89
};
910
use indoc::{formatdoc, indoc};
1011
use predicates::{
@@ -494,6 +495,10 @@ async fn network_starts_with_canisters_preset() {
494495
.await
495496
.unwrap();
496497
// Internet identity
498+
agent
499+
.read_state_canister_module_hash(INTERNET_IDENTITY_PRINCIPAL)
500+
.await
501+
.unwrap();
497502
agent
498503
.read_state_canister_module_hash(INTERNET_IDENTITY_FRONTEND_PRINCIPAL)
499504
.await

crates/icp/src/manifest/network.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ pub enum ManagedMode {
6464
gateway: Option<Gateway>,
6565
/// Artificial delay to add to every update call
6666
artificial_delay_ms: Option<u64>,
67-
/// Set up the Internet Identity canister
67+
/// Set up the Internet Identity canister. Makes internet identity available at
68+
/// id.ai.localhost:<port>
6869
ii: Option<bool>,
6970
/// Set up the NNS
7071
nns: Option<bool>,

crates/icp/src/network/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub struct NetworkDescriptorModel {
7575
pub candid_ui_canister_id: Option<Principal>,
7676
/// Canister ID of the deployed proxy canister, if any.
7777
pub proxy_canister_id: Option<Principal>,
78-
/// Whether the Internet Identity canister is deployed on this network.
78+
/// Whether Internet Identity is deployed on this network.
7979
#[serde(default)]
8080
pub ii: bool,
8181
/// Path to the status directory shared with the network launcher.

docs/concepts/environments.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Managed networks can run natively on your machine or inside a [docker container]
2929
3030
Unless a custom Docker image is used, the following settings can be specified:
3131
32-
* `ii` (bool): Enable the Internet Identity canister
32+
* `ii` (bool): Enable Internet Identity
3333
* `nns` (bool): Enable the NNS and SNS system
3434
* `artificial-delay-ms` (int): Add artificial latency to update calls to simulate mainnet conditions
3535
* `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:
8383
mode: managed
8484
gateway:
8585
port: 9999 # Different port
86-
ii: true # Use the Internet Identity canister
86+
ii: true # Enable Internet Identity canisters
8787
artificial-delay-ms: 1000 # Slow down the network to simulate mainnet latency
8888
```
8989

docs/reference/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ networks:
214214
| `gateway.port` | integer | No | Port number (default: 8000, use 0 for random) |
215215
| `gateway.domains` | array | No | Custom domain names the gateway responds to (e.g. `my-app.localhost`) |
216216
| `artificial-delay-ms` | integer | No | Artificial delay for update calls (ms) |
217-
| `ii` | boolean | No | Install Internet Identity canister (default: false). Also implicitly enabled by `nns`, `bitcoind-addr`, and `dogecoind-addr`. |
217+
| `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:<port> |
218218
| `nns` | boolean | No | Install NNS and SNS canisters (default: false). Implies `ii` and adds an SNS subnet. |
219219
| `subnets` | array | No | Configure subnet types. See [Subnet Configuration](#subnet-configuration). |
220220
| `bitcoind-addr` | array | No | Bitcoin P2P node addresses (e.g. `127.0.0.1:18444`). Adds a bitcoin and II subnet. |

docs/schemas/icp-yaml-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@
634634
"description": "HTTP gateway configuration"
635635
},
636636
"ii": {
637-
"description": "Set up the Internet Identity canister",
637+
"description": "Set up the Internet Identity canister. Makes internet identity available at\nid.ai.localhost:<port>",
638638
"type": [
639639
"boolean",
640640
"null"

docs/schemas/network-yaml-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242
"description": "HTTP gateway configuration"
243243
},
244244
"ii": {
245-
"description": "Set up the Internet Identity canister",
245+
"description": "Set up the Internet Identity canister. Makes internet identity available at\nid.ai.localhost:<port>",
246246
"type": [
247247
"boolean",
248248
"null"

0 commit comments

Comments
 (0)