Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

Add set-controller to doc #232

Merged
merged 2 commits into from
Sep 29, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions modules/developers-guide/pages/cli-reference/dfx-canister.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ For reference information and examples that illustrate using `+dfx canister+` co

|<<dfx canister request-status,`+request-status+`>> |Requests the status of a call to a canister.

|<<dfx canister set-controller,`+set-controller+`>> |Specifies the identity name or principal to use as the new controller for a specified canister on the Internet Computer network.

|<<dfx canister start,`+start+`>> |Restarts a stopped canister.

|<<dfx canister status,`+status+`>> |Requests the running status of a canister.
Expand Down Expand Up @@ -570,6 +572,59 @@ dfx canister request-status 0x58d08e785445dcab4ff090463b9e8b12565a67bf436251d13e

This command displays an error message if the request identifier is invalid or refused by the canister.

== dfx canister set-controller

Use the `+dfx canister set-controller+` command to specify the identity name or principal to use as the new **controller** for a specified canister on the Internet Computer network.
A controller identity has special rights to manage the canister it controls.
For example, only a controlling identity can be used to upgrade or transfer cycles to the canister under its control.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true but you can also specify a custodian in the wallet canister so multiple identities can transfer cycles to it. Therefore, I would just remove this and just specify that only the controller may install, reinstall, upgrade etc.


Note that you can specify either a user identity or a canister as a controller.
You can also specify the controller identity by using its name or its principal.

=== Basic usage

[source,bash]
----
dfx canister set-controller [flag] _canister_ _new-controller_
----

=== Flags

You can use the following optional flags with the `+dfx canister set-controller+` command.

[width="100%",cols="<31%,<69%",options="header"]
|===
|Flag |Description

|`+-h+`, `+--help+` |Displays usage information.

|`+-V+`, `+--version+` |Displays version information.
|===

=== Arguments

You must use the following arguments with the `+dfx canister set-controller+` command.

[width="100%",cols="<31%,<69%",options="header"]
|===
|Argument |Description

|`+<canister>+` |Specifies the canister name or canister identifier to be controlled by the identity you specify using the _new_controller_ argument.

|`+<new_controller>+` |Specifies the identity name or principal of the controller.
|===

=== Examples

You can use the `+dfx canister set-controller+` command to specify a user or canister as the controlling identity for a specific canister.

For example, you might create a new identity called `+pubsadmin+` then run the `+dfx canister set-controller+` to specify that you want the `+pubsadmin+` identity to be the controller of the `+my_wallet+` canister by running the following commands:

....
dfx identity new pubsadmin
dfx canister set-controller my_wallet pubsadmin
....

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the discussion we had in the architecture meeting, you would not need to do set controller on the wallet canister. The get-principal command will be sent to the Onboarding team and they will set the controller to the user provided principal.
Therefore, this example should change to just show setting the controller of a normal hello canister or similar

== dfx canister start

Use the `+dfx canister start+` command to restart a stopped canister on the local Internet Computer network or on a remote Internet Computer network.
Expand Down