Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion crates/icp-canister-interfaces/src/internet_identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 6 additions & 1 deletion crates/icp-cli/tests/network_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion crates/icp/src/manifest/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ pub enum ManagedMode {
gateway: Option<Gateway>,
/// Artificial delay to add to every update call
artificial_delay_ms: Option<u64>,
/// Set up the Internet Identity canister
/// Set up the Internet Identity canister. Makes internet identity available at
/// id.ai.localhost:<port>
ii: Option<bool>,
/// Set up the NNS
nns: Option<bool>,
Expand Down
2 changes: 1 addition & 1 deletion crates/icp/src/network/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub struct NetworkDescriptorModel {
pub candid_ui_canister_id: Option<Principal>,
/// Canister ID of the deployed proxy canister, if any.
pub proxy_canister_id: Option<Principal>,
/// 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.
Expand Down
4 changes: 2 additions & 2 deletions docs/concepts/environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
```

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:<port> |
| `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. |
Expand Down
2 changes: 1 addition & 1 deletion docs/schemas/icp-yaml-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:<port>",
"type": [
"boolean",
"null"
Expand Down
2 changes: 1 addition & 1 deletion docs/schemas/network-yaml-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:<port>",
"type": [
"boolean",
"null"
Expand Down
Loading