Dfx 0.20.1 is promoted

dfx 0.20.1 has been promoted. A few highlights of this release include new wasm memory soft limits, better error formatting and messages, extension-defined canister types, and the ability to specify an init_arg file in dfx.json. Please try it out and let us know what you think. If you run into any problems, drop a note here or raise an issue on GitHub. Thanks!

See the full changelog here: Release 0.20.1 · dfinity/sdk · GitHub

5 Likes

I’m trying to use the new init_arg_file field in dfx.json but it fails:

Here’s my dfx.json:

{
  "canisters": {
    "icp_ledger": {
      "type": "custom",
      "candid": "https://raw.githubusercontent.com/dfinity/ic/ec35ebd252d4ffb151d2cfceba3a86c4fb87c6d6/rs/rosetta-api/icp_ledger/ledger.did",
      "wasm": "https://download.dfinity.systems/ic/ec35ebd252d4ffb151d2cfceba3a86c4fb87c6d6/canisters/ledger-canister.wasm.gz",
      "remote": {
        "id": {
          "ic": "ryjl3-tyaaa-aaaaa-aaaba-cai"
        }
      },
      "init_arg_file": "src/candid/icp_ledger_init.did"
    },
    ...

Here’s the content of my icp_ledger_init.did file:

(variant {
  Init = record {
    minting_account = "$MINTER_ACCOUNT_ID";
    initial_values = vec {
      record {
        "$DEFAULT_ACCOUNT_ID";
        record {
          e8s = 10_000_000_000 : nat64;
        };
      };
    };
    send_whitelist = vec {};
    transfer_fee = opt record {
      e8s = 10_000 : nat64;
    };
    token_symbol = opt "LICP";
    token_name = opt "Local ICP";
  }
})

It says “Unable to decode init argument”, so I’m guessing I have a syntax error somewhere. Any idea? Is there any where I can get a more explicit error message?

Thanks!

Do you have this literally in there or is this some edit for readability? It does not interpret env vars AFAIK

Literally :grimacing:
Any way I can have it load dynamically in there?

You can have a build script modify the file

1 Like