diff --git a/docs/concepts/trust-in-canisters.md b/docs/concepts/trust-in-canisters.md index 48dd3b89c0..64371c0423 100644 --- a/docs/concepts/trust-in-canisters.md +++ b/docs/concepts/trust-in-canisters.md @@ -30,7 +30,7 @@ The canisters, if not voluntarily made immutable, have complete control over the The simplest option is to make the canister immutable by removing its controller. A user can verify the list of controllers for a canister <canister> using dfx. For example: - dfx canister --network ic info ryjl3-tyaaa-aaaaa-aaaba-cai + dfx canister info ryjl3-tyaaa-aaaaa-aaaba-cai --network ic will return the list of controllers for the canister with principal `ryjl3-tyaaa-aaaaa-aaaba-cai` (in this example, the ledger canister). diff --git a/docs/developer-docs/build/backend/access-control.md b/docs/developer-docs/build/backend/access-control.md index 6210b43bdd..47ab5abfd2 100644 --- a/docs/developer-docs/build/backend/access-control.md +++ b/docs/developer-docs/build/backend/access-control.md @@ -135,7 +135,7 @@ To review your current identity and principle: 3. Check the role associated with the `default` user identity by running the following command: - dfx canister --wallet=$(dfx identity get-wallet) call access_hello my_role + dfx canister call access_hello my_role --wallet="$(dfx identity get-wallet)" The command displays output similar to the following: @@ -160,7 +160,7 @@ To create a new user identity: 3. Call the `my_role` function to see that your new user identity has not been assigned to any role. - dfx --identity ic_admin canister call access_hello my_role + dfx canister call access_hello my_role --identity ic_admin The command displays output similar to the following: @@ -197,7 +197,7 @@ To assign the admin role to the IC\_admin identity: 2. Assign the `ic_admin` principal the `admin` role by running a command similar to the following using Candid syntax: - dfx canister --wallet=$(dfx identity get-wallet) call access_hello assign_role '((principal "c5wa6-3irl7-tuxuo-4vtyw-xsnhw-rv2a6-vcmdz-bzkca-vejmd-327zo-wae"),opt variant{admin})' + dfx canister call --wallet="$(dfx identity get-wallet)" access_hello assign_role '((principal "c5wa6-3irl7-tuxuo-4vtyw-xsnhw-rv2a6-vcmdz-bzkca-vejmd-327zo-wae"),opt variant{admin})' Be sure to replace the `principal` hash with the one returned by the `dfx identity get-principal` command for the `ic_admin` identity. @@ -205,7 +205,7 @@ Be sure to replace the `principal` hash with the one returned by the `dfx identi \+ - dfx --identity ic_admin canister call access_hello my_role + dfx canister call access_hello my_role --identity ic_admin \+ The command displays output similar to the following: @@ -215,7 +215,7 @@ Be sure to replace the `principal` hash with the one returned by the `dfx identi 1. Call the `greet` function using the `ic_admin` user identity that you just assigned the `admin` role by running the following command: - dfx --identity ic_admin canister call access_hello greet "Internet Computer Admin" + dfx canister call access_hello greet "Internet Computer Admin" --identity ic_admin The command displays output similar to the following: @@ -258,11 +258,11 @@ To add a new authorized user identity: 5. Use the `ic_admin` identity to assign the `authorized` role to `alice_auth` by running the following command: - dfx --identity ic_admin canister call access_hello assign_role "(principal \"$ALICE_ID\", opt variant{authorized})" + dfx canister call access_hello assign_role "(principal \"$ALICE_ID\", opt variant{authorized})" --identity ic_admin 6. Call the `my_role` function to verify the role assignment. - dfx --identity alice_auth canister call access_hello my_role + dfx canister call access_hello my_role --identity alice_auth The command displays output similar to the following: @@ -301,23 +301,23 @@ To add an unauthorized user identity: 4. Store the principal for the `bob_standard` user in an environment variable by running the following command: - BOB_ID=$(dfx --identity bob_standard identity get-principal) + BOB_ID=$(dfx identity get-principal --identity bob_standard) 5. Attempt to use the `bob_standard` identity to assign a role. - dfx --identity bob_standard canister call access_hello assign_role "(principal \"$BOB_ID\", opt variant{authorized})" + dfx canister call --identity bob_standard access_hello assign_role "(principal \"$BOB_ID\", opt variant{authorized})" This command returns an `unauthorized` error. 6. Attempt to use the `default` user identity to assign `bob_standard` the `owner` role by running the following command: - dfx --identity default canister --wallet=$(dfx --identity default identity get-wallet) call access_hello assign_role "(principal \"$BOB_ID\", opt variant{owner})" + dfx canister call --identity default --wallet="$(dfx identity get-wallet --identity default)" access_hello assign_role "(principal \"$BOB_ID\", opt variant{owner})" This command fails because users cannot be assigned the `owner` role. 7. Call the `greet` function using the `bob_standard` user identity by running the following command: - dfx --identity bob_standard canister call access_hello greet "Bob" + dfx canister call --identity bob_standard access_hello greet "Bob" The command displays output similar to the following: diff --git a/docs/developer-docs/build/backend/reproducible-builds.md b/docs/developer-docs/build/backend/reproducible-builds.md index 39fa625178..4816d21896 100644 --- a/docs/developer-docs/build/backend/reproducible-builds.md +++ b/docs/developer-docs/build/backend/reproducible-builds.md @@ -16,7 +16,7 @@ Internet Computer does not allow you to access the Wasm code of an arbitrary can To obtain this hash, you must first note the principal of the Internet Computer canister whose code you want to check. For example, assume we’re interested in the code of the Internet Identity canister, whose principal is `rdmx6-jaaaa-aaaaa-aaadq-cai`. Then, the easiest way to access this service is using the [`dfx`](https://internetcomputer.org/developers/) tool from the terminal. Open your terminal, and run: - $ dfx canister --network ic info rdmx6-jaaaa-aaaaa-aaadq-cai + $ dfx canister info rdmx6-jaaaa-aaaaa-aaadq-cai --network ic Controllers: r7inp-6aaaa-aaaaa-aaabq-cai Module hash: 0x2d95e90de5d7de11f25ac256690aff44c6685a1570b1becdf6e50192e983e103 @@ -235,6 +235,6 @@ Summarizing our recommendations for canister authors: Finally, if your build is reproducible, you can compare the hash of the resulting Wasm code to the hash of the code that is running in a canister, which you retrieve as follows: - $ dfx canister --network ic info + $ dfx canister info --network ic Beware that this hash might change if the controllers upgrade the canister code. diff --git a/docs/developer-docs/build/cdks/cdk-rs-dfinity/rust-profile.md b/docs/developer-docs/build/cdks/cdk-rs-dfinity/rust-profile.md index 539024e6a3..adb60afa52 100644 --- a/docs/developer-docs/build/cdks/cdk-rs-dfinity/rust-profile.md +++ b/docs/developer-docs/build/cdks/cdk-rs-dfinity/rust-profile.md @@ -263,7 +263,7 @@ To add identities for testing: 2. Call the `update` function to add a profile for the new identity. Enter your passphrase when prompted. ``` bash - dfx --identity Miles canister call rust_profile_backend update '(record {name = "Miles"; description = "Great Dane"; keywords = vec {"Boston"; "mantle"; "three-legged"}})' + dfx canister call --identity Miles rust_profile_backend update '(record {name = "Miles"; description = "Great Dane"; keywords = vec {"Boston"; "mantle"; "three-legged"}})' ``` 3. Call the `getSelf` function to view the profile associated with the `default` user identity. @@ -285,7 +285,7 @@ To add identities for testing: 4. Call the `getSelf` function using the `Miles` user identity by running the following command: ``` bash - dfx --identity Miles canister call rust_profile_backend getSelf + dfx canister call --identity Miles rust_profile_backend getSelf ``` The command displays the profile currently associated with the Miles identity, in this example: diff --git a/docs/developer-docs/build/project-setup/cycles-wallet.md b/docs/developer-docs/build/project-setup/cycles-wallet.md index b11bf2a726..5db87abfb7 100644 --- a/docs/developer-docs/build/project-setup/cycles-wallet.md +++ b/docs/developer-docs/build/project-setup/cycles-wallet.md @@ -98,7 +98,7 @@ To check the cycles balance on the Internet Computer: 3. Display the cycle balance from the cycles wallet associated with the currently-selected identity by running the following command: - dfx wallet --network ic balance + dfx wallet balance --network ic The command displays output similar to the following: @@ -108,7 +108,7 @@ To check the cycles balance on the Internet Computer: You can also check the cycles balance by calling the `wallet_balance` method in the cycles wallet canister directly. For example, if your principal is a controller for the `h5aet-waaaa-aaaab-qaamq-cai` cycles wallet, you can check the current cycle balance by running the following command: - dfx canister --network ic call h5aet-waaaa-aaaab-qaamq-cai wallet_balance + dfx canister call h5aet-waaaa-aaaab-qaamq-cai wallet_balance --network ic The command returns the balance using Candid format as a record with an amount field (represented by the hash 3\_573\_748\_184) and a balance of 6,895,656,625,450 cycles like this: @@ -128,7 +128,7 @@ Use the `wallet_create_wallet` method to create a new cycles wallet canister wit For example, you can run a command similar to the following to create a new wallet and assign a principal as a controller: - dfx canister --network call f3yw6-7qaaa-aaaab-qaabq-cai wallet_create_wallet '(record { cycles = 5000000000000 : nat64; controller = principal "vpqee-nujda-46rtu-4noo7-qnxmb-zqs7g-5gvqf-4gy7t-vuprx-u2urx-gqe"})' + dfx canister call f3yw6-7qaaa-aaaab-qaabq-cai wallet_create_wallet '(record { cycles = 5000000000000 : nat64; controller = principal "vpqee-nujda-46rtu-4noo7-qnxmb-zqs7g-5gvqf-4gy7t-vuprx-u2urx-gqe"})' --network ic The command returns the principal for the new wallet: @@ -140,7 +140,7 @@ Use the `wallet_create_canister` method to register a new canister principal on For example, you can run a command similar to the following to create a new wallet and assign a principal as a controller: - dfx canister --network call f3yw6-7qaaa-aaaab-qaabq-cai wallet_create_canister '(record { cycles = 5000000000000 : nat64; controller = principal "vpqee-nujda-46rtu-4noo7-qnxmb-zqs7g-5gvqf-4gy7t-vuprx-u2urx-gqe"})' + dfx canister call f3yw6-7qaaa-aaaab-qaabq-cai wallet_create_canister '(record { cycles = 5000000000000 : nat64; controller = principal "vpqee-nujda-46rtu-4noo7-qnxmb-zqs7g-5gvqf-4gy7t-vuprx-u2urx-gqe"})' --network ic The command returns the principal for the new canister you created: @@ -176,7 +176,7 @@ For example, you can use the `get_events` method to return `canister_create` and If the cycles wallet (`gastn-uqaaa-aaaae-aaafq-cai`) is deployed on the Internet Computer main network, you could run a command that looks like this to return events: - dfx canister --network ic call gastn-uqaaa-aaaae-aaafq-cai get_events '(record {from = null; to = null})' + dfx canister call gastn-uqaaa-aaaae-aaafq-cai get_events '(record {from = null; to = null})' --network ic The output from the command is in Candid format similar to the following: diff --git a/docs/developer-docs/build/project-setup/manage-canisters.md b/docs/developer-docs/build/project-setup/manage-canisters.md index bed4a24fdb..de917a7987 100644 --- a/docs/developer-docs/build/project-setup/manage-canisters.md +++ b/docs/developer-docs/build/project-setup/manage-canisters.md @@ -92,7 +92,7 @@ You can look up the canister identifier for any specific canister by running the To look up the canister identifier for the same canister deployed on the environment specified by the `ic` alias, you would run the following command: - dfx canister --network=ic id lookup + dfx canister id lookup --network=ic ## Add a Wallet for Existing Canisters diff --git a/docs/developer-docs/integrations/ledger/deploy-new-token.md b/docs/developer-docs/integrations/ledger/deploy-new-token.md index 018ad90c57..d8fe4bd07a 100644 --- a/docs/developer-docs/integrations/ledger/deploy-new-token.md +++ b/docs/developer-docs/integrations/ledger/deploy-new-token.md @@ -92,7 +92,7 @@ This tutorial will guide you step-by-step to deploy your own token to the IC and 6. Check that the Ledger canister is healthy. Execute the following command: ``` sh - dfx canister --network ${NETWORK} call ledger symbol + dfx canister call ledger symbol --network ${NETWORK} ``` The output should look like the following: diff --git a/docs/developer-docs/integrations/ledger/interact-with-ledger.md b/docs/developer-docs/integrations/ledger/interact-with-ledger.md index 1e691e143b..706b47db64 100644 --- a/docs/developer-docs/integrations/ledger/interact-with-ledger.md +++ b/docs/developer-docs/integrations/ledger/interact-with-ledger.md @@ -19,13 +19,13 @@ Both commands provide a flag to specify a ledger canister id (`--ledger-canister Get the ICP balance of a specific account: ``` bash -dfx ledger --network ic balance +dfx ledger balance --network ic ``` The `` is encoded as a hex string. In many cases you want to check the main account balance of a specific principal. You can use the following command for this: ``` bash -dfx ledger --network ic balance $(dfx ledger account-id --of-principal ) +dfx ledger balance "$(dfx ledger account-id --of-principal )" --network ic ``` #### Transfer @@ -33,7 +33,7 @@ dfx ledger --network ic balance $(dfx ledger account-id --of-principal --memo +dfx ledger transfer --amount --memo --network ic ``` diff --git a/docs/developer-docs/integrations/sns/get-sns/local-testing.md b/docs/developer-docs/integrations/sns/get-sns/local-testing.md index cffd22e543..013afff4ed 100644 --- a/docs/developer-docs/integrations/sns/get-sns/local-testing.md +++ b/docs/developer-docs/integrations/sns/get-sns/local-testing.md @@ -86,7 +86,7 @@ launch. 2. Make sure that you have at least 5 ICP in your main account; if not get more with the "Get ICP" menu entry. 3. Go to the neurons tab and create a neuron. Give it 5 ICP and an 8 year dissolve delay. 4. Make a note of your neuron ID. The rest of this guide will refer to it as `DEVELOPER_NEURON_ID`. The commands below assume you run `export DEVELOPER_NEURON_ID=` in your shell. - 5. Add one of the dfx identities as a hotkey to the neuron. This dfx identity will be referred to as `developer-identity`. To get the principal of this identity, run `dfx --identity developer-identity identity get-principal`. + 5. Add one of the dfx identities as a hotkey to the neuron. This dfx identity will be referred to as `developer-identity`. To get the principal of this identity, run `dfx identity get-principal --identity developer-identity`. #### 3. Ask the SNS wasm modules canister to install an SNS. Make a call to the SNS wasm modules canister on the local NNS to request that an SNS is installed. diff --git a/docs/developer-docs/quickstart/cycles-faucet.md b/docs/developer-docs/quickstart/cycles-faucet.md index 8771ba7289..3844cf7303 100644 --- a/docs/developer-docs/quickstart/cycles-faucet.md +++ b/docs/developer-docs/quickstart/cycles-faucet.md @@ -49,7 +49,7 @@ After a successfully running the `redeem` command, the created canister's ID is After runninng the `redeem` command, the created canister and it's balance can be checked using the status command. Use the canister ID returned by the `redeem` command: - dfx canister --network=ic status + dfx canister status --network=ic Please note the canister ID is used in the next step, so write down the canister ID. diff --git a/docs/developer-docs/quickstart/hello10mins.md b/docs/developer-docs/quickstart/hello10mins.md index 1bb3fc78cc..3ca562050f 100644 --- a/docs/developer-docs/quickstart/hello10mins.md +++ b/docs/developer-docs/quickstart/hello10mins.md @@ -325,7 +325,7 @@ For the purposes of this tutorial, you can acquire free cycles for your `Hello` Now that you have used the cycles faucet, in terminal B you can check your cycles balance: ``` bash -dfx wallet --network ic balance +dfx wallet balance --network ic ``` You should see around 20 trillion cycles if you run this after using the cycles wallet. If so, skip to section [5. Deploying on-chain](#5deploy-on-chain-1-min). @@ -351,7 +351,7 @@ e213184a548871a47fb526f3cba24e2ee2fbbc8129c4ab497ef2ce535130a0a4 Once you have transferred some ICP tokens into this account (5-10$ worth should be plenty to get going), you can see the balance using this command: ``` bash -dfx ledger --network ic balance +dfx ledger balance --network ic ``` This will output something like this: @@ -363,13 +363,13 @@ This will output something like this: With those ICP tokens ready, you can start creating your cycles wallet. To start, you have to create a canister which will become your wallet. The base command for this is as follows: ``` bash -dfx ledger --network ic create-canister --amount +dfx ledger create-canister --amount --network ic ``` The two values you have to substitute are your own principal and the amount of tokens you want to convert. To figure out your own principal, use the output of `dfx identity get-principal`. If my principal is `tsqwz-udeik-5migd-ehrev-pvoqv-szx2g-akh5s-fkyqc-zy6q7-snav6-uqe` and I want to convert 2.3 ICP into cycles, the command looks like this: ``` bash -dfx ledger --network ic create-canister tsqwz-udeik-5migd-ehrev-pvoqv-szx2g-akh5s-fkyqc-zy6q7-snav6-uqe --amount 2.3 +dfx ledger create-canister tsqwz-udeik-5migd-ehrev-pvoqv-szx2g-akh5s-fkyqc-zy6q7-snav6-uqe --amount 2.3 --network ic ``` This command will take some time and output something similar to the following: @@ -384,13 +384,13 @@ The id in this output is the address of the canister where your wallet will live Now that the canister is created, you can install the wallet code using this command: ``` bash -dfx identity --network ic deploy-wallet +dfx identity deploy-wallet --network ic ``` Here, you have to substitute the canister identifier using the id you received in the output of the previous command. So, in the example this would look like this: ``` bash -dfx identity --network ic deploy-wallet gastn-uqaaa-aaaae-aaafq-cai +dfx identity deploy-wallet gastn-uqaaa-aaaae-aaafq-cai --network ic ``` And the output should look like this: @@ -403,7 +403,7 @@ The wallet canister on the "ic" network for user "default" is "gastn-uqaaa-aaaae Now your wallet should be configured and ready to go. To check if everything went right, run this to see the identifier of your configured wallet: ``` bash -dfx identity --network ic get-wallet +dfx identity get-wallet --network ic ``` This should print the canister id you used in the commands earlier. @@ -411,7 +411,7 @@ This should print the canister id you used in the commands earlier. You can also check the balance of your new cycles wallet: ``` bash -dfx wallet --network ic balance +dfx wallet balance --network ic ``` This should print something looking like this: @@ -430,7 +430,7 @@ npm install ``` ``` bash -dfx deploy --network ic --with-cycles 1000000000000 +dfx deploy --with-cycles 1000000000000 --network ic ``` The `--network` option specifies the network alias or URL for deploying the dapp. This option is required to install on the Internet Computer blockchain mainnet. `--with-cycles` explicitly tells `dfx` how many cycles to use, otherwise it will use the default of 3 trillion. @@ -496,12 +496,12 @@ After loading the service worker, your dapp will load: Since the canister has a method called `greet` (which accepts a string as a parameter), we can send it a message via `dfx`. ``` bash -dfx canister --network ic call hello_backend greet '("everyone": text)' +dfx canister call hello_backend greet '("everyone": text)' --network ic ``` Note the way the message is constructed: -- `dfx canister --network ic call` is the setup for calling a canister on the IC. +- `dfx canister call --network ic` is the setup for calling a canister on the IC. - `hello_backend greet` means we are sending a message to a canister named `hello` and evoking its `greet` method. `dfx` knows which `hello` canister (out of the many in the IC), one refers to because a mapping of `hello` to a canister id is stored locally in `.dfx/local/canister_ids.json`. @@ -522,7 +522,7 @@ dfx identity whoami #### 2. Confirm the identity you are using has enough cycles on-chain ``` bash -dfx wallet --network ic balance +dfx wallet balance --network ic ``` #### 3. Try proxying through your wallet @@ -532,7 +532,7 @@ Sometimes (especially when you created the canisters with `dfx` versions before If this works and you would like to add your own principal as a controller of the canister (so you don’t have to use the `--wallet` option anymore), you can run this: ``` bash -dfx canister --wallet "$(dfx identity get-wallet)" update-settings --all --add-controller "$(dfx identity get-principal)" +dfx canister update-settings --wallet "$(dfx identity get-wallet)" --all --add-controller "$(dfx identity get-principal)" ``` ## Wrap-up diff --git a/docs/developer-docs/quickstart/hello20mins.md b/docs/developer-docs/quickstart/hello20mins.md index 3401fa3680..d48c368061 100644 --- a/docs/developer-docs/quickstart/hello20mins.md +++ b/docs/developer-docs/quickstart/hello20mins.md @@ -296,10 +296,10 @@ Now that the canister is deployed on-chain, you can send it a message. Since the canister has a method called `greet` (which accepts a string as a parameter), we will send it a message. - $ dfx canister --network ic call hello_backend greet '("everyone": text)' + $ dfx canister call hello_backend greet '("everyone": text)' --network ic Note the way the message is constructed: \* -`dfx canister --network ic call` is setup for calling a canister on the +`dfx canister call --network ic` is setup for calling a canister on the IC \* `hello_backend greet` means we are sending a message to a canister named `hello_backend` and evoking its `greet` method \* `'("everyone": text)'` is the parameter we are sending to `greet` (which accepts `Text` as its only diff --git a/docs/developer-docs/quickstart/network-quickstart.md b/docs/developer-docs/quickstart/network-quickstart.md index a1d56f96d9..48f327b4ac 100644 --- a/docs/developer-docs/quickstart/network-quickstart.md +++ b/docs/developer-docs/quickstart/network-quickstart.md @@ -150,7 +150,7 @@ To look up your account in the ledger: 4. Check your account balance by running the following command: - dfx ledger --network ic balance + dfx ledger balance --network ic This command displays the ICP token balance from the ledger account. For example, you should see output similar to the following: @@ -164,13 +164,13 @@ To transfer ICP tokens to create a cycles wallet: 1. Create a new canister with cycles by transferring ICP tokens from your ledger account by running a command similar to the following: - dfx ledger --network ic create-canister --amount + dfx ledger create-canister --amount --network ic This command converts the number of ICP tokens you specify for the `--amount` argument into cycles, and associates the cycles with a new canister identifier controlled by the principal you specify. For example, the following command converts .25 ICP tokens into cycles and specifies the principal identifier for the default identity as the controller of the new canister: - dfx ledger --network ic create-canister tsqwz-udeik-5migd-ehrev-pvoqv-szx2g-akh5s-fkyqc-zy6q7-snav6-uqe --amount .25 + dfx ledger create-canister tsqwz-udeik-5migd-ehrev-pvoqv-szx2g-akh5s-fkyqc-zy6q7-snav6-uqe --amount .25 --network ic If the transaction is successful, the ledger records the event and you should see output similar to the following: @@ -179,11 +179,11 @@ To transfer ICP tokens to create a cycles wallet: 2. Install the cycles wallet code in the newly-created canister placeholder by running a command similar to the following: - dfx identity --network ic deploy-wallet + dfx identity deploy-wallet --network ic For example: - dfx identity --network ic deploy-wallet gastn-uqaaa-aaaae-aaafq-cai + dfx identity deploy-wallet gastn-uqaaa-aaaae-aaafq-cai --network ic This command displays output similar to the following: @@ -198,7 +198,7 @@ To validate your cycles wallet: 1. Verify the canister identifier for the cycles wallet you deployed by running the following command: - dfx identity --network ic get-wallet + dfx identity get-wallet --network ic The command displays the canister identifier for your cycles wallet with output similar to the following: @@ -206,7 +206,7 @@ To validate your cycles wallet: 2. Check that your cycles wallet canister is properly configured and holds a balance of cycles by running a command similar to the following: - dfx wallet --network ic balance + dfx wallet balance --network ic The command returns the balance for the your cycles wallet. For example: @@ -232,7 +232,7 @@ To validate your cycles wallet: For example, call the `authorize` method for the cycles wallet canister with a command similar to the following: - dfx canister --network ic call "gastn-uqaaa-aaaae-aaafq-cai" authorize '(principal "ejta3-neil3-qek6c-i7rdw-sxreh-lypfe-v6hjg-6so7x-5ugze-3iohr-2qe")' + dfx canister call "gastn-uqaaa-aaaae-aaafq-cai" authorize '(principal "ejta3-neil3-qek6c-i7rdw-sxreh-lypfe-v6hjg-6so7x-5ugze-3iohr-2qe")' --network ic Be sure that the command you copy has the correct network (`ic`) alias. You should recognize the canister identifier—in this example, `gastn-uqaaa-aaaae-aaafq-cai`—as the cycles wallet associated with your identity. If this is your first wallet on the IC, however, you might not recognize the principal being authorized. The use of a different principal is the expected behavior in this case. @@ -299,7 +299,7 @@ To deploy your first application on the Internet Computer blockchain mainnet: If you didn’t convert enough ICP tokens to cycles to complete the operation, you can add cycles to your cycles wallet by running a command similar to the following: - dfx ledger --network ic top-up gastn-uqaaa-aaaae-aaafq-cai --amount 1.005 + dfx ledger top-up gastn-uqaaa-aaaae-aaafq-cai --amount 1.005 --network ic This command converts an additional `1.005` ICP tokens to cycles for the `gastn-uqaaa-aaaae-aaafq-cai` cycles wallet identifier. The command returns output similar to the following: @@ -308,14 +308,12 @@ To deploy your first application on the Internet Computer blockchain mainnet: 4. Call the `hello` canister and the predefined `greet` function by running the following command: - dfx canister --network ic call hello greet '("everyone": text)' + dfx canister call hello greet '("everyone": text)' --network ic Let’s take a closer look at this example: - Using the `--network ic` option indicates that the canister you want to call is deployed on the `ic`. The `ic` network alias is an internally-reserved alias for accessing the Internet Computer blockchain mainnet. - - Note that the `--network ic` option must precede the operation subcommand, which, in this case, is the `dfx canister call` command. - - The `hello` argument specifies the name of the canister you want to call. - The `greet` argument specifies the name of the function you want to call in the `hello` canister. @@ -342,7 +340,7 @@ To access the dapp frontend: If you didn’t make a note of the canister identifier, you can look it up by running the following command: - dfx canister --network ic id hello_assets + dfx canister id hello_assets --network ic For example, the full URL should look similar to the following: diff --git a/docs/samples/deploying-your-first-bitcoin-dapp.md b/docs/samples/deploying-your-first-bitcoin-dapp.md index 0a6475de76..dff3e83505 100644 --- a/docs/samples/deploying-your-first-bitcoin-dapp.md +++ b/docs/samples/deploying-your-first-bitcoin-dapp.md @@ -58,7 +58,7 @@ generate a P2PKH Bitcoin address: Or, if you prefer the command line: - dfx canister --network=ic call basic_bitcoin get_p2pkh_address + dfx canister call basic_bitcoin get_p2pkh_address --network=ic :::note @@ -93,7 +93,7 @@ In the Candid UI, paste in your canister's address, and click on "Call": Alternatively, make the call using the command line: - dfx canister --network=ic call basic_bitcoin get_balance '("mheyfRsAQ1XrjtzjfU1cCH2B6G1KmNarNL")' + dfx canister call basic_bitcoin get_balance '("mheyfRsAQ1XrjtzjfU1cCH2B6G1KmNarNL")' --network=ic Checking the balance of a Bitcoin address relies on the [bitcoin_get_balance](https://internetcomputer.org/docs/current/references/ic-interface-spec/#ic-bitcoin_get_balance) API. @@ -108,7 +108,7 @@ below, we're sending 4,321 Satoshi (0.00004321 BTC) back to the testnet faucet. Via command line, the same call would look like this: - dfx canister --network=ic call basic_bitcoin send '(record { destination_address = "tb1ql7w62elx9ucw4pj5lgw4l028hmuw80sndtntxt"; amount_in_satoshi = 4321; })' + dfx canister call basic_bitcoin send '(record { destination_address = "tb1ql7w62elx9ucw4pj5lgw4l028hmuw80sndtntxt"; amount_in_satoshi = 4321; })' --network=ic The `send` endpoint is able to send Bitcoin by: diff --git a/docs/samples/host-a-website.md b/docs/samples/host-a-website.md index c004fa9d73..963b4f8174 100644 --- a/docs/samples/host-a-website.md +++ b/docs/samples/host-a-website.md @@ -135,7 +135,7 @@ You should see some output in your console, and a success message looking someth Find your new canister’s ID by running - dfx canister --network ic id website + dfx canister id website --network ic Take that canister ID and visit https://<canister-id>.ic0.app, inserting your own canister ID as the subdomain in the URL. diff --git a/docs/tokenomics/token-holders/nns-app-quickstart.md b/docs/tokenomics/token-holders/nns-app-quickstart.md index ccc4d2ed91..03ff5f0c2c 100644 --- a/docs/tokenomics/token-holders/nns-app-quickstart.md +++ b/docs/tokenomics/token-holders/nns-app-quickstart.md @@ -127,13 +127,13 @@ To transfer ICP utility tokens controlled by your developer identity: 4. Check the current balance in the ledger account associated with your identity by running the following command: ``` bash - dfx ledger --network ic balance + dfx ledger balance --network ic ``` 5. Transfer ICP utility tokens to your Main account or a linked subaccount you create by running a command similar to the following: ``` bash - dfx ledger --network ic transfer --icp --memo + dfx ledger transfer --icp --memo --network ic ``` For example, assume you have the following accounts: @@ -142,11 +142,11 @@ To transfer ICP utility tokens controlled by your developer identity: If you want to transfer one ICP utility token to the `Main` account, you can run the following command: - dfx ledger --network ic transfer dd81336dbfef5c5870e84b48405c7b229c07ad999fdcacb85b9b9850bd60766f --memo 12345 --icp 1 + dfx ledger transfer dd81336dbfef5c5870e84b48405c7b229c07ad999fdcacb85b9b9850bd60766f --memo 12345 --icp 1 --network ic If you also want to transfer one ICP utility token to the `pubs` account, you can run the following command: - dfx ledger --network ic transfer 183a04888eb20e73766f082bae01587830bd3cd912544f63fda515e9d77a96dc --icp 1 --memo 12346 + dfx ledger transfer 183a04888eb20e73766f082bae01587830bd3cd912544f63fda515e9d77a96dc --icp 1 --memo 12346 --network ic This example illustrates how to transfer ICP utility tokens to using a whole number with the `--icp` command-line option. diff --git a/docs/tokenomics/token-holders/self-custody-quickstart.md b/docs/tokenomics/token-holders/self-custody-quickstart.md index f371545575..2010813898 100644 --- a/docs/tokenomics/token-holders/self-custody-quickstart.md +++ b/docs/tokenomics/token-holders/self-custody-quickstart.md @@ -115,7 +115,7 @@ To connect to the ledger and get account information: 6. Check your account balance by running the following command: ``` bash - dfx ledger --network ic balance + dfx ledger balance --network ic ``` This command displays the ICP token balance from the ledger account. For example, you should see output similar to the following: @@ -131,14 +131,14 @@ To convert ICP tokens to cycles: 1. Create a new canister with cycles by transferring ICP tokens from your ledger account by running a command similar to the following: ``` bash - dfx ledger --network ic create-canister --amount + dfx ledger create-canister --amount --network ic ``` This command converts the number of ICP tokens you specify for the `--amount` argument into cycles, and associates the cycles with a new canister identifier controlled by the principal you specify. For example, the following command converts 1.25 ICP tokens into cycles and specifies the principal identifier for the default identity as the controller of the new canister: - dfx ledger --network ic create-canister tsqwz-udeik-5migd-ehrev-pvoqv-szx2g-akh5s-fkyqc-zy6q7-snav6-uqe --amount 1.25 + dfx ledger create-canister tsqwz-udeik-5migd-ehrev-pvoqv-szx2g-akh5s-fkyqc-zy6q7-snav6-uqe --amount 1.25 --network ic If the transaction is successful, the ledger records the event and you should see output similar to the following: @@ -148,12 +148,12 @@ To convert ICP tokens to cycles: 2. Install the cycles wallet code in the newly-created canister placeholder by running a command similar to the following: ``` bash - dfx identity --network ic deploy-wallet + dfx identity deploy-wallet --network ic ``` For example: - dfx identity --network ic deploy-wallet 53zcu-tiaaa-aaaaa-qaaba-cai + dfx identity deploy-wallet 53zcu-tiaaa-aaaaa-qaaba-cai --network ic This command displays output similar to the following: @@ -175,18 +175,18 @@ To transfer ICP tokens to another account: 2. Check the current balance in the ledger account associated with your identity by running the following command: ``` bash - dfx ledger --network ic balance + dfx ledger balance --network ic ``` 3. Transfer ICP tokens to another account by running a command similar to the following: ``` bash - dfx ledger --network ic transfer --icp --memo + dfx ledger transfer --icp --memo --network ic ``` For example: - dfx ledger --network ic transfer ae6e1a76da5725bbbf0c5c035aaf0525b791e0f0f7cce27d8e27826389871406 --icp 5 --memo 12345 + dfx ledger transfer ae6e1a76da5725bbbf0c5c035aaf0525b791e0f0f7cce27d8e27826389871406 --icp 5 --memo 12345 --network ic This example illustrates how to transfer ICP tokens to the specified account using a whole number with the `--icp` command-line option.