Skip to content

Commit 1dac73a

Browse files
Update README.md
1 parent e949771 commit 1dac73a

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

rust/parallel_calls/README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,27 @@ The callee exposes a simple `ping` endpoint that takes no parameters and returns
2020

2121
### 3. Navigate into the project's directory.
2222

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:
2424

25-
## Security considerations and best practices
25+
```
26+
dfx start --background --clean && dfx deploy
27+
```
2628

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:
2832

33+
```
34+
dfx canister call caller setup_callee "(principal \"`dfx canister id callee`\")"
35+
```
2936

30-
#### 5: Invoke sequential and parallel calls
37+
#### 6. Invoke sequential and parallel calls
3138

3239
```bash
3340
dfx canister call caller sequential_calls 100
3441
dfx canister call caller parallel_calls 100
3542
```
3643

37-
3844
The results are identical: all calls succeed. There also isn't a large difference in performance between these calls:
3945

4046
```bash
@@ -80,3 +86,7 @@ Parallel calls: 90/90 successful calls in 353.738958ms
8086
```
8187

8288
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

Comments
 (0)