SDK 0.7.1
New features and capabilities
The most significant new features and capabilities include the following updates for DFX commands:
-
An update to the
dfx canister signcommand enables you to signrequest_statusmessages for update calls.If you are using
dfx canister signto call a method that generates an update message, the command also signs a correspondingrequest_statusmessage and appends it to themessage.jsonfile assigned_request_status. After you send the message using thedfx canister sendcommand, you can check therequest_statusof the call by running the following command:dfx canister send message.json --status
This change is particularly useful if you are using the
dfx canister signanddfx canister sendcommands to call theledgerorgovernancecanister to make a transaction or stake tokens as a two-step process. -
There are new
deposit_cyclesanduninstall_codemanagement canister methods that are also exposed asdfx canistersubcommands.The two new commands are
dfx canister deposit-cyclesanddfx canister uninstall-code. For example, you can now send cycles from your cycles wallet to a specific canister by running a command similar to the following:dfx canister deposit-cycles 125000000000 hello_world
You can uninstall code for a deployed WASM module by running a command similar to the following:
dfx canister uninstall-code hello_world
-
A new
--no-artificial-delayoption enables you to reduce the time it takes for the local Internet Computer to start.This change adds the
--no-artificial-delayflag todfx startanddfx replicacommands. By default, the local Internet Computer replica that is installed with the SDK has an artificial consensus delay to simulate the delay users might see in a networked environment. With this new flag, you can skip the built-in delay when you start the local Internet Computer by running either thedfx start --no-artificial-delayordfx replica --no-artificial-delaycommand.For example, you can start the local Internet Computer without a delay by running the following command:
dfx start -no-artificial-delay
If you use this option, however, you might an increase in the CPU used by the local Internet Computer replica.
Breaking change
The SDK version 0.7.1 introduces a change to the default principal used when you run dfx canister call commands. Depending on the version of the SDK that you were previously using, this change might require changes to your program code or to the way you call methods in deployed canisters.
-
The cycles wallet canister identifier is not longer used as the message caller by default.
In some previous versions of the SDK, the
dfx canister callcommand would use the cycles wallet canister identifier as the message caller to perform queries and update calls by default.The
--no-walletcommand-line option was introduced to allow you to bypass the cycles wallet canister identifier and perform query and update calls using the currently-selected identity.However, using the cycles wallet canister identifier to execute
dfx canister callcommands resulted in each call being treated as an inter-canister call and the calls would take longer than necessary to resolve.With this release,
dfx canister callcommands no longer use the cycles wallet canister identifier to execute query and update calls by default. If you want to execute a query or update call using the cycles wallet, you can run a command similar to the following:dfx canister --wallet=cycles-wallet-id call canister method
DFX
feat: sign request_status for update call
When using dfx canister sign to generate a update message, a corresponding
request_status message is also signed and append to the json as signed_request_status.
Then after sending the update message, the user can check the request_status using
dfx canister send message.json --status.
fix: wallet will not proxy dfx canister call by default
Previously, dfx canister call would proxy queries and update calls via the wallet canister by default.
(There was the --no-wallet flag to bypass the proxy and perform the calls as the selected identity.)
However, this behavior had drawbacks, namely each dfx canister call was an inter-canister call
by default and calls would take a while to resolve. This fix makes it so that dfx canister call no longer
proxies via the wallet by default. To proxy calls via the wallet, you can do
dfx canister --wallet=<wallet-id> call.
feat: add --no-artificial-delay to dfx replica and start
This change adds the --no-artificial-delay flag to dfx start and dfx replica.
The replica shipped with dfx has always had an artificial consensus delay (introduced to simulate
a delay users might see in a networked environment.) With this new flag, that delay can
be lessened. However, you might see increased CPU utilization by the replica process.
feat: add deposit cycles and uninstall code
This change introduces the deposit_cycles and uninstall_code management canister
methods as dedicated dfx canister subcommands.
fix: allow consistent use of canisters ids in canister command
This change updates the dfx commands so that they will accept either a canister name
(sourced from your local project) or a valid canister id.