Skip to content
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

import canister #2

Open
chenyan2002 opened this issue Aug 21, 2024 · 1 comment
Open

import canister #2

chenyan2002 opened this issue Aug 21, 2024 · 1 comment

Comments

@chenyan2002
Copy link
Contributor

chenyan2002 commented Aug 21, 2024

Currently, import C "canister:name" requires the following entry in mops.toml

[[canister]]
name = "name"
canister_id = "..."

But this doesn't quite work when deploying to different networks/instances. We need some mechanism to extract named canister from deployment, so that canister_id becomes an optional field.

"canister:name" is probably not a good design, as it ties the build process with deployment: you have to deploy the dependency before you can build the current file.

Another option is to only import the actor type, and pass in the canister id as init args. This also makes module hash more stable, i.e., changing the canister id doesn't affect the module hash.

@crusso
Copy link

crusso commented Aug 28, 2024

Might be a good idea.

I assume you don't want to add an implicit argument to the low level canister argument, but just let users reference the type in the explicit argument?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants