Skip to content

Commit

Permalink
Merge branch 'rc_final_rundown' of github.com:demergent-labs/azle int…
Browse files Browse the repository at this point in the history
…o rc_final_rundown
  • Loading branch information
lastmjs committed Jan 13, 2025
2 parents 7e6bfd8 + 032b2ac commit c5ed9b6
Show file tree
Hide file tree
Showing 539 changed files with 155,693 additions and 84,209 deletions.
6 changes: 3 additions & 3 deletions .github/actions/get_exclude_dirs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,20 @@ runs:
') }}"
UNSTABLE_EXCLUSIONS="${{ format('
examples/experimental/demo/bitcoin_psbt
examples/stable/test/end_to_end/candid_rpc/multi_deploy
examples/stable/test/property/candid_rpc/stable_b_tree_map
examples/stable/test/property/ic_api/performance_counter
examples/experimental/test/end_to_end/http_server/http_outcall_fetch
examples/experimental/test/end_to_end/http_server/ic_evm_rpc
examples/experimental/test/end_to_end/http_server/multi_deploy
examples/experimental/test/property/candid_rpc/stable_b_tree_map
') }}"
SLOW_EXCLUSIONS="${{ format('
examples/experimental/demo/basic_bitcoin
examples/experimental/demo/bitcoin_psbt
examples/experimental/demo/ckbtc
examples/stable/test/end_to_end/candid_rpc/bitcoin
examples/stable/test/end_to_end/candid_rpc/stable_structures
examples/stable/test/property/candid_rpc/stable_b_tree_map
examples/experimental/test/end_to_end/candid_rpc/bitcoin
examples/experimental/test/end_to_end/candid_rpc/composite_queries
examples/experimental/test/end_to_end/candid_rpc/ckbtc
Expand All @@ -50,6 +49,7 @@ runs:
examples/experimental/test/end_to_end/http_server/autoreload
examples/experimental/test/end_to_end/http_server/large_files
examples/experimental/test/end_to_end/http_server/open_value_sharing
examples/experimental/test/property/candid_rpc/stable_b_tree_map
') }}"
EXCLUDE_DIRS=""
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/run_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ jobs:
if: matrix.azle_source == 'repo'
working-directory: ${{ matrix.test.path }}

- run: npx azle install-dfx-extension
working-directory: ${{ matrix.test.path }}

