Skip to content

Commit fe351fc

Browse files
authored
Merge pull request #1197 from dfinity/jessiemongeon1-patch-28
add: Deploy to ICP Ninja + standardize README
2 parents 67fd75a + 332711f commit fe351fc

File tree

1 file changed

+9
-46
lines changed

1 file changed

+9
-46
lines changed

rust/counter/README.md

Lines changed: 9 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,25 @@
22

33
This example demonstrates a counter application.
44

5-
## Prerequisites
6-
This example requires an installation of:
5+
## Deploying from ICP Ninja
76

8-
- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/).
9-
- [x] Download the following project files from GitHub: `git clone https://github.com/dfinity/examples/`
7+
[![](https://icp.ninja/assets/open.svg)](https://icp.ninja/editor?g=https://github.com/dfinity/examples/tree/master/rust/counter)
108

11-
Begin by opening a terminal window.
9+
## Build and deploy from the command-line
1210

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

15-
Navigate into the folder containing the project's files and start a local instance of the Internet Computer with the commands:
13+
### 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/)
1614

15+
### 3. Navigate into the project's directory.
1716

18-
```bash
19-
cd examples/rust/counter
20-
dfx start --background
21-
```
22-
23-
## Step 2: Test the canister
17+
### 4. Deploy the project to your local environment:
2418

25-
```bash
26-
cargo test
2719
```
28-
29-
## Step 3: Deploy the canister
30-
31-
```bash
32-
dfx deploy
20+
dfx start --background --clean && dfx deploy
3321
```
3422

35-
## Step 4: Set the value of the counter
36-
37-
```bash
38-
dfx canister call counter set '(7)'
39-
```
40-
41-
## Step 5: Increment the value of the counter
42-
43-
```bash
44-
dfx canister call counter inc
45-
```
46-
47-
## Step 6: Get the value of the counter
48-
49-
```bash
50-
dfx canister call counter get
51-
```
52-
53-
The following output should be returned:
54-
55-
```bash
56-
(8 : nat)
57-
```
58-
59-
6023
## Security considerations and best practices
6124

62-
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.
25+
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.
6326

0 commit comments

Comments
 (0)