Skip to content
Merged
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
64 changes: 61 additions & 3 deletions docs/migration/from-dfx.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,14 @@ canisters:

### Network Configuration

**Remote network example:**

**dfx.json:**
```json
{
"networks": {
"staging": {
"providers": ["https://ic0.app"],
"providers": ["https://icp-api.io"],
"type": "persistent"
}
}
Expand All @@ -253,14 +255,70 @@ canisters:
networks:
- name: staging
mode: connected
url: https://ic0.app
url: https://icp-api.io

environments:
- name: staging
network: staging
canisters: [frontend, backend]
```

**Testnet with root key:**

**dfx.json:**
```json
{
"networks": {
"testnet": {
"providers": ["https://testnet.example.com"],
"type": "persistent"
}
}
}
```

**icp.yaml:**
```yaml
networks:
- name: testnet
mode: connected
url: https://testnet.example.com
root-key: 308182301d060d2b0601040182dc7c05030102... # Hex-encoded root key
```

**Local network with custom bind address:**

**dfx.json:**
```json
{
"networks": {
"local": {
"bind": "127.0.0.1:4943",
"type": "ephemeral"
}
}
}
```

**icp.yaml:**
```yaml
networks:
- name: local
mode: managed
gateway:
host: 127.0.0.1
port: 4943
```

**Key differences:**
- dfx's `"type": "persistent"` maps to icp-cli's `mode: connected` (external networks)
- dfx's `"type": "ephemeral"` maps to icp-cli's `mode: managed` (local networks that icp-cli controls)
- dfx's `"providers"` array (which can list multiple URLs for redundancy) becomes a single `url` field in icp-cli
- dfx's `"bind"` address for local networks maps to icp-cli's `gateway.host` and `gateway.port`
- **Root key handling**: dfx automatically fetches the root key from non-mainnet networks at runtime. icp-cli requires you to specify the `root-key` explicitly in the configuration for testnets (connected networks). For local managed networks, icp-cli retrieves the root key from the network launcher. The root key is the public key used to verify responses from the network. Explicit configuration ensures the root key comes from a trusted source rather than the network itself.

**Note:** icp-cli uses `https://icp-api.io` as the default IC mainnet URL, while dfx currently uses `https://icp0.io`. Both URLs point to the same IC mainnet, but `https://icp-api.io` is the recommended API gateway. The implicit `ic` network in icp-cli is configured with `https://icp-api.io`.

## Features Not in icp-cli

Some dfx features work differently or aren't directly available:
Expand Down Expand Up @@ -505,7 +563,7 @@ During migration, you can use both tools side-by-side with some considerations:

**What works side-by-side:**
- ✅ **Configuration files**: dfx uses `dfx.json`, icp-cli uses `icp.yaml` (no conflicts)
- ✅ **Identities**: Both use the same keyring service (`internet_computer_identities`), so keyring-stored identities are accessible to both tools
- ✅ **Identities**: Both store identities separately (dfx uses `internet_computer_identities` keyring service, icp-cli uses `icp-cli`), so they don't interfere with each other
- ✅ **Canister IDs**: Stored in different locations (`.dfx/` vs `.icp/`), no conflicts
- ✅ **Remote networks**: Both can deploy to IC mainnet independently

Expand Down