The dfx ledger account-id
can now compute addresses of principals and canisters.
The command also supports ledger subaccounts now.
dfx ledger account-id --of-principal 53zcu-tiaaa-aaaaa-qaaba-cai
dfx ledger --network small02 account-id --of-canister ledger_demo
dfx ledger account-id --of-principal 53zcu-tiaaa-aaaaa-qaaba-cai --subaccount 0000000000000000000000000000000000000000000000000000000000000001
All dfx
commands will now print the full stack of errors that led to the problem, not just the most recent error.
Example:
Error: Subaccount '00000000000000000000000000000000000000000000000000000000000000000' is not a valid hex string
Caused by:
Odd number of digits
Breaking change: Canister commands, except for dfx canister create
, will make the call directly, rather than via the user’s wallet. The --no-wallet
flag is thus removed from dfx canister
as its behavior is the default.
When working with existing canisters, use the --wallet
flag in conjunction with dfx identity get-wallet
in order to restore the old behavior.
You will need to upgrade your wallet and each of your existing canisters to work with the new system. To do so, execute the following in each of your dfx projects:
dfx wallet upgrade
dfx canister --wallet "$(dfx identity get-wallet)" update-settings --all --add-controller "$(dfx identity get-principal)"
To upgrade projects that you have deployed to the IC mainnet, execute the following:
dfx wallet --network ic upgrade
dfx canister --network ic --wallet "$(dfx identity --network ic get-wallet)" update-settings --all --add-controller "$(dfx identity get-principal)"
dfx canister update-settings
previously only let you overwrite the entire controller list; --add-controller
and --remove-controller
instead add or remove from the list.
dfx canister delete --no-withdrawal <canister>
can be used to delete a canister without attempting to withdraw cycles.
This matches the value used in production and is meant to exceed the configured 5 MB wasmtime stack.
Updated Motoko from 0.6.11 to 0.6.20.
-
Implement type union/intersection
-
Transform for-loops on arrays into while-loops
-
Tighten typing rules for type annotations in patterns
-
Candid decoding: skip vec any fast
-
Bump up MAX_HP_FOR_GC from 1GB to 3GB
-
Candid decoder: Trap if a principal value is too large
-
Eliminate bignum calls from for-iteration on arrays
-
Improve scheduling
-
Improve performance of bignum equality
-
Stable signatures: frontend, metadata, command-line args
-
Added heartbeat support
Module hash: 53ec1b030f1891bf8fd3877773b15e66ca040da539412cc763ff4ebcaf4507c5 https://github.com/dfinity/cycles-wallet/commit/57e53fcb679d1ea33cc713d2c0c24fc5848a9759
You can now declare "rust" canisters in dfx.json.
{
"canisters": {
"canister_name": {
"type": "rust",
"package": "crate_name",
"candid": "path/to/canister_name.did"
}
}
}
Don’t forget to place a Cargo.toml
in your project root.
Then dfx will build the rust canister with your rust toolchain.
Please also make sure that you have added the WebAssembly compilation target.
rustup target add wasm32-unknown-unknown
You can also create new dfx project with a default rust canister.
dfx new --type=rust <project-name>
Updates dependencies to latest for Webpack, and updates config. Additionally simplifies environment variables for canister ID’s in config.
Additionally adds some polish to the starter template, including a favicon and using more semantic html in the example app
You can now override the location of any executable normally called from the cache by specifying
an environment variable. For example, DFX_ICX_PROXY_PATH will specify the path for icx-proxy
.
dfx deploy
can now reinstall a single canister, controlled by a new --mode=reinstall
parameter.
This is destructive (it resets the state of the canister), so it requires a confirmation
and can only be performed on a single canister at a time.
dfx canister install --mode=reinstall <canister>
also requires the same confirmation,
and no longer works with --all
.
The included replica now supports canister_heartbeat. This only works with rust canisters for the time being,
and does not work with the emulator (dfx start --emulator
).
This means dfx start --emulator
has a chance of working if nix is not installed.
This has always been broken, even before dfx 0.7.0.
This means dfx start
will work again on linux. This bug was introduced in dfx 0.8.2.
The --no-artificial-delay
option not being the default has been causing a lot of confusion.
Now that we have measured in production and already applied a default of 600ms to most subnets deployed out there,
we have set the same default for dfx and removed the option.
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.