Skip to content

feat: specify id when provisional create canister#3021

Merged
lwshang merged 15 commits intomasterfrom
lwshang/SDK-803
Mar 15, 2023
Merged

feat: specify id when provisional create canister#3021
lwshang merged 15 commits intomasterfrom
lwshang/SDK-803

Conversation

@lwshang
Copy link
Copy Markdown
Contributor

@lwshang lwshang commented Mar 14, 2023

Close SDK-803

Description

When create canister on non-mainnet replica, you can now specify the canister ID.

dfx canister create <CANISTER_NAME> --specified-id <PRINCIPAL>

dfx deploy <CANISTER_NAME> --specified-id <PRINCIPAL>

Other changes

  • Did some re-org of the Cargo.toml files. The frontend canister is updated accordingly.
  • Update ic-ref because the feature requires corresponding ref impl to pass e2e tests.

How Has This Been Tested?

e2e

Checklist:

  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

@lwshang lwshang marked this pull request as ready for review March 14, 2023 21:56
@lwshang lwshang requested a review from a team as a code owner March 14, 2023 21:56
Comment thread CHANGELOG.md Outdated
Comment thread src/dfx/src/commands/canister/create.rs Outdated
Comment thread src/dfx/src/lib/operations/canister/create_canister.rs Outdated
@viviveevee
Copy link
Copy Markdown
Contributor

Any plans to support configuring a CID in dfx.json?

@lwshang lwshang requested a review from a user March 15, 2023 17:37
@lwshang lwshang enabled auto-merge (squash) March 15, 2023 17:59
@lwshang lwshang merged commit 08ed07a into master Mar 15, 2023
@lwshang lwshang deleted the lwshang/SDK-803 branch March 15, 2023 18:31
@LiveDuo
Copy link
Copy Markdown

LiveDuo commented Mar 23, 2023

Any plans to support configuring a CID in dfx.json?

This is very welcome for setting up ledger, cmc or II locally. Currently it's quite a hassle.

@lwshang
Copy link
Copy Markdown
Contributor Author

lwshang commented Mar 23, 2023

setting up ledger, cmc or II locally.

@LiveDuo Could you give dfx nns install a try? It set system canisters locally.

"configuring a CID in dfx.json" is on our plan. It will firstly be in the upcoming dfx pull feature. For more general usage, we need design an intuitive workflow first.

@LiveDuo
Copy link
Copy Markdown

LiveDuo commented Mar 23, 2023

setting up ledger, cmc or II locally.

@LiveDuo Could you give dfx nns install a try? It set system canisters locally.

"configuring a CID in dfx.json" is on our plan. It will firstly be in the upcoming dfx pull feature. For more general usage, we need design an intuitive workflow first.

When it deploys the ledger canister who gets the initial distribution of the ICP?

PS: out of curiosity what's the dfx pull command for?

@lwshang
Copy link
Copy Markdown
Contributor Author

lwshang commented Mar 23, 2023

You can specify the accounts as below:

dfx nns install --ledger-accounts 345f723e9e619934daac6ae0f4be13a7b0ba57d6a608e511a00fd0ded5866752 22ca7edac648b814e81d7946e8bacea99280e07c5f51a04ba7a38009d8ad8e89 5a94fe181e9d411c58726cb87cbf2d016241b6c350bc3330e4869ca76e54ecbc

dfx pull will help you to pull canisters (and their dependencies) from mainnet. Then you can install them locally at the same canister ID. It will simplify the procedure to integrate with other canisters (ledger, cmc, "some DEX", etc).
Check this file https://github.com/dfinity/sdk/blob/master/e2e/assets/pull/dfx.json to get an impression on how to specify dependency canisters to be pulled from mainnet.

@LiveDuo
Copy link
Copy Markdown

LiveDuo commented Mar 23, 2023

Thanks.

Ideally dfx nns install should be a flag in dfx.json too. I expect some projects using the nns canisters needing it all the time.

The dfx pull command should be great for e2e tests. Glad to learned about it.

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

Successfully merging this pull request may close these issues.

3 participants