Highlights of what’s new in 0.6.24

The 0.6.24 release primarily consists of changes to support new features that are not yet complete, including fixes and updates to DFX commands, Motoko, the Motoko base library, and Candid.

New features and capabilities

The most significant new features and capabilities include updates in the following functional areas:

DFX

  • With this release, you must have a wallet canister with cycles to deploy or manage applications on the Internet Computer.

    For local development, dfx automatically creates a wallet for you when you run dfx canister create or dfx deploy commands within each project.

    Wallets are also created automatically if you deploy to the Internet Computer using the ic network alias before the network is upgraded to require a cycle balance.

    To deploy and manage applications on the main Internet Computer network, you must provide the DFINITY Foundation with a principal associated with your user identity and receive a wallet canister identifier in return.

    To deploy applications on the Internet Computer network:

    1. Download and install the DFINITY Canister SDK.

    2. Run the dfx identity get-principal command to create your default identity and principal:

      dfx identity get-principal

      Running the command displays output similar to the following:

      Creating the "default" identity.
        - generating new key at /Users/pubs/.config/dfx/identity/default/identity.pem
      Created the "default" identity.
      wre5u-xietp-k5jz4-sdaaz-g3x4l-zjzxa-lxnly-fp2mk-j3j77-25qat-pqe
    3. Run the dfx identity set-wallet command to associate your wallet canister identifier with your default identity.

      dfx identity set-wallet <wallet-canister-identifier>
    4. Open the wallet application in a web browser by navigating to the canister with a URL similar to the following:

      https://<WALLET-CANISTER-ID>.ic0.app
  • A new command-line option enables you to specify the number of initial cycles to transfer to a newly-created canister.

    The dfx canister create and dfx deploy commands now support a new --with-cycles <number-of-cycles> option. This option allows you to specify the initial cycle balance of a canister created by your wallet.

    You can use this option when running the Internet Computer network locally or connected to the current ic network (Sodium) for testing purposes. However, because wallets and cycle balances are not currently used for canisters you create while connected to the current ic network (Sodium), the --with-cycles option does not affect any canister operations.

    For example, you might run the following dfx canister create command to initialize 8000000000 cycles for all of the canisters in a project:

    dfx canister create --with-cycles 8000000000 --all

    If using dfx deploy, you might run the following command to initialize 8000000000 cycles for the backend canister in a project:

    dfx deploy --with-cycles 8000000000 backend
    You must have a wallet canister with a cycles balance on the network where you want to create or deploy additional canisters.
  • You can now use the new dfx toolchain command to manage the version of the dfx command-line interface you are using for your projects.

    The dfx toolchain command enables you to install, uninstall, and set the default version of dfx that you want to use. You can specify the version by the complete version number, the major and minor version number, or a tag name. For example:

    dfx toolchain install 0.6.24 # complete version
    dfx toolchain install 0.6    # major minor version
    dfx toolchain install latest # tag name
  • A new deploy-wallet subcommand enables you to specify the canister identifier for your cycles wallet WebAssembly module (WASM).

    For example, if you have an account with a third party exchange provider and receive a wallet canister identifier, you can run a command similar to the following to deploy the wallet and uses its cycles for development:

    dfx identity deploy-wallet <canister-identifier>
    The deploy-wallet feature is intended for a future use case. The command is only applicable if you received the wallet canister identifier as part of a transfer operation that converted ICP tokens to cycles. In addition, the deploy-wallet subcommand is not intended for use with the current version of Internet Computer running locally or on the remote network.

Candid

  • New Candid documentation for developers provides type mapping information for Rust and JavaScript.

  • Candid now supports additional native Rust types and Typescript.

  • For additional information, see the Candid changelog.

Motoko

  • The Motoko compiler (moc) now accepts the -Werror flag to turn warnings into errors.

  • The language server now returns documentation comments alongside completions and hover notifications.

  • Motoko supports wrapping arithmetic and bit-wise operations on NatN and IntN.

    The conventional arithmetic operators on NatN and IntN trap on overflow. If wrap-around semantics is desired, the operators +%, -%, % and *% can be used. The corresponding assignment operators (+%= etc.) are also available.

    Likewise, the bit fiddling operators (&, |, ^, <<, >>, <<>,<>> etc.) are now also available on NatN and IntN. The right shift operator (>>) is an unsigned right shift on NatN and a signed right shift on IntN; the +>> operator is not available on these types.

    The motivation for this change is to eventually deprecate and remove the WordN types. Therefore, the wrapping arithmetic operations on WordN are deprecated and their use will print a warning. For information about replacing Word types, see Word types.

  • For values x of type Blob, an iterator over the elements of the blob x.vals() is introduced. It works like x.bytes(), but returns the elements as type Nat8.

  • The base library documentation tool mo-doc now generates cross-references for types in signatures. With this enhancement, when you view a signature like fromIter : I.Iter<Nat> → List.List<Nat>, you can click I.Iter or List.List to navigate to the appropriate definition.

  • Improvements to the type checker and compiler provide better handling for object literals.

Issues fixed in this release

This section covers any reported issues that have been fixed in this release.

Known issues and limitations

This section covers any known issues or limitations that might affect how you work with the DFINITY Canister SDK in specific environments or scenarios.