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
Copy file name to clipboardExpand all lines: rust/parallel_calls/README.md
+15-5Lines changed: 15 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -20,21 +20,27 @@ The callee exposes a simple `ping` endpoint that takes no parameters and returns
20
20
21
21
### 3. Navigate into the project's directory.
22
22
23
-
### 4. Run `dfx start --background --clean && dfx deploy` to deploy the project to your local environment.
23
+
### 4. Deploy the project to your local environment:
24
24
25
-
## Security considerations and best practices
25
+
```
26
+
dfx start --background --clean && dfx deploy
27
+
```
26
28
27
-
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.
29
+
### 5. Setup the caller canister.
30
+
31
+
Provide the ID of the callee to the caller, such that the caller can initiate calls:
28
32
33
+
```
34
+
dfx canister call caller setup_callee "(principal \"`dfx canister id callee`\")"
35
+
```
29
36
30
-
#### 5: Invoke sequential and parallel calls
37
+
#### 6. Invoke sequential and parallel calls
31
38
32
39
```bash
33
40
dfx canister call caller sequential_calls 100
34
41
dfx canister call caller parallel_calls 100
35
42
```
36
43
37
-
38
44
The results are identical: all calls succeed. There also isn't a large difference in performance between these calls:
As you can see, parallel calls run a lot faster than sequential calls here. The difference on the IC mainnet would be significantly larger still, as Pocket IC executes rounds much faster than the IC mainnet.
89
+
90
+
## Security considerations and best practices
91
+
92
+
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