Skip to content

Commit

Permalink
Update 3.5-identities-and-auth.mdx - Update part about dfx deps (#5461)
Browse files Browse the repository at this point in the history
All the steps are not necessary anymore apparently and also changing the hash, which is not returned at all

Co-authored-by: Jessie Mongeon <[email protected]>
  • Loading branch information
552020 and jessiemongeon1 authored Feb 24, 2025
1 parent 43d0d92 commit fed375f
Showing 1 changed file with 2 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,60 +265,11 @@ Now let's deploy this project locally. First, pull the II canister using `dfx de
dfx deps pull
```

This command will return output such as:

```
$ Fetching dependencies of canister rdmx6-jaaaa-aaaaa-aaadq-cai...
Found 1 dependencies:
rdmx6-jaaaa-aaaaa-aaadq-cai
Pulling canister rdmx6-jaaaa-aaaaa-aaadq-cai...
WARN: Canister rdmx6-jaaaa-aaaaa-aaadq-cai has different hash between on chain and download.
on chain: a3b50a3b35c487b9e5e9cd0174845d83fe15d5bb5d78e507647ed2272777568f
download: 197d0423178a6ae2785c924b962648e2b47e6ccb2a25e98d9220d9f3ce5eebf7
```

Open the `deps/pull.json` file and modify the `wasm_hash` value with the `download` value from the previous output:

```json title="deps/pull.json"
{
  "canisters": {
    "rdmx6-jaaaa-aaaaa-aaadq-cai": {
      "name": "ii",
      "wasm_hash": "197d0423178a6ae2785c924b962648e2b47e6ccb2a25e98d9220d9f3ce5eebf7",
      "init_guide": "Use '(null)' for sensible defaults. See the candid interface for more details.",
      "init_arg": null,
      "candid_args": "(opt InternetIdentityInit)",
      "gzip": true
    }
  }
}
```

Then, you need to initialize the canister. By running the `dfx deps init` command, it'll show that our II canister requires an init argument:

Then, you need to initialize the canister. By running the `dfx deps init` command:
```bash
dfx deps init
```

```bash
WARN: The following canister(s) require an init argument. Please run `dfx deps init <NAME/PRINCIPAL>` to set them individually:
rdmx6-jaaaa-aaaaa-aaadq-cai (internet_identity)
```

This output shows you that the Internet Identity canister requires an init argument but doesn't include what that init argument is. For more information, run the command `dfx deps init rdmx6-jaaaa-aaaaa-aaadq-cai`, which will provide an error message that includes more information:

```bash
Error: Canister rdmx6-jaaaa-aaaaa-aaadq-cai (internet_identity) requires an init argument. The following info might be helpful:
init => Use '(null)' for sensible defaults. See the Candid interface for more details.
candid:args => (opt InternetIdentityInit)
```

From this error message, you can see that the `(null)` value can be passed to the init command to use the defaults. To do so, run the command:

```bash
dfx deps init rdmx6-jaaaa-aaaaa-aaadq-cai --argument null
```

Then, you can deploy the II canister and the other canisters in the project with the command:

```bash
Expand Down Expand Up @@ -390,4 +341,4 @@ Did you get stuck somewhere in this tutorial, or do you feel like you need addit

Next, you'll take a look at Motoko level 3:

- [3.6 Motoko level 3](/docs/current/tutorials/developer-liftoff/level-3/3.6-motoko-lvl3).
- [3.6 Motoko level 3](/docs/current/tutorials/developer-liftoff/level-3/3.6-motoko-lvl3).

0 comments on commit fed375f

Please sign in to comment.