Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lastmjs committed Oct 17, 2023
1 parent 0c70ee5 commit ad56e23
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/canisters_overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ <h1 class="menu-title">The Azle Book</h1>
<main>
<h1 id="canisters-overview"><a class="header" href="#canisters-overview">Canisters Overview</a></h1>
<p>Canisters are <a href="https://internetcomputer.org/">Internet Computer</a> (IC) applications. They are the encapsulation of your code and state, and are essentially Wasm modules.</p>
<p>State can be stored on the 4 GiB heap or in a larger 64 GiB location called stable memory. You can store state on the heap using your language's native global variables. You can store state in stable memory using low-level APIs or special stable data structures that behave similarly to native language data structures.</p>
<p>State can be stored on the 4 GiB heap or in a larger 96 GiB location called stable memory. You can store state on the heap using your language's native global variables. You can store state in stable memory using low-level APIs or special stable data structures that behave similarly to native language data structures.</p>
<p>State changes must go through a process called consensus. The consensus process ensures that state changes are <a href="https://en.wikipedia.org/wiki/Byzantine_fault">Byzantine Fault Tolerant</a>. This process takes a few seconds to complete.</p>
<p>Operations on canister state are exposed to users through canister methods. These methods can be invoked through HTTP requests. Query methods allow state to be read and are low-latency. Update methods allow state to be changed and are higher-latency. Update methods take a few seconds to complete because of the consensus process.</p>

Expand Down
10 changes: 5 additions & 5 deletions docs/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ <h5 id="nns-risk"><a class="header" href="#nns-risk">NNS risk</a></h5>
<p>View the <a href="https://dashboard.internetcomputer.org/subnets">IC Dashboard</a> to explore all data centers, subnets, node operators, and many other aspects of the IC.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="canisters-overview"><a class="header" href="#canisters-overview">Canisters Overview</a></h1>
<p>Canisters are <a href="https://internetcomputer.org/">Internet Computer</a> (IC) applications. They are the encapsulation of your code and state, and are essentially Wasm modules.</p>
<p>State can be stored on the 4 GiB heap or in a larger 64 GiB location called stable memory. You can store state on the heap using your language's native global variables. You can store state in stable memory using low-level APIs or special stable data structures that behave similarly to native language data structures.</p>
<p>State can be stored on the 4 GiB heap or in a larger 96 GiB location called stable memory. You can store state on the heap using your language's native global variables. You can store state in stable memory using low-level APIs or special stable data structures that behave similarly to native language data structures.</p>
<p>State changes must go through a process called consensus. The consensus process ensures that state changes are <a href="https://en.wikipedia.org/wiki/Byzantine_fault">Byzantine Fault Tolerant</a>. This process takes a few seconds to complete.</p>
<p>Operations on canister state are exposed to users through canister methods. These methods can be invoked through HTTP requests. Query methods allow state to be read and are low-latency. Update methods allow state to be changed and are higher-latency. Update methods take a few seconds to complete because of the consensus process.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="installation"><a class="header" href="#installation">Installation</a></h1>
Expand Down Expand Up @@ -743,7 +743,7 @@ <h2 id="tldr-1"><a class="header" href="#tldr-1">TLDR</a></h2>
<li>Latency ~2-5 seconds</li>
<li><a href="https://internetcomputer.org/docs/current/developer-docs/production/instruction-limits">20 billion Wasm instruction limit</a></li>
<li>4 GiB heap limit</li>
<li>64 GiB stable memory limit</li>
<li>96 GiB stable memory limit</li>
<li><a href="https://forum.dfinity.org/t/what-is-the-theroretical-number-for-txns-per-second-on-internet-computer-right-now/14039/6">~900 updates per second per canister</a></li>
</ul>
<p>Update methods are similar to query methods, but state changes can be persisted. Here's an example of a simple update method:</p>
Expand Down Expand Up @@ -793,7 +793,7 @@ <h2 id="tldr-1"><a class="header" href="#tldr-1">TLDR</a></h2>
})
});
</code></pre>
<p>If you need more than 4 GiB of storage, consider taking advantage of the 64 GiB of stable memory. Stable structures like <code>StableBTreeMap</code> give you a nice API for interacting with stable memory. These data structures will be <a href="./stable_structures.html">covered in more detail later</a>. Here's a simple example:</p>
<p>If you need more than 4 GiB of storage, consider taking advantage of the 96 GiB of stable memory. Stable structures like <code>StableBTreeMap</code> give you a nice API for interacting with stable memory. These data structures will be <a href="./stable_structures.html">covered in more detail later</a>. Here's a simple example:</p>
<pre><code class="language-typescript">import { Canister, Opt, query, StableBTreeMap, text, update, Void } from 'azle';

