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
**Note:** The live version of IC-POS uses real ckBTC tokens. To test, use only fractions of a token to avoid losing funds.
33
31
34
32
## Architecture
35
33
@@ -56,39 +54,57 @@ The frontend interacts with the following IC canisters:
56
54
-`ckbtc index` - to fetch transaction history.
57
55
-`internet identity` - to authenticate users.
58
56
59
-
# Local deployment
57
+
## Setup, dev environment
58
+
59
+
Pre-requisites:
60
+
61
+
-[Local Internet Computer dev environment](https://internetcomputer.org/docs/current/developer-docs/backend/rust/dev-env)
62
+
-[Node 20+](https://nodejs.org/en/)
63
+
-[pnpm](https://pnpm.io/installation)
64
+
65
+
## Deploy using script
66
+
67
+
To get started quickly and deploy the IC-POS app locally, you can run a deploy script. This script will start a local replica, deploy the necessary canisters, and build and deploy the frontend.
60
68
61
-
## Prerequisites
69
+
```bash
70
+
bash ./scripts/deploy.sh
71
+
```
62
72
63
-
-[x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).
64
-
-[x] Install [Node.js](https://nodejs.org/en/).
65
-
-[x] Clone the example dapp project: `git clone https://github.com/dfinity/examples`
73
+
Once the script has finished, you should proceed to step 10 to create a store and mint yourself some test tokens.
66
74
67
-
### Step 1: Start a local instance of the replica:
75
+
##Deploy manually
68
76
69
-
(To complete steps 1-7 in one go, you can run the `./scripts/deploy.sh` script.)
77
+
### 1. Clone the examples repository and navigate to the IC-POS project:
78
+
79
+
```bash
80
+
git clone https://github.com/dfinity/examples
81
+
cd examples/motoko/ic-pos
82
+
```
83
+
84
+
85
+
### 2. Start a local instance of the replica:
70
86
71
87
```bash
72
88
dfx start --clean --background
73
89
```
74
90
75
-
### Step 2: Deploy the Internet Identity canister:
91
+
### 3. Deploy the Internet Identity canister:
76
92
77
93
Integration with the [Internet Identity](https://internetcomputer.org/internet-identity/) allows store owners to securely setup and manage their store. The Internet Identity canister is already deployed on the IC mainnet. For local development, you need to deploy it to your local instance of the IC.
78
94
79
95
```bash
80
96
dfx deploy internet_identity
81
97
```
82
98
83
-
### Step 3: Save the current principal as a variable:
99
+
### 4. Save the current principal as a variable:
84
100
85
101
The principal will be used when deploying the ledger canister.
86
102
87
103
```bash
88
104
export OWNER=$(dfx identity get-principal)
89
105
```
90
106
91
-
### Step 3: Deploy the ckBTC ledger canister:
107
+
### 5. Deploy the ckBTC ledger canister:
92
108
93
109
The responsibilities of the ledger canister is to keep track of token balances and handle token transfers.
The icpos canister manages the store configuration and sends notifications when a payment is received.
149
165
@@ -153,31 +169,36 @@ The `--argument '(0)'` argument is used to initialize the canister with `startBl
153
169
dfx deploy icpos --argument '(0)'
154
170
```
155
171
156
-
### Step 6: Configure the icpos canister:
172
+
### 8. Configure the icpos canister
157
173
158
-
ic-pos uses [Courier](https://courier.com/) to send email and SMS notifications. If you want to enable notifications, you need to sign up for a Courier account and and create and API key. Then issue the following command:
174
+
IC-POS uses [Courier](https://courier.com/) to send email and SMS notifications. If you want to enable notifications, you need to sign up for a Courier account and and create and API key. Then issue the following command:
Run npm to install dependencies and start the frontend. The frontend will be available at http://localhost:5173.
182
+
Run npm to install dependencies and start a development version of the frontend.
167
183
168
184
```bash
169
185
pnpm install
170
-
dfx deploy icpos_frontend
186
+
pnpm run dev
171
187
```
172
-
### Step 8: Make a transfer!
188
+
189
+
The app should now be accessible at a local url, typically `http://localhost:5173`.
190
+
191
+
### 10. Make a transfer!
192
+
193
+
173
194
174
195
Now that everything is up and running, you can make a transfer to your newly created store.
175
196
176
197
The easiest way to do this is to create two stores using two different Internet Identity accounts, using two different web browsers. Then, transfer some tokens from one store to the other.
177
198
178
-
#### 8.1: Create the first store and supply it with some tokens:
199
+
#### 10.1 Create the first store and supply it with some tokens
179
200
180
-
Log in to the frontend using the Internet Identity. Configure the store and navigate to the `Receive`page. Click on the principal pill to copy the address to your clipboard. Then, using the `dfx` command, mint some tokens from your owner principal to the store principal.
201
+
Log in to the frontend using the Internet Identity. Configure the store with a name and then, on the main store page, click on the principal pill to copy the address to your clipboard. Using the `dfx` command, now mint some tokens from your owner principal to the store principal.
Log in to the frontend using **a new Internet Identity on another web browser**. Configure the store and navigate to the `Receive` page. Click on the principal pill to copy the address to your clipboard.
216
+
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.
196
217
197
218
Now, go back to the first browser/store, navigate to the `Send` page, and transfer some tokens to the second store.
0 commit comments