Skip to content

Commit 9545a2c

Browse files
Merge pull request #1083 from multiversx/update-links
Update links
2 parents aef699f + dbac8df commit 9545a2c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docs/developers/tutorials/your-first-microservice.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This guide has been made available in video format as well:
2020

2121
## Ping Pong Microservice
2222

23-
This guide extends the decentralized app we have built in our previous guide [**Build a dApp in 15 minutes**](/developers/tutorials/your-first-dapp). If you haven't followed it so far, [please do it now](https://www.youtube.com/watch?v=IdkgvlK3rb8).
23+
This guide extends the decentralized app we have built in our previous guide [**Build a dApp in 15 minutes**](/developers/tutorials/your-first-dapp). If you haven't followed it so far, please do it now.
2424

2525
In this guide we're going to build a microservice (an API), which is an intermediary layer between the blockchain layer and the app layer. Our app will consume this microservice instead of making requests directly on the blockchain.
2626

@@ -97,7 +97,7 @@ We'll find a configuration file specific for every network we want to deploy the
9797

9898
First we're going to configure the redis server url. If we run a redis-server on the same machine (or on our development machine) then we can leave the default value.
9999

100-
Now we'll move on to the smart contract address. We can find it in our `dapp` repository (if we followed the previous guide ["Build a dApp in 15 minutes"](https://www.youtube.com/watch?v=IdkgvlK3rb8)). If you don't have a smart contract deployed on devnet, then we suggest to follow the previous guide first and then get back to this step.
100+
Now we'll move on to the smart contract address. We can find it in our `dapp` repository (if we followed the previous guide ["Build a dApp in 15 minutes"](/docs/developers/tutorials/your-first-dapp.md)). If you don't have a smart contract deployed on devnet, then we suggest to follow the previous guide first and then get back to this step.
101101

102102
Set the `contracts.pingPong` key with the value for the smart contract address and we're done with configuring the microservice.
103103

@@ -107,13 +107,13 @@ Set the `contracts.pingPong` key with the value for the smart contract address a
107107

108108
We'll install the dependencies using npm
109109

110-
```
110+
``` sh
111111
npm install
112112
```
113113

114114
and then we will start the microservice for the devnet:
115115

116-
```
116+
``` sh
117117
npm run start:devnet
118118
```
119119

@@ -211,29 +211,29 @@ We can now verify that on the dashboard we still have the countdown and the Pong
211211

212212
You can also find the complete code on our public repository for the dApp in the branch `microservice`:
213213

214-
```
214+
```sh
215215
https://github.com/multiversx/mx-template-dapp/blob/microservice/src/pages/Dashboard/Actions/index.tsx
216216
```
217217

218218
[comment]: # (mx-context-auto)
219219

220-
### Let's deep dive into the microservice code and explain the 2 basic features we implemented.
220+
## Let's deep dive into the microservice code and explain the 2 basic features we implemented
221221

222222
We want to minimize the number of requests done directly on the blockchain because of the overhead they incur, so we'll first read the time to `pong` from the blockchain, we'll cache that value and all the subsequent reads will be done from the cache. That value won't change over time. It will only reset AFTER we `pong`.
223223

224224
[comment]: # (mx-context-auto)
225225

226-
## The Cache
226+
### The Cache
227227

228228
So the caching part is done in
229229

230-
```
230+
```sh
231231
ping-pong/microservice/src/endpoints/ping.pong/ping.pong.controller.ts
232232
```
233233

234234
which uses
235235

236-
```
236+
```sh
237237
ping-pong/microservice/src/endpoints/ping.pong/ping.pong.service.ts
238238
```
239239

@@ -257,7 +257,7 @@ The function `this.getPongDeadlineRaw` will invoke the only read action on the b
257257
258258
[comment]: # (mx-context-auto)
259259
260-
## The Transaction Processor
260+
### The Transaction Processor
261261
262262
After the user clicks the `Pong` button and performs the `pong` transaction, we have to invalidate the cache and we will use the transaction processor to identify all the `pong` transactions on the blockchain that have the receiver set to our smart contract address.
263263

0 commit comments

Comments
 (0)