let db = StableBTreeMap(text, text, 0);
Expand Down Expand Up @@ -1059,13 +1059,13 @@ <h2 id="tldr-1"><a class="header" href="#tldr-1">TLDR</a></h2>
<div style="break-before: page; page-break-before: always;"></div><h1 id="stable-structures"><a class="header" href="#stable-structures">Stable Structures</a></h1>
<h2 id="tldr-2"><a class="header" href="#tldr-2">TLDR</a></h2>
<ul>
<li>64 GiB of stable memory</li>
<li>96 GiB of stable memory</li>
<li>Persistent across upgrades</li>
<li>Familiar API</li>
<li>Must specify memory id</li>
<li>No migrations per memory id</li>
</ul>
<p>Stable structures are data structures with familiar APIs that allow access to stable memory. Stable memory is a separate memory location from the heap that currently allows up to 64 GiB of storage. Stable memory persists automatically across upgrades.</p>
<p>Stable structures are data structures with familiar APIs that allow access to stable memory. Stable memory is a separate memory location from the heap that currently allows up to 96 GiB of storage. Stable memory persists automatically across upgrades.</p>
<p>Persistence on the Internet Computer (IC) is very important to understand. When a canister is upgraded (its code is changed after being initially deployed) its heap is wiped. This includes all global variables.</p>
<p>On the other hand, anything stored in stable memory will be preserved. Writing and reading to and from stable memory can be done with a <a href="./reference/stable_memory/stable_memory.html">low-level API</a>, but it is generally easier and preferable to use stable structures.</p>
<p>Azle currently provides one stable structure called <code>StableBTreeMap</code>. It's similar to a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map">JavaScript Map</a> and has most of the common operations you'd expect such as reading, inserting, and removing values.</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/searchindex.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/stable_structures.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ <h1 class="menu-title">The Azle Book</h1>
<h1 id="stable-structures"><a class="header" href="#stable-structures">Stable Structures</a></h1>
<h2 id="tldr"><a class="header" href="#tldr">TLDR</a></h2>
<ul>
<li>64 GiB of stable memory</li>
<li>96 GiB of stable memory</li>
<li>Persistent across upgrades</li>
<li>Familiar API</li>
<li>Must specify memory id</li>
<li>No migrations per memory id</li>
</ul>
<p>Stable structures are data structures with familiar APIs that allow access to stable memory. Stable memory is a separate memory location from the heap that currently allows up to 64 GiB of storage. Stable memory persists automatically across upgrades.</p>
<p>Stable structures are data structures with familiar APIs that allow access to stable memory. Stable memory is a separate memory location from the heap that currently allows up to 96 GiB of storage. Stable memory persists automatically across upgrades.</p>
<p>Persistence on the Internet Computer (IC) is very important to understand. When a canister is upgraded (its code is changed after being initially deployed) its heap is wiped. This includes all global variables.</p>
<p>On the other hand, anything stored in stable memory will be preserved. Writing and reading to and from stable memory can be done with a <a href="./reference/stable_memory/stable_memory.html">low-level API</a>, but it is generally easier and preferable to use stable structures.</p>
<p>Azle currently provides one stable structure called <code>StableBTreeMap</code>. It's similar to a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map">JavaScript Map</a> and has most of the common operations you'd expect such as reading, inserting, and removing values.</p>
Expand Down
4 changes: 2 additions & 2 deletions docs/update_methods.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ <h2 id="tldr"><a class="header" href="#tldr">TLDR</a></h2>
<li>Latency ~2-5 seconds</li>
<li><a href="https://internetcomputer.org/docs/current/developer-docs/production/instruction-limits">20 billion Wasm instruction limit</a></li>
<li>4 GiB heap limit</li>
<li>64 GiB stable memory limit</li>
<li>96 GiB stable memory limit</li>
<li><a href="https://forum.dfinity.org/t/what-is-the-theroretical-number-for-txns-per-second-on-internet-computer-right-now/14039/6">~900 updates per second per canister</a></li>
</ul>
<p>Update methods are similar to query methods, but state changes can be persisted. Here's an example of a simple update method:</p>
Expand Down Expand Up @@ -204,7 +204,7 @@ <h2 id="tldr"><a class="header" href="#tldr">TLDR</a></h2>
})
});
</code></pre>
<p>If you need more than 4 GiB of storage, consider taking advantage of the 64 GiB of stable memory. Stable structures like <code>StableBTreeMap</code> give you a nice API for interacting with stable memory. These data structures will be <a href="./stable_structures.html">covered in more detail later</a>. Here's a simple example:</p>
<p>If you need more than 4 GiB of storage, consider taking advantage of the 96 GiB of stable memory. Stable structures like <code>StableBTreeMap</code> give you a nice API for interacting with stable memory. These data structures will be <a href="./stable_structures.html">covered in more detail later</a>. Here's a simple example:</p>
<pre><code class="language-typescript">import { Canister, Opt, query, StableBTreeMap, text, update, Void } from 'azle';

