[go: nahoru, domu]

Skip to content

Commit

Permalink
Lg/link to queries (dfinity#321)
Browse files Browse the repository at this point in the history
* update links to concepts

* update links to concepts
  • Loading branch information
lsgunnlsgunn committed Feb 8, 2021
1 parent e308ec4 commit 322c6ad
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 97 deletions.
2 changes: 1 addition & 1 deletion modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
** xref:developers-guide:concepts/what-is-IC.adoc[What is the {IC}]
** xref:developers-guide:concepts/nodes-subnets.adoc[Nodes and sub-networks]
** xref:developers-guide:concepts/data-centers.adoc[Decentralized data centers]
** xref:developers-guide:concepts/canisters-intro.adoc[Canisters and code]
** xref:developers-guide:concepts/canisters-code.adoc[Canisters and code]
** xref:developers-guide:concepts/tokens-cycles.adoc[Tokens and cycles]
** xref:developers-guide:concepts/governance.adoc[Neurons and governance]
//** xref:developers-guide:concepts/icp-replica.adoc[Core components of the Internet Computer Protocol]
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/download.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ DFX_VERSION=0.6.22 sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"

For information about the next steps to take, see link:developers-guide/tutorials-intro{outfilesuffix}[Tutorials] in the link:developers-guide/sdk-guide{outfilesuffix}[_SDK Developer Tools_].

To learn more about writing programs for the {IC} before you start experimenting with code, see link:developers-guide/introduction-key-concepts{outfilesuffix}[Introduction and key concepts] in the link:developers-guide/sdk-guide{outfilesuffix}[_SDK Developer Tools_].
To learn more about writing programs for the {IC} before you start experimenting with code, see link:developers-guide/concepts/concepts-intro{outfilesuffix}[Concepts].

For information about writing programs for the {IC} using {proglang}, see the link:language-guide/motoko{outfilesuffix}[_Motoko Programming Language Guide_].

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ You can use the following optional flags with the `+dfx canister call+` command.

|`+--query+` |Enables you to send a query request to a deployed canister.
For best performance and network efficiency, you should use this flag when you explicitly want to use the query method to retrieve information.
For information about the difference between query and update calls, see link:introduction-key-concepts{outfilesuffix}#query-calls[Canisters include both program and state].
For information about the difference between query and update calls, see link:../concepts/canisters-code{outfilesuffix}#canister-state[Canisters include both program and state].

|`+--update+` |Enables you to send an update request to a deployed canister.
By default, canister calls use the update method.
Expand Down
19 changes: 2 additions & 17 deletions modules/developers-guide/pages/concepts/tokens-cycles.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,13 @@
:company-id: DFINITY
:sdk-short-name: DFINITY Canister SDK

In general, all canisters consume resources in the form of CPU cycles for execution, bandwidth for routing messages, and memory for persisted data.
Canisters maintain an account balance to pay for the cost of communication, computation, and storage their applications consume.
The cost of computation is referred to as *cycles*.

Cycles reflects the real costs of operations including resources such physical hardware, rack space, energy,storage devices, and bandwidth.
In simple terms, a *unit of cycles* represents the cost of executing a single WebAssembly instruction.

* Programs must be able to pay for complete execution (all or nothing), but the cost associated with a unit of cycles will make efficient programs cost-effective.
* By setting limits on how many cycles a canister can consume, the platform can prevent malicious code from draining resources
The relative stability of operational costs makes it easier to predict the cycles required to process, for example, a million messages.

NOTE: When you deploy canisters locally or to an {IC} test network, there’s no cost associated with program execution. However, it is possible that in calculating the operations to be performed, executing a program might result in an “out of cycles” exception because the operations would exceed a predefined threshold.
If you see this exception in testing, you can temporarily configure a higher cycles limit by setting a command-line option.

Within the Internet Computer ecosystem, Internet Computer Protocol tokens (ICP tokens) are the native currency that can be converted to **cycles** to pay for computation and resource consumption.

As an example, imagine you have a house where propane is used for a water heater, kitchen stove, dryer, and space heater. As you use these appliances, you deplete the supply of gas you have on hand, so periodically you exchange currency to have your gas refilled so you can continue to use your appliances without interruption. This is similar to canisters in that each canister that must have an account with cycles available to pay for the communication, computation, and storage that the canister’s application consumes.

Internet Computer Protocol token holders can exchange tokens when they need to replenish the cycles available in each canister account.

### Cost of computation
== Cost of computation

- Cycles reflect the real costs of operations for applications hosted in the Internet Computer platform including resources such physical hardware, rack space, energy, storage devices, and bandwidth.
- In simple terms, cycles represent the cost of executing each application's WebAssembly instructions.
Expand All @@ -37,7 +22,7 @@ Internet Computer Protocol token holders can exchange tokens when they need to r
- Although Internet Computer Protocol tokens can be used to add cycles to canisters, cycles themselves are not currency and have no liquidity or as an asset.
- Cycles cannot be converted back to value in the form of Internet Computer Protocol tokens, but can be transferred between canisters to enable canisters to pay for operations.

### Token value and volatility
== Token value and volatility

- Tokens reflect the value of the network and can fluctuate. To prevent the token value from affecting the number of messages a canister can process, tokens are not used to pay for network resources directly.
- Tokens can be exchanged between token holders or locked up in **neurons** to secure voting rights as part of the platform governance system.
Expand Down
75 changes: 0 additions & 75 deletions modules/developers-guide/pages/dev-index.adoc

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ This keyword ensures that the value for the variable is unchanged when the progr
+
For more information about stable and flexible variables, see link:language-guide:upgrades{outfilesuffix}[Stable variables and upgrade methods] in the link:language-guide:motoko{outfilesuffix}[_{proglang} Programming Language Guide_].
+
For more information about the differences between a query and an update, see link:../introduction-key-concepts{outfilesuffix}#query-calls[query calls] in link:../introduction-key-concepts{outfilesuffix}#canister-state[Canisters include both program and state].
For more information about the differences between a query and an update, see link:../concepts/canisters-code{outfilesuffix}#query-calls[query calls] in link:../concepts/canisters-code{outfilesuffix}#canister-state[Canisters include both program and state].
. Save your changes and close the file to continue.

== Start the local network
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Let's take a closer look at this simple program:
* The program uses the `+public query func+` to define a query method because, in this case, the `+actor_hello+` program doesn't make any changes to the state of the canister or perform any operations that would update the data you are accessing.
--
+
For more information about using a query call, see link:../introduction-key-concepts{outfilesuffix}#query-calls[query calls] in link:../introduction-key-concepts{outfilesuffix}#canister-state[Canisters include both program and state].
For more information about using a query call, see link:../concepts/canisters-code{outfilesuffix}#query-update[query calls] in link:../concepts/canisters-code{outfilesuffix}#canister-state[Canisters include both program and state].
. Save your changes and close the `+main.mo+` file.

== Build the program with a local identifier
Expand Down

0 comments on commit 322c6ad

Please sign in to comment.