Skip to content

Commit 88e480f

Browse files
Merge pull request #1173 from dfinity/jessiemongeon1-patch-4
add: Deploy to ICP Ninja + standardize README
2 parents 3d9672b + fed3147 commit 88e480f

File tree

1 file changed

+12
-49
lines changed

1 file changed

+12
-49
lines changed

motoko/counter/README.md

Lines changed: 12 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,65 +6,28 @@ By using the Motoko keyword stable when declaring the counter variable, the valu
66

77
The application provides an interface that exposes the following methods:
88

9-
- `set`: sets the value of the counter.
10-
- `inc`: increments the value of the counter.
11-
- `get`: gets the value of the counter.
9+
- `set`: Sets the value of the counter.
10+
- `inc`: Increments the value of the counter.
11+
- `get`: Gets the value of the counter.
1212

13-
## Prerequisites
14-
This example requires an installation of:
13+
## Deploying from ICP Ninja
1514

16-
- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
17-
- [x] Clone the example dapp project: `git clone https://github.com/dfinity/examples`
15+
[![](https://icp.ninja/assets/open.svg)](https://icp.ninja/editor?g=https://github.com/dfinity/examples/tree/master/motoko/counter)
1816

19-
Begin by opening a terminal window.
17+
## Build and deploy from the command-line
2018

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

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

23+
### 3. Navigate into the project's directory.
2524

26-
```bash
27-
cd examples/motoko/counter
28-
dfx start --background
29-
```
30-
31-
## Step 2: Deploy the canister
32-
33-
```bash
34-
dfx deploy
35-
```
36-
37-
## Step 3: Set the value of the counter
38-
39-
```bash
40-
dfx canister call counter set '(7)'
41-
```
42-
43-
## Step 4: Increment the value of the counter
25+
### 4. Deploy the project to your local environment:
4426

45-
```bash
46-
dfx canister call counter inc
4727
```
48-
49-
## Step 5: Get the value of the counter
50-
51-
```bash
52-
dfx canister call counter get
53-
```
54-
55-
The following output should be returned:
56-
57-
```bash
58-
(8 : nat)
28+
dfx start --background --clean && dfx deploy
5929
```
6030

61-
## Resources
62-
To learn more about these features of Motoko, see:
63-
64-
- [Orthogonal persistence](https://internetcomputer.org/docs/current/motoko/main/motoko#orthogonal-persistence).
65-
- [Declaring stable values](https://internetcomputer.org/docs/current/motoko/main/upgrades#declaring-stable-variables).
66-
67-
6831
## Security considerations and best practices
6932

70-
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.
33+
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.

0 commit comments

Comments
 (0)