Skip to content

Commit

Permalink
fix size
Browse files Browse the repository at this point in the history
  • Loading branch information
jessiemongeon1 committed Dec 19, 2024
1 parent 17d0ac3 commit da93e55
Show file tree
Hide file tree
Showing 25 changed files with 68 additions and 68 deletions.
2 changes: 1 addition & 1 deletion archive/motoko/dip721-nft-container/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Using this management canister address, we can construct its principal and set t

## NFT sample code tutorial

### Prerequisites
## Prerequisites

- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
- [x] Download and install [git.](https://git-scm.com/downloads)
Expand Down
2 changes: 1 addition & 1 deletion archive/motoko/hello/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This example demonstrates a dead simple dapp consisting of two canister smart co

This example is based on the default project created by running `dfx new hello`.

### Prerequisites
## Prerequisites
This example requires an installation of:
- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
- [x] Install `node.js` (to build the web frontend).
Expand Down
2 changes: 1 addition & 1 deletion archive/motoko/persistent-storage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This example covers:
## Installation
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.

### Prerequisites
## Prerequisites
This example requires an installation of:

- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
Expand Down
2 changes: 1 addition & 1 deletion motoko/counter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The application provides an interface that exposes the following methods:
- `inc`: increments the value of the counter.
- `get`: gets the value of the counter.

### Prerequisites
## Prerequisites
This example requires an installation of:

- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
Expand Down
2 changes: 1 addition & 1 deletion motoko/encrypted-notes-dapp-vetkd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This example uses an **insecure** implementation of [the proposed vetKD system A

## Manual local deployment

### Prerequisites
## Prerequisites

This example requires an installation of:

Expand Down
20 changes: 10 additions & 10 deletions motoko/encrypted-notes-dapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This is an **example dapp** that demonstrates the potential of building **canist

- 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.
- 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.
- Integer overflows are possible in the Rust canister, e.g., for `NEXT_NOTE`.
- Integer overflows are possible in the Rust canister, e.g., for `NEXT_NOTE`.
- Users may lose their notes if they accidentally clean the browser data (localStorage) while no other device is synced to the dapp.
- 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).

Expand All @@ -29,8 +29,8 @@ This is an **example dapp** that demonstrates the potential of building **canist

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).

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:
1. Client-side **end-to-end encryption**.
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:
1. Client-side **end-to-end encryption**.
2. **Multi-user** and **multi-device** support.

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.
Expand Down Expand Up @@ -100,7 +100,7 @@ Once authenticated with II:

Follow the steps below to deploy this sample project.

### Prerequisites
## Prerequisites
This example requires an installation of:

- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
Expand All @@ -126,7 +126,7 @@ export BUILD_ENV=motoko


**Building the Rust canister requires either the Rust toolchain installed on your system or Docker-backed deployment (see below).**

## Step 3: Deploy locally

### Option 1: Docker deployment
Expand All @@ -139,7 +139,7 @@ export BUILD_ENV=motoko
export BUILD_ENV=motoko
```

- #### Step 3: Run the following Bash script that builds a Docker image, compiles the canister, and deploys this dapp (all inside the Docker instance).
- #### Step 3: Run the following Bash script that builds a Docker image, compiles the canister, and deploys this dapp (all inside the Docker instance).

Execution can take a few minutes:

Expand Down Expand Up @@ -278,11 +278,11 @@ dfx canister --network ic install www --mode=upgrade

## Security considerations and best practices

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.
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.

For example, the following aspects are particularly relevant for this app:
For example, the following aspects are particularly relevant for this app:
* [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.
* [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.
* [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.
* [Use secure cryptographic schemes](https://internetcomputer.org/docs/current/references/security/general-security-best-practices#use-secure-cryptographic-schemes), since notes are being encrypted.

## User interaction with "Encrypted Notes" dapp
Expand Down Expand Up @@ -476,7 +476,7 @@ frontend www canister (an "asset" canister) is the way we describe a set of file
`dependencies`: an array of whatever canisters are being used to serve your app, to ensure that `dfx` builds and deploys them before your app.
`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
`source`: where the rest of your app resides at the end of npm build
`type`: "assets" for an assets or static canister.
`type`: "assets" for an assets or static canister.

