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

feat: add set controller to the management canister #51

Merged
merged 4 commits into from
Sep 24, 2020

Conversation

p-shahi
Copy link
Contributor

@p-shahi p-shahi commented Sep 24, 2020

No description provided.

@p-shahi p-shahi changed the title Pshahi/setcontroller feat: add set controller to the management canister Sep 24, 2020
@p-shahi p-shahi requested a review from hansl September 24, 2020 05:37
@p-shahi p-shahi marked this pull request as ready for review September 24, 2020 16:28
@p-shahi
Copy link
Contributor Author

p-shahi commented Sep 24, 2020

Hm seems merging is still blocked @hansl

@hansl hansl merged commit 95f1bc5 into dfinity:next Sep 24, 2020
@p-shahi p-shahi deleted the pshahi/setcontroller branch September 24, 2020 23:52
mergify bot pushed a commit to dfinity/sdk that referenced this pull request Sep 28, 2020
This adds the `dfx canister set-controller` subcommand
```
➜  hello git:(master) dfx canister set-controller --help
dfx-canister-set-controller
Sets the provided identity's name or its principal as the new controller of a canister on the Internet Computer network.

USAGE:
    dfx canister set-controller <canister> <new-controller>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

ARGS:
    <canister>          Specifies the canister name or the canister identifier for the canister to be controlled.
    <new-controller>    Specifies the identity name or the principal of the new controller.
```
An example use case:
```
➜  hello git:(master) dfx identity whoami
default
➜  hello git:(master) dfx identity list
default *
prithvi
➜  hello git:(master) dfx canister create hello
Creating canister "hello"...
"hello" canister created with canister id: "75hes-oqbaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q"
➜  hello git:(master) dfx build hello
Building canisters...
➜  hello git:(master)
➜  hello git:(master) dfx canister set-controller hello prithvi
Set "prithvi" as controller of "hello".
➜  hello git:(master)
➜  hello git:(master) dfx canister install hello
Installing code for canister hello, with canister_id 75hes-oqbaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q
Replica error (code 5): IC0512: Only the controller of canister 75hes-oqbaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q can control it.
Expected controller: jxpuf-o4cfi-2zfqa-3svif-yxdiz-tuj3p-ctl6m-qsrfv-7zctw-z3bwc-2ae
Actual controller: 5gg4n-o6ooe-5zmlh-ac2kx-ntmkd-kamti-a3rqe-okecn-knil3-ord3t-mae
```
Note: Waiting for #1056 to get merged first (therefore, creating a PR against that branch)

- [x] push local e2e tests which is blocked because of #1057 (comment)
- [ ] update to a replica version which doesn't expose the expected controller's principal
- [x] update to agent-rs after this is merged dfinity/agent-rs#51
ericswanson-dfinity pushed a commit to dfinity/sdk that referenced this pull request Oct 6, 2020
This adds the `dfx canister set-controller` subcommand
```
➜  hello git:(master) dfx canister set-controller --help
dfx-canister-set-controller
Sets the provided identity's name or its principal as the new controller of a canister on the Internet Computer network.

USAGE:
    dfx canister set-controller <canister> <new-controller>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

ARGS:
    <canister>          Specifies the canister name or the canister identifier for the canister to be controlled.
    <new-controller>    Specifies the identity name or the principal of the new controller.
```
An example use case:
```
➜  hello git:(master) dfx identity whoami
default
➜  hello git:(master) dfx identity list
default *
prithvi
➜  hello git:(master) dfx canister create hello
Creating canister "hello"...
"hello" canister created with canister id: "75hes-oqbaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q"
➜  hello git:(master) dfx build hello
Building canisters...
➜  hello git:(master)
➜  hello git:(master) dfx canister set-controller hello prithvi
Set "prithvi" as controller of "hello".
➜  hello git:(master)
➜  hello git:(master) dfx canister install hello
Installing code for canister hello, with canister_id 75hes-oqbaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q
Replica error (code 5): IC0512: Only the controller of canister 75hes-oqbaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q can control it.
Expected controller: jxpuf-o4cfi-2zfqa-3svif-yxdiz-tuj3p-ctl6m-qsrfv-7zctw-z3bwc-2ae
Actual controller: 5gg4n-o6ooe-5zmlh-ac2kx-ntmkd-kamti-a3rqe-okecn-knil3-ord3t-mae
```
Note: Waiting for #1056 to get merged first (therefore, creating a PR against that branch)

- [x] push local e2e tests which is blocked because of #1057 (comment)
- [ ] update to a replica version which doesn't expose the expected controller's principal
- [x] update to agent-rs after this is merged dfinity/agent-rs#51
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.

2 participants