-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: dynamic wasm_url and wasm_hash #3325
Conversation
Thanks @lwshang for working on this. However, there is still one case that is not clear to me how to solve: The issue of multiple build types. Example: Our
Depending on the environment variables you set, I.e. we can run Now, to build the prod build correctly, embedding the dev build hash in the metadata we would have to do this (if I understand correctly):
However, now What we would like to have is this:
In order to do that, we need some way of dynamically opting-out of including a hash or we need a proper representation of build flavours of the same(!) canister in |
@frederikrothenberger Thanks for the feedback! It is my goal to make this feature works for internet-identity. The While it is still possible to deploy the It does no harm to embed If the main concern is the extra build time, we can optimize that by altering the generate script. |
This is really confusing. Now there are two different dev builds: One with the hash embedded of the other, but both pullable. One self-referencing and the other pointing to the non-hash-embedded one...
This requires modifying the Just give us the option to have the |
#3510 instead |
Description
Implement SDK-1211
wasm_url
andwasm_hash
might need to be calculated dynamically during canister build.wasm_url
Beyond setting
wasm_url
directly, you can generate it into a file with configuration indfx.json
like:You can only set one of
wasm_url
anddynamic_wasm_url
.wasm_hash
Service providers may want consumers to download a different wasm module than the on-chain canister.
In such case, providers need to include a
wasm_hash
field in thedfx/pullable
metadata of the on-chain pullable canister.There are three ways to specify
wasm_hash
indfx.json
. You can choose the most suitable one for your use.wasm_hash
statically:wasm_hash_file
, thendfx
read its content to setwasm_hash
:custom_wasm
which rungenerate
commands and use the custom wasm module to calculatewasm_hash
:dfx
will do the same post-processing (optimize, metadata, gzip) to the custom wasm as to the canister to be deployed on-chain.wasm_hash
will be calculated from the post-processed wasm.How Has This Been Tested?
e2e test in deps.bash
Checklist: