Skip to content

Commit 2c5d1f1

Browse files
authored
Merge pull request #497 from demergent-labs/update_documentation
Update documentation
2 parents a7568d6 + 6ad24f5 commit 2c5d1f1

File tree

10 files changed

+78
-70
lines changed

10 files changed

+78
-70
lines changed

docs/deployment.html

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,27 @@ <h2 id="deploying-to-mainnet"><a class="header" href="#deploying-to-mainnet">Dep
247247
<h2 id="common-deployment-issues"><a class="header" href="#common-deployment-issues">Common deployment issues</a></h2>
248248
<p>If you run into an error during deployment, try the following:</p>
249249
<ol>
250-
<li>Ensure that you have followed the instructions correctly in <a href="./installation.html">the installation chapter</a>, especially noting <a href="./installation.html#common-installation-issues">the common installation issues</a></li>
251-
<li>Look for more error output by adding the <code>--verbose</code> flag to the <code>build</code> command in your <code>dfx.json</code> file like so: <code>&quot;build&quot;: &quot;python -m kybra canister_name src/main.py src/main.did --verbose</code></li>
252-
<li>Look for errors in each of the files in <code>~/.config/kybra/[kybra_version]/logs</code></li>
253-
<li>If the problem is still not resolved, reach out with any error outputs in <a href="https://discord.gg/ux2Jc7psjd">the Discord channel</a></li>
250+
<li>
251+
<p>Ensure that you have followed the instructions correctly in <a href="./installation.html">the installation chapter</a>, especially noting <a href="./installation.html#common-installation-issues">the common installation issues</a></p>
252+
</li>
253+
<li>
254+
<p>Ensure that you have created and activated your virtual environment, and that you have done the following from within that virtual environment: installed Kybra, installed the Kybra dfx extension, and run <code>dfx deploy</code>:</p>
255+
<pre><code class="language-bash">~/.pyenv/versions/3.10.7/bin/python -m venv venv
256+
source venv/bin/activate
257+
pip install kybra
258+
python -m kybra install-dfx-extension
259+
dfx deploy
260+
</code></pre>
261+
</li>
262+
<li>
263+
<p>Look for more error output by adding the <code>KYBRA_VERBOSE=true</code> environment variable to <code>dfx deploy</code> like so: <code>KYBRA_VERBOSE=true dfx deploy</code></p>
264+
</li>
265+
<li>
266+
<p>Look for errors in each of the files in <code>~/.config/kybra/[kybra_version]/logs</code></p>
267+
</li>
268+
<li>
269+
<p>If the problem is still not resolved, reach out with any error outputs in <a href="https://discord.gg/ux2Jc7psjd">the Discord channel</a></p>
270+
</li>
254271
</ol>
255272

256273
</main>

docs/hello_world.html

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,9 @@ <h2 id="the-project-directory-and-file-structure"><a class="header" href="#the-p
170170
<pre><code class="language-bash">~/.pyenv/versions/3.10.7/bin/python -m venv venv
171171
source venv/bin/activate
172172
</code></pre>
173-
<p>Now install Kybra:</p>
173+
<p>Now install Kybra and the Kybra dfx extension:</p>
174174
<pre><code class="language-bash">pip install kybra
175+
python -m kybra install-dfx-extension
175176
</code></pre>
176177
<p>Open up <code>kybra_hello_world</code> in your text editor (we recommend <a href="https://code.visualstudio.com/">VS Code</a> with the <a href="https://marketplace.visualstudio.com/items?itemName=ms-python.python">Microsoft Python extension</a>).</p>
177178
<h2 id="mainpy"><a class="header" href="#mainpy">main.py</a></h2>
@@ -222,21 +223,8 @@ <h2 id="dfxjson"><a class="header" href="#dfxjson">dfx.json</a></h2>
222223
<pre><code class="language-json">{
223224
&quot;canisters&quot;: {
224225
&quot;kybra_hello_world&quot;: {
225-
&quot;type&quot;: &quot;custom&quot;,
226-
&quot;build&quot;: &quot;python -m kybra kybra_hello_world src/main.py src/main.did&quot;,
227-
&quot;candid&quot;: &quot;src/main.did&quot;,
228-
&quot;wasm&quot;: &quot;.kybra/kybra_hello_world/kybra_hello_world.wasm&quot;,
229-
&quot;gzip&quot;: true,
230-
&quot;metadata&quot;: [
231-
{
232-
&quot;name&quot;: &quot;candid:service&quot;,
233-
&quot;path&quot;: &quot;src/main.did&quot;
234-
},
235-
{
236-
&quot;name&quot;: &quot;cdk:name&quot;,
237-
&quot;content&quot;: &quot;kybra&quot;
238-
}
239-
]
226+
&quot;type&quot;: &quot;kybra&quot;,
227+
&quot;main&quot;: &quot;src/main.py&quot;
240228
}
241229
}
242230
}

