There is currently no way to associate an existing canister ID with a project canister in icp.yaml. The only way to get a mapping is to have the CLI create the canister itself, which writes to .icp/data/mappings/<env>.ids.json.
This is a problem when:
- A canister was created outside the CLI (e.g. via
dfx, NNS proposal, or another tool) and you want to adopt it into an icp project.
- You clone a repo and want to deploy to an existing canister without manually creating internal state files.
- You want canister IDs to be version-controlled alongside the rest of the project config.
Right now you have to manually create .icp/data/mappings/<env>.ids.json with the correct format, which is undocumented and fragile.
Proposed addition to the canister manifest:
canisters:
- name: frontend
ids:
ic: "vmenl-oyaaa-aaaax-qaa2a-cai"
recipe:
type: "@dfinity/[email protected]"
This would make icp.yaml the single source of truth for project configuration, which is what you'd expect from a declarative manifest.
There is currently no way to associate an existing canister ID with a project canister in
icp.yaml. The only way to get a mapping is to have the CLI create the canister itself, which writes to.icp/data/mappings/<env>.ids.json.This is a problem when:
dfx, NNS proposal, or another tool) and you want to adopt it into anicpproject.Right now you have to manually create
.icp/data/mappings/<env>.ids.jsonwith the correct format, which is undocumented and fragile.Proposed addition to the canister manifest:
This would make
icp.yamlthe single source of truth for project configuration, which is what you'd expect from a declarative manifest.