Make scripts more powerful #2676
Replies: 6 comments 6 replies
-
Note that canister IDs are already available as env vars, so there is already a solution IF the canister IDs need to be compiled in. That said, I like the idea of being able to specify other canister IDs as install args. I don't actually know whether arguments can be passed during upgrade, in case the list of canister dependencies changes. |
Beta Was this translation helpful? Give feedback.
-
Please note that the sdk team is somewhat resource constrained. Maybe a good way of getting things done is to agree a strategy with the community & SDK team, then submit PRs. The CI is also thorough but slow, some love to make it faster would make the sdk team faster. |
Beta Was this translation helpful? Give feedback.
-
The variable CANISTER_ID_backend is already available, as is CANISTER_CANDID_PATH_backend, CANISTER_ID/CANISTER_CANDID_PATH (for self), DFX_NETWORK, and DFX_VERSION. |
Beta Was this translation helpful? Give feedback.
-
Is it worth splitting this up and moving forward on the uncontentious parts while we discuss the big vision behind the harder parts? For example, I see nothing at all wrong with Note: There is an existing env var |
Beta Was this translation helpful? Give feedback.
-
Likewise, can we have a vote on DFX_CANISTER_URL? I think we need to unpack this a bit. What is the URL of the nns-dapp?
Note: I personally think that the URL should be the normal login URL used by end users, so https://nns.ic0.app in the above example. For canisters without a custom domain there is no distinction but where there is a custom domain, using the common URL is better IMO. Note: I would love to have a cli command: Question: Should there be a URL env var per canister, as for canister IDs? I suspect that the answer is yes. Waiting with a vote until this has been thrashed out a bit. |
Beta Was this translation helpful? Give feedback.
-
Note: Env vars are published here: https://internetcomputer.org/docs/current/references/cli-reference/dfx-envars/ |
Beta Was this translation helpful? Give feedback.
-
I've been wanting to extract more value from the
dfx
toolchain in builds. I thinkdfx
could be useful to build and deploy more than simple canisters. In particular I think the interface with user-defined scripts in custom builds could be improved.In general I think scripts could leverage environment variables to drive the build. Here's something that just isn't doable right now:
Assume two custom canisters;
frontend
andbackend
. Thefrontend
canister requires knowing thebackend
canister ID (for agent-js to make calls), and assume extra heavy assets need to be uploaded to thefrontend
canister via HTTP after the canister was installed. With a few tweaks to thedfx
toolchain, thebuild
,preinstall
andpostinstall
scripts could look like this:Simplified & robust build
Dynamically setting canister IDs in preinstall
Connecting to the canister postinstall
Goes without saying that I'm happy to contribute code, just want to agree with the team first on the direction.
Beta Was this translation helpful? Give feedback.
All reactions