[go: nahoru, domu]

Skip to content

Commit

Permalink
Add anchors to sections (dfinity#339)
Browse files Browse the repository at this point in the history
* Add anchors to sections

* Add anchors to more sections

* Add anchors to more sections
  • Loading branch information
lsgunnlsgunn committed Feb 20, 2021
1 parent e6eeea0 commit 209f905
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions modules/developers-guide/pages/working-with-canisters.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ifdef::env-github,env-browser[:outfilesuffix:.adoc]
If you have experimented with using the {sdk-long-name} by following the tutorials in the link:tutorials-intro{outfilesuffix}[Tutorials] section or by cloning examples from the link:https://github.com/dfinity/examples[examples] repository, you are already familiar with how to build and deploy programs as **canisters**.
This section provides additional information about the canister lifecycle and how to manage canisters.

[[create-canister]]
== Register a canister identifier

Depending on your preferred development workflow, you can register a unique canister identifier before or after you have a program ready to compile.
Expand Down Expand Up @@ -54,6 +55,7 @@ dfx canister create --all
+
The command creates the `+.dfx/local+` directory and adds the `+canister_ids.json+` file to that directory for the project.

[[local-id]]
== Build a canister with a local identifier

After you have written source code for your project, you need to compile it into a WebAssembly module before deploying it to the network as a canister.
Expand Down Expand Up @@ -99,6 +101,7 @@ dfx build
== Generate interface bindings for a canister
////

[[deploy-canister]]
== Deploy canisters on the {IC} network

After you have compiled a program, you can install the compiled code on the {IC} network running locally in your development or on a remote network provider.
Expand All @@ -121,6 +124,7 @@ If you were installing canisters on a remote network, you would include the `+--
dfx canister install --all
----

[[lookup-id]]
== Look up a canister identifier

All canisters have unique, network-specific identifiers.
Expand All @@ -143,6 +147,7 @@ To look up the canister identifier for the same canister deployed on the network
dfx canister --network=ic id lookup
....

[[reinstall-canister]]
== Reinstall a canister

During the development cycle, you might want to install, then replace your program as you debug and improve it.
Expand Down Expand Up @@ -227,6 +232,7 @@ These commands run using the `+registered_owner+` identity, making that user the
dfx canister call pubs greet '("Sam")'
----

[[running-state]]
== Managing the running state of a canister

After you deploy a canister on the {IC}, it can begin receiving and processing requests from users and from other canisters.
Expand All @@ -237,6 +243,7 @@ For example, you might want to stop a canister before upgrading it.
Stopping a canister helps to ensure proper handling of any messages that are in progress and need to either run to completion or be rolled back.
You might also want to stop a canister to clear its message queue cleanly as a prerequisite to deleting the canister.

// tag::check-status[]
You can check the current status of all canisters or a specified canister by running the `+dfx canister status+` command.
For example, to see the status for all canisters running on the local {IC} network, you would run the following command:

Expand All @@ -251,7 +258,9 @@ This command returns output similar to the following if canisters are currently
Canister status_check's status is Running.
Canister status_check_assets's status is Running.
....
// end::check-status[]

// tag::stop-status[]
You can stop canisters that are currently running by running the `+dfx canister stop+` command.

[source,bash]
Expand All @@ -267,7 +276,9 @@ Stopping code for canister status_check_assets, with canister_id cxeji-wacaa-aaa
....

If you were to rerun the `+dfx canister status+` command, you might see a status of `+Stopped+` indicating that there were no pending messages that needed to processed or a status of `+Stopping+` indicating that there were messages in-flight that needed to be addressed.
// end::stop-status[]

// tag::restart-status[]
To restart a canister-for example, after a successful canister upgrade—you can run the `+dfx canister start+` command.
For example, to restart all of the canisters running on the local {IC} network, you would run the following command:

Expand All @@ -282,6 +293,7 @@ This command displays output similar to the following:
Starting code for canister status_check, with canister_id 75hes-oqbaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q
Starting code for canister status_check_assets, with canister_id cxeji-wacaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q
....
// tag::restart-status[]

[[upgrade-canister]]
== Upgrade a canister
Expand Down Expand Up @@ -315,6 +327,7 @@ For more information about declaring stable variables, see the _{proglang} Progr
dfx canister install --all --mode upgrade
----

[[delete-canister]]
== Delete a canister

If you want to permanently delete a specific canister or all canisters for a specific project on a given {IC} network, you can do so by running the `+dfx canister delete+` command.
Expand Down

0 comments on commit 209f905

Please sign in to comment.