By default dfx canister delete
will return cycles to the default cycles wallet.
Cycles can be returned to a designated canister with --withdraw-cycles-to-canister
and
cycles can be returned to dank at the current identity principal with --withdraw-cycles-to-dank
and to a designated principal with --withdraw-cycles-to-dank-principal
.
It is now possible to create canisters with more than one controller by
passing multiple instances of the --controller parameter to `dfx canister create
.
You will need to upgrade your wallet with dfx wallet upgrade
, or dfx wallet --network ic upgrade
It is now possible to configure a canister to have more than one controller by
passing multiple instances of the --controller parameter to `dfx canister update-settings
.
Breaking change: The controller parameter for dfx canister create
is now passed as a named parameter,
rather than optionally following the canister name.
Old: dfx canister create [canister name] [controller] New: dfx canister create --controller <controller> [canister name]
Previously this would always look in $HOME/.dfinity/identity/creds.pem
.
-
Module hash: 9183a38dd2eb1a4295f360990f87e67aa006f225910ab14880748e091248e086
-
https://github.com/dfinity/cycles-wallet/commit/9ef38bb7cd0fe17cda749bf8e9bbec5723da0e95
The included replica now supports public spec 0.18.0
-
Canisters can now have more than one controller
-
Adds support for 64-bit stable memory
-
The replica now goes through an initialization sequence, reported in its status as
replica_health_status
. Until this reports ashealthy
, queries or updates will fail.-
dfx start --background
waits to exit untilreplica_health_status
ishealthy
. -
If you run
dfx start
without--background
, you can calldfx ping --wait-healthy
to wait until the replica is healthy.
-
Updated Motoko from 0.6.7 to 0.6.10
-
add Debug.trap : Text → None (motoko-base #288)
-
Introduce primitives for
Int
⇔Float
conversions (#2733) -
Fix crashing bug for formatting huge floats (#2737)
dfx generate
This new command will generate type declarations for canisters in dfx.json.
You can control what will be generated and how with corresponding configuration in dfx.json.
Under dfx.json → "canisters" → "<canister_name>", developers can add a "declarations" config. Options are:
-
"output" → directory to place declarations for that canister | default is "src/declarations/<canister_name>"
-
"bindings" → [] list of options, ("js", "ts", "did", "mo") | default is "js", "ts", "did"
-
"env_override" → a string that will replace process.env.{canister_name_uppercase}_CANISTER_ID in the "src/dfx/assets/language_bindings/canister.js" template.
js declarations output
-
index.js (generated from "src/dfx/assets/language_bindings/canister.js" template)
-
<canister_name>.did.js - candid js binding output
ts declarations output
-
<canister_name>.did.d.ts - candid ts binding output
did declarations output
-
<canister_name>.did - candid did binding output
mo declarations output
-
<canister_name>.mo - candid mo binding output
Use it with either of these forms:
dfx identity use anonymous
dfx --identity anonymous ...
Default identities are the pem files generated by dfx identity new …
which contain Ed25519 private keys.
They are located at ~/.config/dfx/identity/xxx/identity.pem
.
Now, you can copy such pem file to another computer and import it there.
dfx identity new alice
cp ~/.config/dfx/identity/xxx/identity.pem alice.pem
# copy the pem file to another computer, then
dfx identity import alice alice.pem
Before, people can manually copy the pem files to the target directory to "import". Such workaround still works.
We suggest to use the import
subcommand since it also validate the private key.
When the caller provides SHA-256 hashes (which dfx does), the asset canister will no longer recompute these hashes when committing the changes. These recomputations were causing canisters to run out of cycles, or to attempt to exceed the maximum cycle limit per update.
The 0.8.0 release includes updates and fixes that are primarily internal to improve existing features and functions rather than user-visible.
This was intended to skip verification of the wallet canister on the IC network, but ended up only writing to the wallets.json file if --force was passed.
-
Support for the latest version of the {IC} specification and replica.
-
Updating to latest versions of Motoko, Candid, and agent-rs
-
Changes to
dfx new
project template and JavaScript codegen to support type inference in IDE’s -
Adding webpack dev server to project template
-
Migration path documented at https://sdk.dfinity.org/docs/release-notes/0.8.0-rn.html
Breaking changes to frontend code generation, documented in 0.8.0
dfx deploy and dfx canister install now compare the hash of the already-installed module with the hash of the built canister’s wasm output. If they are the same, they leave the canister in place rather than upgrade it. They will still synchronize assets to an asset canister regardless of the result of this comparison.
The streaming callback mechanism now requires the following record structure for the token: type StreamingCallbackToken = record { key: text; content_encoding: text; index: nat; sha256: opt blob; };
Previously, the token could be a record with any set of fields.
-
Module hash: 1404b28b1c66491689b59e184a9de3c2be0dbdd75d952f29113b516742b7f898
-
https://github.com/dfinity/cycles-wallet/commit/e902708853ab621e52cb68342866d36e437a694b
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
.
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
.
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.
This change introduces the deposit_cycles
and uninstall_code
management canister
methods as dedicated dfx canister
subcommands.
This change allows you to specify the format the return result for dfx canister request-status
.
This change fixes a bug where deleting a canister on a network removed all other entries for the canister in the canister_ids.json file.
--network ic
now points to the mainnet IC (as Sodium has been deprecated.)
The dedicated candid UI canister is installed on a local network when doing a dfx canister install
or dfx deploy
.
This fixes an error which occurred when starting a replica right after stopping it.
dfx now supports a dedicated dfx ledger
subcommand. This allows you to interact with the ledger
canister installed on the Internet Computer. Example commands include dfx ledger account-id
which
prints the Account Identifier associated with your selected identity, dfx ledger transfer
which
allows you to transfer ICP from your ledger account to another, and dfx ledger create-canister
which
allows you to create a canister from ICP.
This is a breaking change to support 0.17.0 of the Interface Spec. Compute & memory allocation values
are set when creating a canister. An optional controller can also be specified when creating a canister.
Furthermore, dfx canister set-controller
is removed, in favor of dfx canister update-settings
which
allows the controller to update the controller, the compute allocation, and the memory allocation of the
canister. The freezing threshold value isn’t exposed via dfx cli yet, but it may still be modified by
calling the management canister via dfx canister call aaaaa-aa update-settings
dfx now supports a dedicated dfx wallet
subcommand. This allows you to interact with the cycles wallet
associated with your selected identity. For example, dfx wallet balance
to get the cycle balance,
dfx wallet list-addresses
to display the associated controllers & custodians, and dfx wallet send <destination> <amount>
to send cycles to another wallet.
-
Module Hash: a609400f2576d1d6df72ce868b359fd08e1d68e58454ef17db2361d2f1c242a1
-
https://github.com/dfinity/cycles-wallet/commit/06bb256ca0738640be51cf84caaced7ea02ca29d
-
Module Hash: 3d5b221387875574a9fd75b3165403cf1b301650a602310e9e4229d2f6766dcc
-
https://github.com/dfinity/cycles-wallet/commit/c3cbfc501564da89e669a2d9de810d32240baf5f
feat: add --no-wallet flag and --wallet option to allow Users to bypass Wallet or specify a Wallet to use for calls (#1476)
Added --no-wallet
flag to dfx canister
and dfx deploy
. This allows users to call canister management functionality with their Identity as the Sender (bypassing their Wallet canister.)
Added --wallet
option to dfx canister
and dfx deploy
. This allows users to specify a wallet canister id to use as the Sender for calls.
--wallet
and --no-wallet
conflict with each other. Omitting both will invoke the selected Identity’s wallet canister to perform calls.
Users can use dfx canister sign …
to generated a signed canister call in a json file. Then dfx canister send [message.json]
to the network.
Users can sign the message on an air-gapped computer which is secure to host private keys.
-
sign
andsend
currently don’t proxy through wallet canister. Users should use the subcommands withdfx canister --no-wallet sign …
. -
The
sign
option--expire-after
will set theingress_expiry
to a future timestamp which is current plus the duration. Then users can send the message during a 5 minutes time window ending in thatingress_expiry
timestamp. Sending the message earlier or later than the time window will both result in a replica error.
And add support for http requests in the base storage canister (with a default to /index.html
).
This does not support other encodings than identity
for now (and doesn’t even return any headers). This support will be added to the upgraded asset storage canister built in #1482.
Added a test that uses curl localhost
to test that the asset storage AND the webserver properly support the http requests.
This commit also upgrades tokio and reqwest in order to work correctly. There are also some performance issues noted (this is slower than the icx-http-server
for some reason), but those are not considered criticals and could be improved later on.
Renamed the project_name
in our own generated assets to canister_name
, for things that are generated during canister build (and not project generation).
You can now a generate private key via OpenSSL or a simlar tool, import it into dfx, and use it to sign an ingress message.
openssl ecparam -name secp256k1 -genkey -out identity.pem
dfx identity import <name> identity.pem
dfx identity use <name>
dfx canister call ...
-
Please note that neither the JS agent nor the HTTP server have been updated yet to server such large assets.
-
The existing interface is left in place for backwards-compatibility, but deprecated:
-
retrieve(): use get() and get_chunk() instead
-
store(): use create_batch(), create_chunk(), and commit_batch() instead
-
list(): use keys() instead
-
-
feat: dfx now provides CANISTER_ID_<canister_name> environment variables for all canisters to "npm build" when building the frontend.
-
feat: add option to specify initial cycles for newly created canisters (#1433)
Added option to dfx canister create
and dfx deploy
commands: --with-cycles <with-cycles>
.
This allows the user to specify the initial cycle balance of a canister created by their wallet.
This option is a no-op for the Sodium network.
dfx canister create --with-cycles 8000000000 some_canister
dfx deploy --with-cycles 8000000000
Help string:
Specifies the initial cycle balance to deposit into the newly
created canister. The specified amount needs to take the
canister create fee into account. This amount is deducted
from the wallet's cycle balance
-
feat: install
dfx
by version or tag (#1426)
This feature adds a new dfx command toolchain
which have intuitive subcommands.
The toolchain specifiers can be a complete version number, major minor version, or a tag name.
dfx toolchain install 0.6.24 # complete version
dfx toolchain install 0.6 # major minor
dfx toolchain install latest # tag name
dfx toolchain default latest
dfx toolchain list
dfx toolchain uninstall latest
-
fix: onboarding related fixups (#1420)
Now that the Mercury Alpha application subnetwork is up and we are getting ready to onboard devs, the dfx error message for wallet creation has changed: For example,
dfx canister --network=alpha create hello
Creating canister "hello"...
Creating the canister using the wallet canister...
Creating a wallet canister on the alpha network.
Unable to create a wallet canister on alpha:
The Replica returned an error: code 3, message: "Sender not authorized to use method."
Wallet canisters on alpha may only be created by an administrator.
Please submit your Principal ("dfx identity get-principal") in the intake form to have one created for you.
-
feat: add deploy wallet subcommand to identity (#1414)
This feature adds the deploy-wallet subcommand to the dfx identity. The User provides the ID of the canister onto which the wallet WASM is deployed.
dfx identity deploy-wallet --help
dfx-identity-deploy-wallet
Installs the wallet WASM to the provided canister id
USAGE:
dfx identity deploy-wallet <canister-id>
ARGS:
<canister-id> The ID of the canister where the wallet WASM will be deployed
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
-
feat: dfx call random value when argument is not provided (#1376)
-
fix: canister call can take canister ids for local canisters even if … (#1368)
-
fix: address panic in dfx replica command (#1338)
-
fix: dfx new webpack.config.js does not encourage running 'js' through ts-… (#1341)
-
There have been updates, improvements, and new sample apps added to theexamples repository.
All of Motoko sample apps in the examples repository have been updated to work with the latest release of the SDK.
There are new sample apps to illustrate using arrays (Quicksort) and building create/read/update/delete (CRUD) operations for a web application Superheroes.
-
The LinkedUp sample application has been updated to work with the latest release of Motoko and the SDK.