**Binary targets**:
You can also just deploy arbitrary binary targets as long as they're wasm binaries. For that, use the keys:
Expand Down
6 changes: 3 additions & 3 deletions motoko/hello_cycles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ This example consists of the following functions (see `src/hello_cycles/main.mo`
The wallet's `wallet_receive` return type differs from hello_cycle's `wallet_receive`.
:::

This is a Motoko example that does not currently have a Rust variant.
This is a Motoko example that does not currently have a Rust variant.

### Prerequisites
## Prerequisites
This example requires an installation of:

- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
Expand Down Expand Up @@ -124,7 +124,7 @@ The amount is only increased by 10_000_000 because the implementation of `wallet
dfx canister call hello_cycles transfer "(func \"$(dfx identity get-wallet)\".\"wallet_receive\", 5000000)"
```
Output:
Output:
```bash
(record { refunded = 0 : nat })
Expand Down
8 changes: 4 additions & 4 deletions motoko/ic-pos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The frontend interacts with the following IC canisters:
- `ckbtc index` - to fetch transaction history.
- `internet identity` - to authenticate users.

### Prerequisites
## Prerequisites
This example requires an installation of:

- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
Expand Down Expand Up @@ -171,7 +171,7 @@ dfx canister call icpos setCourierApiKey "pk_prod_..."

### Step 8: Build and run the frontend

Run npm to install dependencies and start a development version of the frontend.
Run npm to install dependencies and start a development version of the frontend.

```bash
pnpm install
Expand Down Expand Up @@ -203,7 +203,7 @@ dfx canister call icrc1_ledger icrc1_transfer '

### Step 11: Create the second store

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.
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.

Now, go back to the first browser/store, navigate to the `Send` page, and transfer some tokens to the second store.

Expand All @@ -213,7 +213,7 @@ If everything is working, you should see a notification in the second store.

## Possible improvements

- Show more information about transactions.
- Show more information about transactions.
- A transaction detail page.
- Pagination, currently only the first 5 transactions are shown.
- Show a confirmation dialog after the user clicks on the `Send` button.
Expand Down
4 changes: 2 additions & 2 deletions motoko/icrc2-swap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ different from other synchronous blockchains.

## Local deployment

### Prerequisites
## Prerequisites
This example requires an installation of:

- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
Expand Down Expand Up @@ -265,7 +265,7 @@ the token balances.
The example comes with a test suite to demonstrate the basic functionality. It
shows how to use this repo from a Javascript client.

### Prerequisites
## Prerequisites
This example requires an installation of:

- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
Expand Down
10 changes: 5 additions & 5 deletions motoko/internet_identity_integration/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Internet Identity integration
# Internet Identity integration

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.

Expand All @@ -11,12 +11,12 @@ This tutorial will explain all the steps required to integrate the default start

This is a Motoko example that does not currently have a Rust variant.

### Prerequisites
## Prerequisites
This example requires an installation of:

- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
- [x] Clone the example dapp project: `git clone https://github.com/dfinity/examples`
- [x] Download and install the `@dfinity/auth-client` package with the command `npm install @dfinity/auth-client`.
- [x] Download and install the `@dfinity/auth-client` package with the command `npm install @dfinity/auth-client`.
- [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))

Begin by opening a terminal window.
Expand Down Expand Up @@ -338,7 +338,7 @@ loginButton.onclick = async (e) => {
});

return false;
};%
};%
```

## Step 8: Modify the backend
Expand Down Expand Up @@ -378,7 +378,7 @@ URLs:

## Step 10: Test the application

Open the `greet_frontend` URL in a web browser.
Open the `greet_frontend` URL in a web browser.

You should be able to observe the following behavior:

Expand Down
4 changes: 2 additions & 2 deletions motoko/life/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Directories `versions/v1` and `versions/v2` contain sequential upgrades to src u

To make upgrades apparent, each version uses a different digit to display live cells (0,1,2).

This is a Motoko example that does not currently have a Rust variant.
This is a Motoko example that does not currently have a Rust variant.

### Prerequisites
## Prerequisites
This example requires an installation of:

- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
Expand Down
4 changes: 2 additions & 2 deletions motoko/minimal-counter-dapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This example covers:
- Deploy the canister smart contract locally.
- Test backend with Candid UI and command line using `dfx`, and test frontend in browser.

### Prerequisites
## Prerequisites
This example requires an installation of:

- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
Expand Down Expand Up @@ -123,7 +123,7 @@ public func reset() : async Nat {
```

### Candid interface
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.
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.

### Frontend
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.
Expand Down
8 changes: 4 additions & 4 deletions motoko/parallel_calls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The sample code revolves around two simple canisters, `caller` and `callee`. `Ca

The callee exposes a simple `ping` endpoint that takes no parameters and returns nothing.

### Prerequisites
## Prerequisites
This example requires an installation of:

- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
Expand Down Expand Up @@ -54,7 +54,7 @@ This should output:
(100 : nat64)
```

And the other endpoint:
And the other endpoint:

```bash
dfx canister call caller parallel_calls 100
Expand Down Expand Up @@ -96,9 +96,9 @@ Lastly, the parallel calls here complete sooner -- because most of them fail!

## Step 5: Multi-subnet setting

Parallel calls are a lot more useful in multi-subnet settings. We can create such a setting locally using Pocket IC.
Parallel calls are a lot more useful in multi-subnet settings. We can create such a setting locally using Pocket IC.

First, follow the [installation instructions](https://github.com/dfinity/pocketic) to install `pocket-ic` in the `parallel_calls` directory.
First, follow the [installation instructions](https://github.com/dfinity/pocketic) to install `pocket-ic` in the `parallel_calls` directory.

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.

Expand Down
4 changes: 2 additions & 2 deletions motoko/pub-sub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This sample project demonstrates how functions may be passed as arguments of int

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.

### Prerequisites
## Prerequisites
This example requires an installation of:

- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
Expand Down Expand Up @@ -55,7 +55,7 @@ The output should resemble the following:

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.

For example, the following aspects are particularly relevant for this app, since it makes inter-canister calls:
For example, the following aspects are particularly relevant for this app, since it makes inter-canister calls:
* [Be aware that state may change during inter-canister calls.](https://internetcomputer.org/docs/current/developer-docs/security/security-best-practices/overview)
* [Only make inter-canister calls to trustworthy canisters.](https://internetcomputer.org/docs/current/developer-docs/security/security-best-practices/overview)
* [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)
4 changes: 2 additions & 2 deletions motoko/random_maze/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ This actor uses Motoko's random library to generate a cryptographically random m

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.

This is a Motoko example that does not currently have a Rust variant.
This is a Motoko example that does not currently have a Rust variant.

### Prerequisites
## Prerequisites
This example requires an installation of:

- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
Expand Down
4 changes: 2 additions & 2 deletions motoko/superheroes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

This example demonstrates how to build a CRUD application on ICP using Motoko and React.

This is a Motoko example that does not currently have a Rust variant.
This is a Motoko example that does not currently have a Rust variant.

### Prerequisites
## Prerequisites
This example requires an installation of:

- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
Expand Down
Loading

0 comments on commit da93e55

Please sign in to comment.