let db = StableBTreeMap(text, text, 0);
Expand Down
2 changes: 1 addition & 1 deletion the_azle_book/src/canisters_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Canisters are [Internet Computer](https://internetcomputer.org/) (IC) applications. They are the encapsulation of your code and state, and are essentially Wasm modules.

State can be stored on the 4 GiB heap or in a larger 64 GiB location called stable memory. You can store state on the heap using your language's native global variables. You can store state in stable memory using low-level APIs or special stable data structures that behave similarly to native language data structures.
State can be stored on the 4 GiB heap or in a larger 96 GiB location called stable memory. You can store state on the heap using your language's native global variables. You can store state in stable memory using low-level APIs or special stable data structures that behave similarly to native language data structures.

State changes must go through a process called consensus. The consensus process ensures that state changes are [Byzantine Fault Tolerant](https://en.wikipedia.org/wiki/Byzantine_fault). This process takes a few seconds to complete.

Expand Down
4 changes: 2 additions & 2 deletions the_azle_book/src/stable_structures.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## TLDR

- 64 GiB of stable memory
- 96 GiB of stable memory
- Persistent across upgrades
- Familiar API
- Must specify memory id
- No migrations per memory id

Stable structures are data structures with familiar APIs that allow access to stable memory. Stable memory is a separate memory location from the heap that currently allows up to 64 GiB of storage. Stable memory persists automatically across upgrades.
Stable structures are data structures with familiar APIs that allow access to stable memory. Stable memory is a separate memory location from the heap that currently allows up to 96 GiB of storage. Stable memory persists automatically across upgrades.

Persistence on the Internet Computer (IC) is very important to understand. When a canister is upgraded (its code is changed after being initially deployed) its heap is wiped. This includes all global variables.

Expand Down
4 changes: 2 additions & 2 deletions the_azle_book/src/update_methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- Latency ~2-5 seconds
- [20 billion Wasm instruction limit](https://internetcomputer.org/docs/current/developer-docs/production/instruction-limits)
- 4 GiB heap limit
- 64 GiB stable memory limit
- 96 GiB stable memory limit
- [~900 updates per second per canister](https://forum.dfinity.org/t/what-is-the-theroretical-number-for-txns-per-second-on-internet-computer-right-now/14039/6)

Update methods are similar to query methods, but state changes can be persisted. Here's an example of a simple update method:
Expand Down Expand Up @@ -71,7 +71,7 @@ export default Canister({
});
```

If you need more than 4 GiB of storage, consider taking advantage of the 64 GiB of stable memory. Stable structures like `StableBTreeMap` give you a nice API for interacting with stable memory. These data structures will be [covered in more detail later](./stable_structures.md). Here's a simple example:
If you need more than 4 GiB of storage, consider taking advantage of the 96 GiB of stable memory. Stable structures like `StableBTreeMap` give you a nice API for interacting with stable memory. These data structures will be [covered in more detail later](./stable_structures.md). Here's a simple example:

```typescript
import { Canister, Opt, query, StableBTreeMap, text, update, Void } from 'azle';
Expand Down

0 comments on commit ad56e23

Please sign in to comment.