docs/installation.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ <h2 id="dependencies"><a class="header" href="#dependencies">Dependencies</a></h
154154
<p>You should be using a *nix environment (Linux, Mac OS, <a href="https://learn.microsoft.com/en-us/windows/wsl/install">WSL if using Windows</a>) with bash and have the following installed on your system:</p>
155155
<ul>
156156
<li>Python 3.10.7</li>
157-
<li>dfx 0.19.0</li>
157+
<li>dfx 0.23.0</li>
158158
<li>Python VS Code Extension</li>
159159
</ul>
160160
<h3 id="python-3107"><a class="header" href="#python-3107">Python 3.10.7</a></h3>
@@ -166,8 +166,8 @@ <h3 id="python-3107"><a class="header" href="#python-3107">Python 3.10.7</a></h3
166166
~/.pyenv/bin/pyenv install 3.10.7
167167
</code></pre>
168168
<h3 id="dfx"><a class="header" href="#dfx">dfx</a></h3>
169-
<p>Run the following command to install dfx 0.19.0:</p>
170-
<pre><code class="language-bash">DFX_VERSION=0.19.0 sh -ci &quot;$(curl -fsSL https://sdk.dfinity.org/install.sh)&quot;
169+
<p>Run the following command to install dfx 0.23.0:</p>
170+
<pre><code class="language-bash">DFX_VERSION=0.23.0 sh -ci &quot;$(curl -fsSL https://sdk.dfinity.org/install.sh)&quot;
171171
</code></pre>
172172
<p>If after trying to run <code>dfx</code> commands you encounter an error such as <code>dfx: command not found</code>, you might need to add <code>$HOME/bin</code> to your path. Here's an example of doing this in your <code>.bashrc</code>:</p>
173173
<pre><code class="language-bash">echo 'export PATH=&quot;$PATH:$HOME/bin&quot;' &gt;&gt; &quot;$HOME/.bashrc&quot;

docs/kybra.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ <h2 id="disclaimer"><a class="header" href="#disclaimer">Disclaimer</a></h2>
160160
<li>Kybra uses a new Python interpreter that is less mature than CPython</li>
161161
</ul>
162162
<h2 id="roadmap"><a class="header" href="#roadmap">Roadmap</a></h2>
163-
<p>We hope to get to a production-ready 1.0 in 2024. The following are the major blockers to 1.0:</p>
163+
<p>We hope to get to a production-ready 1.0 in 2025. The following are the major blockers to 1.0:</p>
164164
<ul>
165165
<li>CPython integration for performance, security, and stability</li>
166166
<li>Broad PyPI package support (C API/extensions)</li>

docs/print.html

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ <h2 id="disclaimer"><a class="header" href="#disclaimer">Disclaimer</a></h2>
194194
<li>Kybra uses a new Python interpreter that is less mature than CPython</li>
195195
</ul>
196196
<h2 id="roadmap"><a class="header" href="#roadmap">Roadmap</a></h2>
197-
<p>We hope to get to a production-ready 1.0 in 2024. The following are the major blockers to 1.0:</p>
197+
<p>We hope to get to a production-ready 1.0 in 2025. The following are the major blockers to 1.0:</p>
198198
<ul>
199199
<li>CPython integration for performance, security, and stability</li>
200200
<li>Broad PyPI package support (C API/extensions)</li>
@@ -342,7 +342,7 @@ <h2 id="dependencies"><a class="header" href="#dependencies">Dependencies</a></h
342342
<p>You should be using a *nix environment (Linux, Mac OS, <a href="https://learn.microsoft.com/en-us/windows/wsl/install">WSL if using Windows</a>) with bash and have the following installed on your system:</p>
343343
<ul>
344344
<li>Python 3.10.7</li>
345-
<li>dfx 0.19.0</li>
345+
<li>dfx 0.23.0</li>
346346
<li>Python VS Code Extension</li>
347347
</ul>
348348
<h3 id="python-3107"><a class="header" href="#python-3107">Python 3.10.7</a></h3>
@@ -354,8 +354,8 @@ <h3 id="python-3107"><a class="header" href="#python-3107">Python 3.10.7</a></h3
354354
~/.pyenv/bin/pyenv install 3.10.7
355355
</code></pre>
356356
<h3 id="dfx"><a class="header" href="#dfx">dfx</a></h3>
357-
<p>Run the following command to install dfx 0.19.0:</p>
358-
<pre><code class="language-bash">DFX_VERSION=0.19.0 sh -ci &quot;$(curl -fsSL https://sdk.dfinity.org/install.sh)&quot;
357+
<p>Run the following command to install dfx 0.23.0:</p>
358+
<pre><code class="language-bash">DFX_VERSION=0.23.0 sh -ci &quot;$(curl -fsSL https://sdk.dfinity.org/install.sh)&quot;
359359
</code></pre>
360360
<p>If after trying to run <code>dfx</code> commands you encounter an error such as <code>dfx: command not found</code>, you might need to add <code>$HOME/bin</code> to your path. Here's an example of doing this in your <code>.bashrc</code>:</p>
361361
<pre><code class="language-bash">echo 'export PATH=&quot;$PATH:$HOME/bin&quot;' &gt;&gt; &quot;$HOME/.bashrc&quot;
@@ -416,8 +416,9 @@ <h2 id="the-project-directory-and-file-structure"><a class="header" href="#the-p
416416
<pre><code class="language-bash">~/.pyenv/versions/3.10.7/bin/python -m venv venv
417417
source venv/bin/activate
418418
</code></pre>
419-
<p>Now install Kybra:</p>
419+
<p>Now install Kybra and the Kybra dfx extension:</p>
420420
<pre><code class="language-bash">pip install kybra
421+
python -m kybra install-dfx-extension
421422
</code></pre>
422423
<p>Open up <code>kybra_hello_world</code> in your text editor (we recommend <a href="https://code.visualstudio.com/">VS Code</a> with the <a href="https://marketplace.visualstudio.com/items?itemName=ms-python.python">Microsoft Python extension</a>).</p>
423424
<h2 id="mainpy"><a class="header" href="#mainpy">main.py</a></h2>
@@ -468,21 +469,8 @@ <h2 id="dfxjson"><a class="header" href="#dfxjson">dfx.json</a></h2>
468469
<pre><code class="language-json">{
469470
&quot;canisters&quot;: {
470471
&quot;kybra_hello_world&quot;: {
471-
&quot;type&quot;: &quot;custom&quot;,
472-
&quot;build&quot;: &quot;python -m kybra kybra_hello_world src/main.py src/main.did&quot;,
473-
&quot;candid&quot;: &quot;src/main.did&quot;,
474-
&quot;wasm&quot;: &quot;.kybra/kybra_hello_world/kybra_hello_world.wasm&quot;,
475-
&quot;gzip&quot;: true,
476-
&quot;metadata&quot;: [
477-
{
478-
&quot;name&quot;: &quot;candid:service&quot;,
479-
&quot;path&quot;: &quot;src/main.did&quot;
480-
},
481-
{
482-
&quot;name&quot;: &quot;cdk:name&quot;,
483-
&quot;content&quot;: &quot;kybra&quot;
484-
}
485-
]
472+
&quot;type&quot;: &quot;kybra&quot;,
473+
&quot;main&quot;: &quot;src/main.py&quot;
486474
}
487475
}
488476
}
@@ -622,10 +610,27 @@ <h2 id="deploying-to-mainnet"><a class="header" href="#deploying-to-mainnet">Dep
622610
<h2 id="common-deployment-issues"><a class="header" href="#common-deployment-issues">Common deployment issues</a></h2>
623611
<p>If you run into an error during deployment, try the following:</p>
624612
<ol>
625-
<li>Ensure that you have followed the instructions correctly in <a href="./installation.html">the installation chapter</a>, especially noting <a href="./installation.html#common-installation-issues">the common installation issues</a></li>
626-
<li>Look for more error output by adding the <code>--verbose</code> flag to the <code>build</code> command in your <code>dfx.json</code> file like so: <code>&quot;build&quot;: &quot;python -m kybra canister_name src/main.py src/main.did --verbose</code></li>
627-
<li>Look for errors in each of the files in <code>~/.config/kybra/[kybra_version]/logs</code></li>
628-
<li>If the problem is still not resolved, reach out with any error outputs in <a href="https://discord.gg/ux2Jc7psjd">the Discord channel</a></li>
613+
<li>
614+
<p>Ensure that you have followed the instructions correctly in <a href="./installation.html">the installation chapter</a>, especially noting <a href="./installation.html#common-installation-issues">the common installation issues</a></p>
615+
</li>
616+
<li>
617+
<p>Ensure that you have created and activated your virtual environment, and that you have done the following from within that virtual environment: installed Kybra, installed the Kybra dfx extension, and run <code>dfx deploy</code>:</p>
618+
<pre><code class="language-bash">~/.pyenv/versions/3.10.7/bin/python -m venv venv
619+
source venv/bin/activate
620+
pip install kybra
621+
python -m kybra install-dfx-extension
622+
dfx deploy
623+
</code></pre>
624+
</li>
625+
<li>
626+
<p>Look for more error output by adding the <code>KYBRA_VERBOSE=true</code> environment variable to <code>dfx deploy</code> like so: <code>KYBRA_VERBOSE=true dfx deploy</code></p>
627+
</li>
628+
<li>
629+
<p>Look for errors in each of the files in <code>~/.config/kybra/[kybra_version]/logs</code></p>
630+
</li>
631+
<li>
632+
<p>If the problem is still not resolved, reach out with any error outputs in <a href="https://discord.gg/ux2Jc7psjd">the Discord channel</a></p>
633+
</li>
629634
</ol>
630635
<div style="break-before: page; page-break-before: always;"></div><h1 id="examples"><a class="header" href="#examples">Examples</a></h1>
631636
<p>Kybra has many example projects showing nearly all Kybra APIs. They can be found in the <a href="https://github.com/demergent-labs/kybra/tree/main/examples">examples directory</a> of the <a href="https://github.com/demergent-labs/kybra">Kybra GitHub repository</a>.</p>

docs/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/searchindex.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

the_kybra_book/src/deployment.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,16 @@ If you have problems deploying see [Common deployment issues](./deployment.md#co
160160
If you run into an error during deployment, try the following:
161161

162162
1. Ensure that you have followed the instructions correctly in [the installation chapter](./installation.md), especially noting [the common installation issues](./installation.md#common-installation-issues)
163-
2. Look for more error output by adding the `--verbose` flag to the `build` command in your `dfx.json` file like so: `"build": "python -m kybra canister_name src/main.py src/main.did --verbose`
164-
3. Look for errors in each of the files in `~/.config/kybra/[kybra_version]/logs`
165-
4. If the problem is still not resolved, reach out with any error outputs in [the Discord channel](https://discord.gg/ux2Jc7psjd)
163+
2. Ensure that you have created and activated your virtual environment, and that you have done the following from within that virtual environment: installed Kybra, installed the Kybra dfx extension, and run `dfx deploy`:
164+
165+
```bash
166+
~/.pyenv/versions/3.10.7/bin/python -m venv venv
167+
source venv/bin/activate
168+
pip install kybra
169+
python -m kybra install-dfx-extension
170+
dfx deploy
171+
```
172+
173+
3. Look for more error output by adding the `KYBRA_VERBOSE=true` environment variable to `dfx deploy` like so: `KYBRA_VERBOSE=true dfx deploy`
174+
4. Look for errors in each of the files in `~/.config/kybra/[kybra_version]/logs`
175+
5. If the problem is still not resolved, reach out with any error outputs in [the Discord channel](https://discord.gg/ux2Jc7psjd)

the_kybra_book/src/hello_world.md

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ Now create and source a virtual environment:
3434
source venv/bin/activate
3535
```
3636

37-
Now install Kybra:
37+
Now install Kybra and the Kybra dfx extension:
3838

3939
```bash
4040
pip install kybra
41+
python -m kybra install-dfx-extension
4142
```
4243

4344
Open up `kybra_hello_world` in your text editor (we recommend [VS Code](https://code.visualstudio.com/) with the [Microsoft Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python)).
@@ -112,21 +113,8 @@ Create the following in `kybra_hello_world/dfx.json`:
112113
{
113114
"canisters": {
114115
"kybra_hello_world": {
115-
"type": "custom",
116-
"build": "python -m kybra kybra_hello_world src/main.py src/main.did",
117-
"candid": "src/main.did",
118-
"wasm": ".kybra/kybra_hello_world/kybra_hello_world.wasm",
119-
"gzip": true,
120-
"metadata": [
121-
{
122-
"name": "candid:service",
123-
"path": "src/main.did"
124-
},
125-
{
126-
"name": "cdk:name",
127-
"content": "kybra"
128-
}
129-
]
116+
"type": "kybra",
117+
"main": "src/main.py"
130118
}
131119
}
132120
}

the_kybra_book/src/kybra.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Kybra may have unknown security vulnerabilities due to the following:
1717

1818
## Roadmap
1919

20-
We hope to get to a production-ready 1.0 in 2024. The following are the major blockers to 1.0:
20+
We hope to get to a production-ready 1.0 in 2025. The following are the major blockers to 1.0:
2121

2222
- CPython integration for performance, security, and stability
2323
- Broad PyPI package support (C API/extensions)

0 commit comments

Comments
 (0)