EDIT: I was wrong. See posts below instead There is the field canisters.<canister name>.args in dfx.json that takes a string with a candid argument inside to use when deploying the canister. Is this sufficient or is it necessary to have network-specific arguments?
Which option do you mean exactly?
Accept a file path as part of dfx.json’s canisters.<canister name>.args field or
Installing canisters...
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
Failed while trying to install all canisters.
Failed to install wasm module to canister 'evm_rpc'.
Failed to create argument blob.
Invalid data: Expected arguments but found none.
Turns out I’m bad at reading our own code. Quoting from the dfx.json schema:
init_arg: The Candid initialization argument for installing the canister. If the --argument or --argument-file argument is also provided, this init_arg field will be ignored.
args: This field defines an additional argument to pass to the Motoko compiler when building the canister.
Is there any way to put shell escapes into init_arg like I would use $(dfx canister id <name>) in a dfx deploy command? Or some other way to achieve a “dynamic” init_arg?
Right now we don’t have a way to make arguments dynamic, but we’ve shortlisted this feature request as one of the things we want to do in the very near future (although not scheduled yet)