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
24 changes: 5 additions & 19 deletions docs/cli-reference/dfx-deps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { MarkdownChipRow } from "/src/components/Chip/MarkdownChipRow";

Use the `dfx deps` command with flags and subcommands to pull dependencies from the mainnet and deploy locally.

[Learn how to configure a canister as `pullable`](https://internetcomputer.org/docs/current/developer-docs/smart-contracts/maintain/import).
[Learn how to configure a canister as `pullable`](https://internetcomputer.org/docs/building-apps/advanced/using-third-party-canisters).

The basic syntax for running `dfx deps` commands is:

Expand All @@ -30,7 +30,7 @@ dfx deps pull --help

## dfx deps pull

Use the `dfx deps pull` command to pull dependencies as defined in `dfx.json`.
Use the `dfx deps pull` command to pull dependencies as defined in `dfx.json`. It will resolve all transitive dependencies.

### Basic usage

Expand All @@ -40,20 +40,14 @@ dfx deps pull [options]

### Arguments

You can specify the following argument for the `dfx deps delete` command.
You can specify the following argument for the `dfx deps pull` command.

| Command | Description |
| --------- | --------------------------------------------------------------- |
| `network` | Specify the network to pull dependencies from, default is "ic". |

### Examples

You can use the `dfx deps pull` command to pull the dependencies as defined in `dfx.json` from the mainnet. It will resolve all indirect dependencies.

``` bash
dfx deps pull
```

For testing, you may want to pull from local environment, then run:

```bash
Expand All @@ -72,19 +66,13 @@ dfx deps init [options] [canister]

### Examples

You can use the `dfx deps init` command to set empty init arguments for all pulled dependencies.

``` bash
dfx deps init
```

If any of the dependencies require init arguments, the above command will alarm you with their canister ID and names if exist. Then you can specify canister ID or name to set init argument for individual dependency.

```bash
`dfx deps init <CANISTER_ID/NAME> --argument <ARGUMENT> [--argument-type <TYPE>]`
dfx deps init <CANISTER_ID/NAME> --argument <ARGUMENT> [--argument-type <TYPE>]
```

The command below set number `1` for canister `dep_a` as the argument type is the default `idl` (candid).
The command below set number `1` for canister `dep_a` as the argument type is the default `idl` (Candid).

```bash
dfx deps init dep_a --argument 1
Expand Down Expand Up @@ -114,8 +102,6 @@ dfx deps deploy [flag]

### Examples

You can use the `dfx deps deploy` command to deploy dependencies to the local environment.

``` bash
dfx deps deploy
```
Expand Down
26 changes: 16 additions & 10 deletions docs/cli-reference/dfx-envars.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { MarkdownChipRow } from "/src/components/Chip/MarkdownChipRow";

<MarkdownChipRow labels={["Reference"]} />

You can configure certain properties for your SDK execution environment using environment variables.
You can configure certain properties for your local development environment using environment variables.

This section lists the environment variables that are currently supported with examples of how to use them. In most cases, you can set environment variables for a session by executing an command in the terminal or by adding a line similar to the following to your `.profile` file:
This section lists the environment variables that are currently supported with examples of how to use them. In most cases, you can set environment variables for a session by executing a command in the terminal or by adding a line similar to the following to your `.profile` file:

```shell
export DFX_NETWORK=ic
Expand All @@ -18,11 +18,13 @@ Use environment variables with the `CANISTER_CANDID_PATH` prefix to reference th

For example, if you have a `whoami_frontend` canister that lists `whoami` under the `dependencies` key, you could use the `CANISTER_CANDID_PATH_whoami_frontend` environment variable to refer to the location of the `whoami.did` file, which for local development might be:

$PROJECT_ROOT/.dfx/local/canisters/whoami/whoami.did
```
$PROJECT_ROOT/.dfx/local/canisters/whoami/whoami.did
```

## CANISTER_ID\_\{canister.name\}

Use environment variables with the `CANISTER_ID` prefix to reference the canister identifier for each canister in the `dfx.json` file for your project. Hyphens are invalid in environment variables and are replaced by underscores. Lowercase characters are replaced by uppercase characters.
Use environment variables with the `CANISTER_ID` prefix to reference the canister identifier for each canister in the `dfx.json` file for your project. Hyphens are invalid in environment variables and are replaced by underscores. Lowercase characters are replaced by uppercase characters.

For example, if you have a `linkedup` project that consists of the `linkedup` and `connect-d` canisters, you could use the `CANISTER_ID_LINKEDUP` and `CANISTER_ID_CONNECT_D` environment variables to refer to the canister identifiers—for example `ryjl3-tyaaa-aaaaa-aaaba-cai` and `rrkah-fqaaa-aaaaa-aaaaq-cai`—created for your project.

Expand All @@ -32,13 +34,15 @@ Use the `DFX_CONFIG_ROOT` environment variable to specify a different location f

By default, the `.cache` and `.config` directories are located in the home directory for your development environment. For example, on macOS the default location is in the `/Users/<YOUR-USER-NAME>` directory. Use the `DFX_CONFIG_ROOT` environment variable to specify a different location for these directories.

DFX_CONFIG_ROOT=~/ic-root
```
DFX_CONFIG_ROOT=~/ic-root
```

## DFX_INSTALLATION_ROOT

Use the `DFX_INSTALLATION_ROOT` environment variable to specify a different location for the `dfx` binary if you are not using the default location for your operating system.

The `.cache/dfinity/uninstall.sh` script uses this environment variable to identify the root directory for your SDK installation.
The `.cache/dfinity/uninstall.sh` script uses this environment variable to identify the root directory for your `dfx` installation.

## DFX_NETWORK

Expand All @@ -49,17 +53,19 @@ If you pass the `--network` option to a `dfx` command, the value of the `DFX_NET

Use the `DFX_VERSION` environment variable to identify a specific version of the SDK that you want to install.

DFX_VERSION=0.10.0 sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
```
DFX_VERSION=0.10.0 sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
```

## DFX_MOC_PATH

Use the `DFX_MOC_PATH` environment variable to use a different version of the Motoko compiler than the one bundled with a given dfx version.
Use the `DFX_MOC_PATH` environment variable to use a different version of the Motoko compiler than the one bundled with a given `dfx` version.

## DFX_WARNING

Use the `DFX_WARNING` environment variable to disable one or more warnings that dfx may display. The value is a comma-separated list of warning names, each prefixed with a "-" to disable. The following warning names are currently supported:
Use the `DFX_WARNING` environment variable to disable one or more warnings that `dfx` may display. The value is a comma-separated list of warning names, each prefixed with a "-" to disable. The following warning name is currently supported:

- `mainnet_plaintext_identity`: Disables the warning message that is displayed when you use an insecure identity on the Internet Computer mainnet.
- `mainnet_plaintext_identity`: Disables the warning message that is displayed when you use an insecure identity on the mainnet.

```bash
export DFX_WARNING="-mainnet_plaintext_identity"
Expand Down
6 changes: 3 additions & 3 deletions docs/cli-reference/dfx-generate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { MarkdownChipRow } from "/src/components/Chip/MarkdownChipRow";

Use the `dfx generate` command to generate canister type declarations for supported programming languages. Currently, `dfx generate` supports four languages: Motoko, Candid, JavaScript, and TypeScript.

You can use this command to generate type declarations for all canisters that are defined for a project in the project’s `dfx.json` configuration file or a specific canister.
You can use this command to generate type declarations for all canisters that are defined in the project’s `dfx.json` configuration file or for a specific canister.

Note that you can only run this command from within the project directory structure. For example, if your project name is `hello_world`, your current working directory must be the `hello_world` top-level project directory or one of its subdirectories.

Expand Down Expand Up @@ -47,15 +47,15 @@ Outputs from `dfx generate`:

## Examples

Note that the file name and path to the programs on your file system must match the information specified in the `dfx.json` configuration file.
Note that the file name and path to the canisters on your file system must match the information specified in the `dfx.json` configuration file.

In this example, the `hello_world` canister itself is written in Motoko. The `declarations` section specifies that type declarations for all four languages will be generated and stored at `src/declarations/`.

``` bash
dfx generate hello_world
```

Since there is only one canister in `dfx.json`, calling `dfx generate` without an argument will have the same effect as the above command. If there were multiple canisters defined in `dfx.json`, this would generate type declarations for all defined canisters.
If there is only one canister in `dfx.json`, calling `dfx generate` without an argument will have the same effect as the above command. If there were multiple canisters defined in `dfx.json`, this would generate type declarations for all defined canisters.

``` bash
dfx generate
Expand Down
Loading