- name: Start dfx with artificial delay 0
if: ${{ steps.set-conditions.outputs.is_feature_branch_pr == 'true' || steps.set-conditions.outputs.is_feature_branch_draft_pr == 'true' || steps.set-conditions.outputs.is_main_branch_push_from_feature_merge == 'true' }}
working-directory: ${{ matrix.test.path }}
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 AZLE token holders (nlhft-2iaaa-aaaae-qaaua-cai)
Copyright (c) 2025 AZLE token holders (nlhft-2iaaa-aaaae-qaaua-cai)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,21 @@ TypeScript and JavaScript CDK for the [Internet Computer](https://internetcomput

## Disclaimer

Please remember that Azle is in beta and thus it may have unknown security vulnerabilities due to the following:
Azle stable mode is continuously subjected to [intense scrutiny and testing](https://github.com/demergent-labs/azle/actions), however it does not yet have multiple independent security reviews/audits.

- Azle is built with various software packages that have not yet reached maturity
- Azle does not yet have multiple independent security reviews/audits
- Azle does not yet have many live, successful, continuously operating applications deployed to ICP
## Stable Mode

Azle runs in stable mode by default.

This mode is intended for production use after Azle's 1.0 release. Its focus is on API and runtime stability, security, performance, TypeScript and JavaScript language support, the ICP APIs, and Candid remote procedure calls (RPC). There is minimal support for the Node.js standard library, npm ecosystem, and HTTP server functionality.

## Experimental Mode

Azle runs in experimental mode through explicitly enabling a flag in `dfx.json` or certain CLI commands.

This mode is intended for developers who are willing to accept the risk of using an alpha or beta project. Its focus is on quickly enabling new features and functionality without requiring the time and other resources necessary to advance them to the stable mode. The Node.js standard libary, npm ecosystem, and HTTP server functionality are also major areas of focus.

> NOTE: Keep clearly in mind that the experimental mode fundamentally changes the Azle Wasm binary. It is not guaranteed to be secure or stable in API changes or runtime behavior. If you enable the experimental mode, even if you only use APIs from the stable mode, you are accepting a higher risk of bugs, errors, crashes, security exploits, breaking API changes, etc.
## Get Started

Expand Down
Binary file modified canister_templates/experimental.wasm
Binary file not shown.
Binary file modified canister_templates/stable.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion dfx_extension/extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "azle",
"version": "0.24.1",
"version": "0.25.0",
"homepage": "https://github.com/dfinity/dfx-extensions",
"authors": "",
"summary": "",
Expand Down
2 changes: 1 addition & 1 deletion docs/authentication.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ <h1 id="authentication-tldr"><a class="header" href="#authentication-tldr">Authe
</code></pre>
<p>Then you use <code>fetch</code> and construct an <code>Authorization</code> header using an <a href="https://www.npmjs.com/package/@dfinity/agent">@dfinity/agent</a> <code>Identity</code>:</p>
<pre><code class="language-typescript">const response = await fetch(
`http://bkyz2-fmaaa-aaaaa-qaaaq-cai.localhost:8000/whoami`,
`http://bkyz2-fmaaa-aaaaa-qaaaq-cai.raw.localhost:8000/whoami`,
{
method: 'GET',
headers: [['Authorization', toJwt(this.identity)]]
Expand Down
16 changes: 10 additions & 6 deletions docs/azle.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,16 @@ <h1 id="azle-beta"><a class="header" href="#azle-beta">Azle (Beta)</a></h1>
<li><a href="https://discord.gg/5Hb6rM2QUM">Discord channel</a></li>
</ul>
<h2 id="disclaimer"><a class="header" href="#disclaimer">Disclaimer</a></h2>
<p>Please remember that Azle is in beta and thus it may have unknown security vulnerabilities due to the following:</p>
<ul>
<li>Azle is built with various software packages that have not yet reached maturity</li>
<li>Azle does not yet have multiple independent security reviews/audits</li>
<li>Azle does not yet have many live, successful, continuously operating applications deployed to ICP</li>
</ul>
<p>Azle stable mode is continuously subjected to <a href="https://github.com/demergent-labs/azle/actions">intense scrutiny and testing</a>, however it does not yet have multiple independent security reviews/audits.</p>
<h2 id="stable-mode"><a class="header" href="#stable-mode">Stable Mode</a></h2>
<p>Azle runs in stable mode by default.</p>
<p>This mode is intended for production use after Azle's 1.0 release. Its focus is on API and runtime stability, security, performance, TypeScript and JavaScript language support, the ICP APIs, and Candid remote procedure calls (RPC). There is minimal support for the Node.js standard library, npm ecosystem, and HTTP server functionality.</p>
<h2 id="experimental-mode"><a class="header" href="#experimental-mode">Experimental Mode</a></h2>
<p>Azle runs in experimental mode through explicitly enabling a flag in <code>dfx.json</code> or certain CLI commands.</p>
<p>This mode is intended for developers who are willing to accept the risk of using an alpha or beta project. Its focus is on quickly enabling new features and functionality without requiring the time and other resources necessary to advance them to the stable mode. The Node.js standard libary, npm ecosystem, and HTTP server functionality are also major areas of focus.</p>
<blockquote>
<p>NOTE: Keep clearly in mind that the experimental mode fundamentally changes the Azle Wasm binary. It is not guaranteed to be secure or stable in API changes or runtime behavior. If you enable the experimental mode, even if you only use APIs from the stable mode, you are accepting a higher risk of bugs, errors, crashes, security exploits, breaking API changes, etc.</p>
</blockquote>
<h2 id="demergent-labs"><a class="header" href="#demergent-labs">Demergent Labs</a></h2>
<p>Azle is currently developed by <a href="https://github.com/demergent-labs">Demergent Labs</a>, a for-profit company with a <a href="https://dfinity.org/grants">grant</a> from <a href="https://dfinity.org/">DFINITY</a>.</p>
<p>Demergent Labs' <a href="https://github.com/demergent-labs/blog/blob/main/demergent-labs-grand-plan-part-1.md">vision</a> is to accelerate the adoption of Web3, the Internet Computer, and sustainable open source.</p>
Expand Down
12 changes: 6 additions & 6 deletions docs/bitcoin.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ <h1 class="menu-title">The Azle Book</h1>
<h1 id="bitcoin"><a class="header" href="#bitcoin">Bitcoin</a></h1>
<p>Examples:</p>
<ul>
<li><a href="https://github.com/demergent-labs/azle/tree/main/examples/basic_bitcoin">basic_bitcoin</a></li>
<li><a href="https://github.com/demergent-labs/azle/tree/main/tests/end_to_end/candid_rpc/class_syntax/bitcoin">bitcoin</a></li>
<li><a href="https://github.com/demergent-labs/azle/tree/main/examples/bitcoin_psbt">bitcoin_psbt</a></li>
<li><a href="https://github.com/demergent-labs/azle/tree/main/tests/end_to_end/http_server/bitcoinjs_lib">bitcoinjs_lib</a></li>
<li><a href="https://github.com/demergent-labs/azle/tree/main/tests/end_to_end/http_server/bitcore_lib">bitcore_lib</a></li>
<li><a href="https://github.com/demergent-labs/azle/tree/main/examples/ckbtc">ckbtc</a></li>
<li><a href="https://github.com/demergent-labs/azle/tree/main/examples/experimental/demo/basic_bitcoin">basic_bitcoin</a></li>
<li><a href="https://github.com/demergent-labs/azle/tree/main/examples/stable/test/end_to_end/candid_rpc/bitcoin">bitcoin</a></li>
<li><a href="https://github.com/demergent-labs/azle/tree/main/examples/experimental/demo/bitcoin_psbt">bitcoin_psbt</a></li>
<li><a href="https://github.com/demergent-labs/azle/tree/main/examples/experimental/test/end_to_end/http_server/bitcoinjs_lib">bitcoinjs_lib</a></li>
<li><a href="https://github.com/demergent-labs/azle/tree/main/examples/experimental/test/end_to_end/http_server/bitcore_lib">bitcore_lib</a></li>
<li><a href="https://github.com/demergent-labs/azle/tree/main/examples/experimental/demo/ckbtc">ckbtc</a></li>
</ul>
<p>There are two main ways to interact with Bitcoin on ICP: through the <a href="#management-canister">management canister</a> and through the <a href="#ckbtc">ckBTC canister</a>.</p>
<h2 id="management-canister"><a class="header" href="#management-canister">management canister</a></h2>
Expand Down
29 changes: 13 additions & 16 deletions docs/candid_rpc.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="candid-rpc"><a class="header" href="#candid-rpc">Candid RPC</a></h1>
<p>This section documents the Candid RPC methodology for developing Azle applications. This methodology embraces ICP's Candid language, exposing canister methods directly to Candid-speaking clients, and using Candid for serialization and deserialization purposes.</p>
<p>Candid RPC is heading towards 1.0 and production-readiness in 2024.</p>
<p>Candid RPC is heading towards 1.0 and production-readiness in 2025.</p>
<ul>
<li><a href="#get-started">Get Started</a></li>
<li><a href="#examples">Examples</a></li>
Expand All @@ -167,30 +167,27 @@ <h1 id="candid-rpc"><a class="header" href="#candid-rpc">Candid RPC</a></h1>
</ul>
<h2 id="get-started"><a class="header" href="#get-started">Get Started</a></h2>
<p>Azle helps you to build secure decentralized/replicated servers in TypeScript or JavaScript on <a href="https://internetcomputer.org/">ICP</a>. The current replication factor is <a href="https://dashboard.internetcomputer.org/subnets">13-40 times</a>.</p>
<p>Please remember that Azle is in beta and thus it may have unknown security vulnerabilities due to the following:</p>
<ul>
<li>Azle is built with various software packages that have not yet reached maturity</li>
<li>Azle does not yet have multiple independent security reviews/audits</li>
<li>Azle does not yet have many live, successful, continuously operating applications deployed to ICP</li>
</ul>
<p>Please remember that Azle stable mode is continuously subjected to <a href="https://github.com/demergent-labs/azle/actions">intense scrutiny and testing</a>, however it does not yet have multiple independent security reviews/audits.</p>
<p>Azle runs in stable mode by default.</p>
<p>This mode is intended for production use after Azle's 1.0 release. Its focus is on API and runtime stability, security, performance, TypeScript and JavaScript language support, the ICP APIs, and Candid remote procedure calls (RPC). There is minimal support for the Node.js standard library, npm ecosystem, and HTTP server functionality.</p>
<h3 id="installation"><a class="header" href="#installation">Installation</a></h3>
<blockquote>
<p>Windows is only supported through a Linux virtual environment of some kind, such as <a href="https://learn.microsoft.com/en-us/windows/wsl/install">WSL</a></p>
</blockquote>
<p>You will need <a href="#nodejs-20">Node.js 20</a> and <a href="#dfx">dfx</a> to develop ICP applications with Azle:</p>
<h4 id="nodejs-20"><a class="header" href="#nodejs-20">Node.js 20</a></h4>
<p>It's recommended to use nvm to install Node.js 20:</p>
<p>You will need <a href="#nodejs-22">Node.js 22</a> and <a href="#dfx">dfx</a> to develop ICP applications with Azle:</p>
<h4 id="nodejs-22"><a class="header" href="#nodejs-22">Node.js 22</a></h4>
<p>It's recommended to use nvm to install Node.js 22:</p>
<pre><code class="language-bash">curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
</code></pre>
<p>Restart your terminal and then run:</p>
<pre><code class="language-bash">nvm install 20
<pre><code class="language-bash">nvm install 22
</code></pre>
<p>Check that the installation went smoothly by looking for clean output from the following command:</p>
<pre><code class="language-bash">node --version
</code></pre>
<h4 id="dfx"><a class="header" href="#dfx">dfx</a></h4>
<p>Install the dfx command line tools for managing ICP applications:</p>
<pre><code class="language-bash">DFX_VERSION=0.22.0 sh -ci &quot;$(curl -fsSL https://internetcomputer.org/install.sh)&quot;
<pre><code class="language-bash">DFX_VERSION=0.24.3 sh -ci &quot;$(curl -fsSL https://internetcomputer.org/install.sh)&quot;
</code></pre>
<p>Check that the installation went smoothly by looking for clean output from the following command:</p>
<pre><code class="language-bash">dfx --version
Expand All @@ -212,7 +209,7 @@ <h3 id="deployment"><a class="header" href="#deployment">Deployment</a></h3>
dfx deploy
</code></pre>
<h2 id="examples"><a class="header" href="#examples">Examples</a></h2>
<p>Some of the best documentation for creating Candid RPC canisters is currently in <a href="https://github.com/demergent-labs/azle/tree/main/tests/end_to_end/candid_rpc/class_syntax">the tests directory</a>.</p>
<p>Some of the best documentation for creating Candid RPC canisters is currently in <a href="https://github.com/demergent-labs/azle/tree/main/examples/stable/test/end_to_end/candid_rpc">the examples directory</a>.</p>
<h2 id="canister-class"><a class="header" href="#canister-class">Canister Class</a></h2>
<p>Your canister's functionality must be encapsulated in a class exported using the default export:</p>
<pre><code class="language-typescript">import { IDL, query } from 'azle';
Expand All @@ -224,9 +221,9 @@ <h2 id="canister-class"><a class="header" href="#canister-class">Canister Class<
}
}
</code></pre>
<p>You must use the <code>@query</code>, <code>@update</code>, <code>@init</code>, <code>@postUpgrade</code>, <code>@preUpgrade</code>, <code>@inspectMessage</code>, and <code>@heartbeat</code> decorators to expose your canister's methods. Adding TypeScript types is optional.</p>
<p>You must use the <a href="#query">@query</a>, <a href="#update">@update</a>, <a href="#init">@init</a>, <a href="#postupgrade">@postUpgrade</a>, <a href="#preupgrade">@preUpgrade</a>, <a href="#inspectmessage">@inspectMessage</a>, and <a href="#heartbeat">@heartbeat</a> decorators to expose your canister's methods. Adding TypeScript types is optional.</p>
<h2 id="dfinitycandid-idl"><a class="header" href="#dfinitycandid-idl">@dfinity/candid IDL</a></h2>
<p>For each of your canister's methods, deserialization of incoming arguments and serialization of return values is handled with a combination of the <code>@query</code>, <code>@update</code>, <code>@init</code>, and <code>@postUpgrade</code> decorators and the <a href="https://agent-js.icp.xyz/candid/modules/IDL.html">IDL</a> object from the <a href="https://agent-js.icp.xyz/candid/index.html">@dfinity/candid</a> library.</p>
<p>For each of your canister's methods, deserialization of incoming arguments and serialization of return values is handled with a combination of the <a href="#query">@query</a>, <a href="#update">@update</a>, <a href="#init">@init</a>, and <a href="#postupgrade">@postUpgrade</a> decorators and the <a href="https://agent-js.icp.xyz/candid/modules/IDL.html">IDL</a> object from the <a href="https://agent-js.icp.xyz/candid/index.html">@dfinity/candid</a> library.</p>
<p><code>IDL</code> is re-exported by Azle, and has properties that correspond to <a href="https://internetcomputer.org/docs/current/references/candid-ref">Candid's supported types</a>. You must use <code>IDL</code> to instruct the method decorators on how to deserialize arguments and serialize the return value. Here's an example of accessing the Candid types from <code>IDL</code>:</p>
<pre><code class="language-typescript">import { IDL } from 'azle';

Expand Down Expand Up @@ -300,7 +297,7 @@ <h3 id="heartbeat"><a class="header" href="#heartbeat">@heartbeat</a></h3>
<p>Exposes the decorated method as the <code>canister_heartbeat</code> method called on a regular interval (every second or so).</p>
<h2 id="ic-api"><a class="header" href="#ic-api">IC API</a></h2>
<p>The IC API is exposed as functions exported from <code>azle</code>. You can see the available functions in <a href="https://github.com/demergent-labs/azle/tree/main/src/lib/stable/ic_apis">the source code</a>.</p>
<p>Some of the best documentation for using the IC API is currently in <a href="https://github.com/demergent-labs/azle/tree/main/tests/end_to_end/candid_rpc/class_syntax">the tests directory</a>, especially the <a href="https://github.com/demergent-labs/azle/blob/main/tests/end_to_end/candid_rpc/class_syntax/ic_api/src/index.ts">ic_api test example</a>.</p>
<p>Some of the best documentation for using the IC API is currently in <a href="https://github.com/demergent-labs/azle/tree/main/examples/stable">the examples directory</a>, especially the <a href="https://github.com/demergent-labs/azle/tree/main/examples/stable/test/property/ic_api">ic_api property tests</a>.</p>
<p>Here's an example of getting the caller's principal using the <code>caller</code> function:</p>
<pre><code class="language-typescript">import { caller, IDL, update } from 'azle';

Expand Down
2 changes: 1 addition & 1 deletion docs/candid_rpc_or_http_server.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ <h1 id="candid-rpc-or-http-server"><a class="header" href="#candid-rpc-or-http-s
<p>Azle applications (<a href="https://internetcomputer.org/docs/current/concepts/canisters-code">canisters</a>) can be developed using two main methodologies: <a href="./candid_rpc.html">Candid RPC</a> and <a href="./http_server.html">HTTP Server</a>.</p>
<p>Candid RPC embraces ICP's <a href="https://internetcomputer.org/docs/current/developer-docs/smart-contracts/candid/">Candid language</a>, exposing canister methods directly to Candid-speaking clients, and using Candid for serialization and deserialization purposes.</p>
<p>HTTP Server embraces traditional web server techniques, allowing you to write HTTP servers using popular libraries such as <a href="https://expressjs.com/">Express</a>, and using <a href="https://www.json.org/json-en.html">JSON</a> for simple serialization and deserialization purposes.</p>
<p>Candid RPC is heading towards 1.0 and production-readiness in 2024.</p>
<p>Candid RPC is heading towards 1.0 and production-readiness in 2025.</p>
<p>HTTP Server will remain experimental for an unknown length of time.</p>

</main>
Expand Down
Loading

0 comments on commit c5ed9b6

Please sign in to comment.