Skip to content

Commit 38b6983

Browse files
Merge pull request #1170 from dfinity/classes
add: Deploy to ICP Ninja + standardize README
2 parents b6c589f + 96f99e5 commit 38b6983

File tree

1 file changed

+11
-53
lines changed

1 file changed

+11
-53
lines changed

motoko/classes/README.md

Lines changed: 11 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -16,69 +16,27 @@ Each new Bucket must be provisioned with enough cycles to pay for its installati
1616

1717
The `Test.mo` actor imports the (installed) `Map` canister, using `Maps` Candid interface to determine its Motoko type. `Test`'s run method simply puts 24 consecutive entries into Map. These entries are distributed evenly amongst the buckets making up the key-value store. Adding the first entry to a bucket take longer than adding a subsequent one, since the bucket needs to be installed on first use.
1818

19-
This is a Motoko example that does not currently have a Rust variant.
19+
This application's logic is written in [Motoko](https://internetcomputer.org/docs/motoko/home), a programming language designed specifically for developing canisters on ICP.
2020

21-
## Prerequisites
21+
## Deploying from ICP Ninja
2222

23-
- [x] Install the [IC
24-
SDK](https://internetcomputer.org/docs/current/developer-docs/getting-started/install). For local testing, `dfx >= 0.22.0` is required.
25-
- [x] Clone the example dapp project: `git clone https://github.com/dfinity/examples`
23+
[![](https://icp.ninja/assets/open.svg)](https://icp.ninja/editor?g=https://github.com/dfinity/examples/tree/master/motoko/classes)
2624

27-
Begin by opening a terminal window.
25+
## Build and deploy from the command-line
2826

29-
## Step 1: Setup the project environment
27+
### 1. [Download and install the IC SDK.](https://internetcomputer.org/docs/building-apps/getting-started/install)
3028

31-
Navigate into the folder containing the project's files and start a local instance of the Internet Computer with the commands:
29+
### 2. Download your project from ICP Ninja using the 'Download files' button on the upper left corner, or [clone the GitHub examples repository.](https://github.com/dfinity/examples/)
3230

31+
### 3. Navigate into the project's directory.
3332

34-
```bash
35-
cd examples/motoko/classes
36-
dfx start --background
37-
```
38-
39-
## Step 2: Deploy the canisters `Map` and `Test`
33+
### 4. Deploy the project to your local environment:
4034

41-
```bash
42-
dfx deploy Map --no-wallet
43-
dfx deploy Test --no-wallet
4435
```
45-
46-
## Step 3: Invoke the run method of canister `Test`
47-
48-
```bash
49-
dfx canister call Test run '()'
50-
```
51-
52-
The output should resemble the following:
53-
54-
```bash
55-
debug.print: putting: (0, "0")
56-
debug.print: putting: (1, "1")
57-
debug.print: putting: (2, "2")
58-
debug.print: putting: (3, "3")
59-
debug.print: putting: (4, "4")
60-
debug.print: putting: (5, "5")
61-
debug.print: putting: (6, "6")
62-
debug.print: putting: (7, "7")
63-
debug.print: putting: (8, "8")
64-
debug.print: putting: (9, "9")
65-
debug.print: putting: (10, "10")
66-
debug.print: putting: (11, "11")
67-
debug.print: putting: (12, "12")
68-
debug.print: putting: (13, "13")
69-
debug.print: putting: (14, "14")
70-
debug.print: putting: (15, "15")
71-
debug.print: putting: (16, "16")
72-
debug.print: putting: (17, "17")
73-
debug.print: putting: (18, "18")
74-
debug.print: putting: (19, "19")
75-
debug.print: putting: (20, "20")
76-
debug.print: putting: (21, "21")
77-
debug.print: putting: (22, "22")
78-
debug.print: putting: (23, "23")
79-
()
36+
dfx start --background --clean && dfx deploy
8037
```
8138

8239
## Security considerations and best practices
8340

84-
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.
41+
If you base your application on this example, it is recommended that you familiarize yourself with and adhere to the [security best practices](https://internetcomputer.org/docs/building-apps/security/overview) for developing on ICP. This example may not implement all the best practices.
42+

0 commit comments

Comments
 (0)