You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: archive/motoko/persistent-storage/README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ This example covers:
24
24
## Installation
25
25
This example project can be cloned, installed, and deployed locally, for learning and testing purposes. The instructions are based on running the example on either macOS or Linux, but when using WSL2 on Windows, the instructions will be the same.
26
26
27
-
###Prerequisites
27
+
## Prerequisites
28
28
This example requires an installation of:
29
29
30
30
-[x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
Copy file name to clipboardExpand all lines: motoko/encrypted-notes-dapp/README.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ This is an **example dapp** that demonstrates the potential of building **canist
20
20
21
21
- The frontend re-uses the generated public and private key pair for every identity in the same browser. In a better implementation, this key pair should be unique per principal.
22
22
- The public/private key pair should not be managed by the web browser at all. [WebAuthn](https://en.wikipedia.org/wiki/WebAuthn) should be used to push the key management to the operating system.
23
-
- Integer overflows are possible in the Rust canister, e.g., for `NEXT_NOTE`.
23
+
- Integer overflows are possible in the Rust canister, e.g., for `NEXT_NOTE`.
24
24
- Users may lose their notes if they accidentally clean the browser data (localStorage) while no other device is synced to the dapp.
25
25
- Lack of key update: Given that the key used to encrypt the notes is never refreshed, the privacy of the data is no longer guaranteed if an attacker learns this key (for instance, by corrupting the local storage in one of the connected devices).
26
26
@@ -29,8 +29,8 @@ This is an **example dapp** that demonstrates the potential of building **canist
29
29
30
30
You can play around with the [dapp deployed on ICP](https://cvhrw-2yaaa-aaaaj-aaiqa-cai.icp0.io/) and see a quick introduction on [YouTube](https://youtu.be/DZQmtPSxvbs).
31
31
32
-
We wanted to build an example of a simple (but not too simple) dapp running purely on the IC. This example relies upon the **web-serving** and **storage capabilities** of the IC. We focused on the following two key features for our example dapp:
33
-
1. Client-side **end-to-end encryption**.
32
+
We wanted to build an example of a simple (but not too simple) dapp running purely on the IC. This example relies upon the **web-serving** and **storage capabilities** of the IC. We focused on the following two key features for our example dapp:
33
+
1. Client-side **end-to-end encryption**.
34
34
2.**Multi-user** and **multi-device** support.
35
35
36
36
To demonstrate the potential of the IC as a platform for developing such dapps, we implemented this example using two distinct canister development kits (CDKs). The Motoko CDK allows developers to implement actor-based dapps using the [Motoko](https://internetcomputer.org/docs/current/motoko/getting-started/motoko-introduction) language. The Rust CDK allows implementing dapps in [Rust](https://internetcomputer.org/docs/current/developer-docs/backend/rust/). In both cases, canisters are compiled into WebAssembly files that are then deployed onto the IC.
@@ -100,7 +100,7 @@ Once authenticated with II:
100
100
101
101
Follow the steps below to deploy this sample project.
102
102
103
-
###Prerequisites
103
+
## Prerequisites
104
104
This example requires an installation of:
105
105
106
106
-[x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
@@ -126,7 +126,7 @@ export BUILD_ENV=motoko
126
126
127
127
128
128
**Building the Rust canister requires either the Rust toolchain installed on your system or Docker-backed deployment (see below).**
129
-
129
+
130
130
## Step 3: Deploy locally
131
131
132
132
### Option 1: Docker deployment
@@ -139,7 +139,7 @@ export BUILD_ENV=motoko
139
139
export BUILD_ENV=motoko
140
140
```
141
141
142
-
-#### Step 3: Run the following Bash script that builds a Docker image, compiles the canister, and deploys this dapp (all inside the Docker instance).
142
+
-#### Step 3: Run the following Bash script that builds a Docker image, compiles the canister, and deploys this dapp (all inside the Docker instance).
If you base your application on this example, we recommend you familiarize yourself with and adhere to the [security best practices](https://internetcomputer.org/docs/current/references/security/) for developing on the Internet Computer. This example may not implement all the best practices, see also the [disclaimer](#disclaimer-please-read-carefully) above.
281
+
If you base your application on this example, we recommend you familiarize yourself with and adhere to the [security best practices](https://internetcomputer.org/docs/current/references/security/) for developing on the Internet Computer. This example may not implement all the best practices, see also the [disclaimer](#disclaimer-please-read-carefully) above.
282
282
283
-
For example, the following aspects are particularly relevant for this app:
283
+
For example, the following aspects are particularly relevant for this app:
284
284
*[Make sure any action that only a specific user should be able to do requires authentication](https://internetcomputer.org/docs/current/developer-docs/security/security-best-practices/overview), since a user should only be able to manage their own notes.
285
-
*[Protect key material against XSS using Web Crypto API](https://internetcomputer.org/docs/current/references/security/web-app-development-security-best-practices#crypto-protect-key-material-against-xss-using-web-crypto-api), since this app stores private keys in the browser.
285
+
*[Protect key material against XSS using Web Crypto API](https://internetcomputer.org/docs/current/references/security/web-app-development-security-best-practices#crypto-protect-key-material-against-xss-using-web-crypto-api), since this app stores private keys in the browser.
286
286
*[Use secure cryptographic schemes](https://internetcomputer.org/docs/current/references/security/general-security-best-practices#use-secure-cryptographic-schemes), since notes are being encrypted.
287
287
288
288
## User interaction with "Encrypted Notes" dapp
@@ -476,7 +476,7 @@ frontend www canister (an "asset" canister) is the way we describe a set of file
476
476
`dependencies`: an array of whatever canisters are being used to serve your app, to ensure that `dfx` builds and deploys them before your app.
477
477
`frontend: { entrypoint: ""}`: This set of keys tells `dfx` to build it as a frontend canister, and entrypoint is wherever your app entrypoint winds up residing at the end of an npm build
478
478
`source`: where the rest of your app resides at the end of npm build
479
-
`type`: "assets" for an assets or static canister.
479
+
`type`: "assets" for an assets or static canister.
480
480
481
481
**Binary targets**:
482
482
You can also just deploy arbitrary binary targets as long as they're wasm binaries. For that, use the keys:
Log in to the frontend using **a new Internet Identity using another web browser**. Give this store a name as well and copy the store principal like in the previous step.
206
+
Log in to the frontend using **a new Internet Identity using another web browser**. Give this store a name as well and copy the store principal like in the previous step.
207
207
208
208
Now, go back to the first browser/store, navigate to the `Send` page, and transfer some tokens to the second store.
209
209
@@ -213,7 +213,7 @@ If everything is working, you should see a notification in the second store.
213
213
214
214
## Possible improvements
215
215
216
-
- Show more information about transactions.
216
+
- Show more information about transactions.
217
217
- A transaction detail page.
218
218
- Pagination, currently only the first 5 transactions are shown.
219
219
- Show a confirmation dialog after the user clicks on the `Send` button.
Copy file name to clipboardExpand all lines: motoko/internet_identity_integration/README.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Internet Identity integration
1
+
# Internet Identity integration
2
2
3
3
This tutorial shows how to integrate Internet Identity into a dapp front-end and make use of the user identity in the backend. It builds on the "greet" dapp that is generated by running `dfx new`. If you are unfamiliar with `dfx new` and the generated application, please have a look at [this](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx) guide first.
4
4
@@ -11,12 +11,12 @@ This tutorial will explain all the steps required to integrate the default start
11
11
12
12
This is a Motoko example that does not currently have a Rust variant.
13
13
14
-
###Prerequisites
14
+
## Prerequisites
15
15
This example requires an installation of:
16
16
17
17
-[x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
18
18
-[x] Clone the example dapp project: `git clone https://github.com/dfinity/examples`
19
-
-[x] Download and install the `@dfinity/auth-client` package with the command `npm install @dfinity/auth-client`.
19
+
-[x] Download and install the `@dfinity/auth-client` package with the command `npm install @dfinity/auth-client`.
20
20
-[x] Chrome or Firefox browser (other browsers also work, but may need a slightly different webpack configuration, see the note on [step 4 below](#step-4-make-the-internet-identity-url-available-in-the-build-process))
The Candid interface is automatically created, and it has a convenient UI, which provides an easy, user-friendly way to test the backend. Learn how to access the Candid UI in the **Testing** section below.
126
+
The Candid interface is automatically created, and it has a convenient UI, which provides an easy, user-friendly way to test the backend. Learn how to access the Candid UI in the **Testing** section below.
127
127
128
128
### Frontend
129
129
The default project installed with `dfx new project_name` implements the logic that serves the frontend in the `src/minimal_dapp_frontend/src/App.js` file, and most of the HTML is carried over from the default project.
Copy file name to clipboardExpand all lines: motoko/parallel_calls/README.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ The sample code revolves around two simple canisters, `caller` and `callee`. `Ca
10
10
11
11
The callee exposes a simple `ping` endpoint that takes no parameters and returns nothing.
12
12
13
-
###Prerequisites
13
+
## Prerequisites
14
14
This example requires an installation of:
15
15
16
16
-[x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
@@ -54,7 +54,7 @@ This should output:
54
54
(100 : nat64)
55
55
```
56
56
57
-
And the other endpoint:
57
+
And the other endpoint:
58
58
59
59
```bash
60
60
dfx canister call caller parallel_calls 100
@@ -96,9 +96,9 @@ Lastly, the parallel calls here complete sooner -- because most of them fail!
96
96
97
97
## Step 5: Multi-subnet setting
98
98
99
-
Parallel calls are a lot more useful in multi-subnet settings. We can create such a setting locally using Pocket IC.
99
+
Parallel calls are a lot more useful in multi-subnet settings. We can create such a setting locally using Pocket IC.
100
100
101
-
First, follow the [installation instructions](https://github.com/dfinity/pocketic) to install `pocket-ic` in the `parallel_calls` directory.
101
+
First, follow the [installation instructions](https://github.com/dfinity/pocketic) to install `pocket-ic` in the `parallel_calls` directory.
102
102
103
103
Then, run the pre-made test, which now installs the `caller` and `callee` canisters on different subnets, and then runs 90 calls sequentially/in parallel.
Copy file name to clipboardExpand all lines: motoko/pub-sub/README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This sample project demonstrates how functions may be passed as arguments of int
4
4
5
5
A common problem in both distributed and decentralized systems is keeping separate services (or canisters) synchronized with one another. While there are many potential solutions to this problem, a popular one is the publisher/subscriber pattern or "PubSub". PubSub is an especially valuable pattern on the Internet Computer as its primary drawback, message delivery failures, does not apply.
6
6
7
-
###Prerequisites
7
+
## Prerequisites
8
8
This example requires an installation of:
9
9
10
10
-[x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
@@ -55,7 +55,7 @@ The output should resemble the following:
55
55
56
56
If you base your application on this example, we recommend you familiarize yourself with and adhere to the [security best practices](https://internetcomputer.org/docs/current/references/security/) for developing on the Internet Computer. This example may not implement all the best practices.
57
57
58
-
For example, the following aspects are particularly relevant for this app, since it makes inter-canister calls:
58
+
For example, the following aspects are particularly relevant for this app, since it makes inter-canister calls:
59
59
*[Be aware that state may change during inter-canister calls.](https://internetcomputer.org/docs/current/developer-docs/security/security-best-practices/overview)
60
60
*[Only make inter-canister calls to trustworthy canisters.](https://internetcomputer.org/docs/current/developer-docs/security/security-best-practices/overview)
61
61
*[Don’t panic after await and don’t lock shared resources across await boundaries.](https://internetcomputer.org/docs/current/developer-docs/security/security-best-practices/overview)
Copy file name to clipboardExpand all lines: motoko/random_maze/README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,9 @@ This actor uses Motoko's random library to generate a cryptographically random m
16
16
17
17
The function `generate` calls library function `Random.blob()` asynchronously to obtain 256 bits of raw entropy (256 random bits as 32 bytes) from the Internet Computer. It makes these calls on demand as it is constructing a maze. The bits of these blobs are consumed to generate samples from a variety of discrete distributions using some of the other classes and functions of library Random.mo.
18
18
19
-
This is a Motoko example that does not currently have a Rust variant.
19
+
This is a Motoko example that does not currently have a Rust variant.
20
20
21
-
###Prerequisites
21
+
## Prerequisites
22
22
This example requires an installation of:
23
23
24
24
-[x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
0 commit comments