@beblurt/blurt-nodes-checker 1.0.1 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -83
- package/dist/blurt-nodes-checker.min.js +79 -5
- package/lib/helpers/index.d.ts +27 -19
- package/lib/helpers/index.js +20 -0
- package/lib/helpers/index.js.map +1 -1
- package/lib/index.d.ts +6 -5
- package/lib/index.js +116 -113
- package/lib/index.js.map +1 -1
- package/lib/test.d.ts +3 -1
- package/lib/test.js +86 -13
- package/lib/test.js.map +1 -1
- package/package.json +12 -12
- package/lib/helpers/BLOCK_API/GET_BLOCK.d.ts +0 -26
- package/lib/helpers/BLOCK_API/GET_BLOCK.js +0 -2
- package/lib/helpers/BLOCK_API/GET_BLOCK.js.map +0 -1
- package/lib/helpers/CONDENSER_API/DYNAMIC_GLOBAL_PROPERTIES.d.ts +0 -67
- package/lib/helpers/CONDENSER_API/DYNAMIC_GLOBAL_PROPERTIES.js +0 -2
- package/lib/helpers/CONDENSER_API/DYNAMIC_GLOBAL_PROPERTIES.js.map +0 -1
- package/lib/helpers/CONDENSER_API/GET_ACCOUNT.d.ts +0 -73
- package/lib/helpers/CONDENSER_API/GET_ACCOUNT.js +0 -2
- package/lib/helpers/CONDENSER_API/GET_ACCOUNT.js.map +0 -1
- package/lib/helpers/CONDENSER_API/GET_BLOG_ENTRY.d.ts +0 -7
- package/lib/helpers/CONDENSER_API/GET_BLOG_ENTRY.js +0 -2
- package/lib/helpers/CONDENSER_API/GET_BLOG_ENTRY.js.map +0 -1
- package/lib/helpers/CONDENSER_API/GET_CONFIG.d.ts +0 -174
- package/lib/helpers/CONDENSER_API/GET_CONFIG.js +0 -2
- package/lib/helpers/CONDENSER_API/GET_CONFIG.js.map +0 -1
- package/lib/helpers/CONDENSER_API/GET_CONTENT.d.ts +0 -54
- package/lib/helpers/CONDENSER_API/GET_CONTENT.js +0 -2
- package/lib/helpers/CONDENSER_API/GET_CONTENT.js.map +0 -1
- package/lib/helpers/CONDENSER_API/GET_DISCUSSION.d.ts +0 -39
- package/lib/helpers/CONDENSER_API/GET_DISCUSSION.js +0 -2
- package/lib/helpers/CONDENSER_API/GET_DISCUSSION.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Blurt RPC nodes checker
|
|
2
2
|
|
|
3
|
-
ESM Typscript [
|
|
3
|
+
ESM Typscript [Blurt blockchain](https://gitlab.com/blurt/blurt) RPC nodes servers checker (latency, availability, methods).
|
|
4
|
+
|
|
5
|
+
Checks the status of the RPC nodes servers of the Blurt blockchain at a specified interval and sends a report via a RxJS subscription. The result is stored in an array in memory and you can call it at any time.
|
|
6
|
+
|
|
7
|
+
The library also allows you to identify the compatibility of an RPC node with [Nexus](https://gitlab.com/blurt/openblurt/nexus) (communities on the [Blurt blockchain](https://gitlab.com/blurt/blurt)) and to adapt the full test accordingly by including the Nexus methods.
|
|
4
8
|
|
|
5
9
|
## Getting Started
|
|
6
10
|
|
|
@@ -40,7 +44,7 @@ $ npm run build-browser
|
|
|
40
44
|
|
|
41
45
|
### Initialisation
|
|
42
46
|
|
|
43
|
-
Initialise the
|
|
47
|
+
Initialise the Blurt nodes checker with **params**
|
|
44
48
|
|
|
45
49
|
```js
|
|
46
50
|
/** Init the checker */
|
|
@@ -50,7 +54,9 @@ const nodesChecker = new BlurtNodesChecker(["url1", "url2", ...])
|
|
|
50
54
|
### Params
|
|
51
55
|
- `url`: array of node url to check
|
|
52
56
|
- `options` (optional):
|
|
57
|
+
- `debug` (boolean): if true show console info (default: false)
|
|
53
58
|
- `full` (boolean): if false perform only a `get_config` with response time (default: false)
|
|
59
|
+
- `nexus` (boolean): if true check if the rpc node is [Nexus](https://gitlab.com/blurt/openblurt/nexus) compatible (default: false)
|
|
54
60
|
- `interval` (seconds): delay in seconds between each execution (default: 900 seconds)
|
|
55
61
|
- `timeout` (seconds): timeout in seconds for node request (default: 3 seconds)
|
|
56
62
|
- `reset` (number): number max of test before resetting the counters (default: no reset)
|
|
@@ -119,19 +125,21 @@ Performing a full checking:
|
|
|
119
125
|
```js
|
|
120
126
|
import { BlurtNodesChecker } from '@beblurt/blurt-nodes-checker'
|
|
121
127
|
|
|
122
|
-
/**
|
|
128
|
+
/** Blurt nodes url to check */
|
|
123
129
|
const nodes = [
|
|
130
|
+
"https://rpc.beblurt.com",
|
|
124
131
|
"https://blurt-rpc.saboin.com",
|
|
125
132
|
"https://rpc.blurt.world",
|
|
126
|
-
"https://blurtrpc.actifit.io
|
|
133
|
+
"https://blurtrpc.actifit.io",
|
|
127
134
|
"https://kentzz.blurt.world",
|
|
128
|
-
"https://rpc.
|
|
129
|
-
"https://
|
|
135
|
+
"https://rpc.blurt.live",
|
|
136
|
+
"https://blurtdev.techcoderx.com"
|
|
130
137
|
]
|
|
131
138
|
|
|
132
139
|
/** Options */
|
|
133
140
|
const options = {
|
|
134
141
|
full: true,
|
|
142
|
+
nexus: true,
|
|
135
143
|
interval: 600, // 10 minutes
|
|
136
144
|
reset: 144 // every 144 tests => 24 hours x 6 (10 minutes = 6 test per hours)
|
|
137
145
|
}
|
|
@@ -158,7 +166,7 @@ nodesChecker.message.subscribe({
|
|
|
158
166
|
|
|
159
167
|
### Light checking
|
|
160
168
|
|
|
161
|
-
In this case, only a call to the rpc method `condenser_api.get_config` is made.
|
|
169
|
+
In this case, only a call to the rpc method `condenser_api.get_config` is made, if `nexus: true` in options there is a call to the rpc method `bridge.unread_notifications` too to check if it's a Nexus rcp node.
|
|
162
170
|
|
|
163
171
|
#### Result
|
|
164
172
|
```ts
|
|
@@ -174,6 +182,7 @@ In this case, only a call to the rpc method `condenser_api.get_config` is made.
|
|
|
174
182
|
"average_time"?: number
|
|
175
183
|
"version"?: string
|
|
176
184
|
"deactivated"?: boolean
|
|
185
|
+
"nexus": boolean
|
|
177
186
|
|
|
178
187
|
"test_result": []
|
|
179
188
|
}]
|
|
@@ -182,18 +191,18 @@ In this case, only a call to the rpc method `condenser_api.get_config` is made.
|
|
|
182
191
|
#### Exemple of result for a light checking
|
|
183
192
|
```js
|
|
184
193
|
[
|
|
185
|
-
{
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
},
|
|
194
|
+
{
|
|
195
|
+
url: "https://rpc.beblurt.com",
|
|
196
|
+
nb_ok: 1,
|
|
197
|
+
nb_error: 0,
|
|
198
|
+
nb_degraded: 0,
|
|
199
|
+
last_check: 1669607084463,
|
|
200
|
+
status: "online",
|
|
201
|
+
test_result: [],
|
|
202
|
+
version: "0.8.2",
|
|
203
|
+
duration: 598,
|
|
204
|
+
nexus: true
|
|
205
|
+
},
|
|
197
206
|
...
|
|
198
207
|
]
|
|
199
208
|
```
|
|
@@ -204,12 +213,20 @@ In this case the methods below are checked:
|
|
|
204
213
|
|
|
205
214
|
- `condenser_api.get_config`
|
|
206
215
|
- `condenser_api.get_accounts`
|
|
207
|
-
- `
|
|
216
|
+
- `condenser_api.get_block`
|
|
208
217
|
- `condenser_api.get_blog_entries`
|
|
209
218
|
- `condenser_api.get_content`
|
|
210
219
|
- `condenser_api.get_dynamic_global_properties`
|
|
211
220
|
- `condenser_api.get_discussions_by_blog`
|
|
212
221
|
|
|
222
|
+
If it is a Nexus node the following methods are also checked:
|
|
223
|
+
|
|
224
|
+
- `bridge.account_notifications`
|
|
225
|
+
- `bridge.get_payout_stats`
|
|
226
|
+
- `bridge.get_post`
|
|
227
|
+
- `bridge.get_profile`
|
|
228
|
+
- `bridge.list_communities`
|
|
229
|
+
|
|
213
230
|
#### Result
|
|
214
231
|
```ts
|
|
215
232
|
[{
|
|
@@ -240,67 +257,37 @@ In this case the methods below are checked:
|
|
|
240
257
|
#### Exemple of result for a full checking
|
|
241
258
|
```js
|
|
242
259
|
[
|
|
243
|
-
{
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
name: 'Condenser | Get Content',
|
|
277
|
-
description: 'Retrieve the content (post or comment))',
|
|
278
|
-
method: 'condenser_api.get_content',
|
|
279
|
-
success: true,
|
|
280
|
-
duration: 479,
|
|
281
|
-
last_check: 1661768268483
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
name: 'Condenser | Get Blog Entries',
|
|
285
|
-
description: 'Retrieve the list of blog entries for an account)',
|
|
286
|
-
method: 'condenser_api.get_blog_entries',
|
|
287
|
-
success: true,
|
|
288
|
-
duration: 481,
|
|
289
|
-
last_check: 1661768268483
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
name: 'Condenser | Get Disccusion By Blog',
|
|
293
|
-
description: 'Retrieve a list of discussions by blog)',
|
|
294
|
-
method: 'condenser_api.get_discussions_by_blog',
|
|
295
|
-
success: true,
|
|
296
|
-
duration: 685,
|
|
297
|
-
last_check: 1661768268483
|
|
298
|
-
}
|
|
299
|
-
],
|
|
300
|
-
version: '0.8.2',
|
|
301
|
-
duration: 300,
|
|
302
|
-
average_time: 572
|
|
303
|
-
},
|
|
260
|
+
{
|
|
261
|
+
url: "https://rpc.beblurt.com",
|
|
262
|
+
nb_ok: 1,
|
|
263
|
+
nb_error: 0,
|
|
264
|
+
nb_degraded: 0,
|
|
265
|
+
last_check: 1669607748639,
|
|
266
|
+
status: "online",
|
|
267
|
+
test_result: [
|
|
268
|
+
{
|
|
269
|
+
name: "Bridge | account_notifications ",
|
|
270
|
+
description: "Account notifications",
|
|
271
|
+
method: "bridge.account_notifications",
|
|
272
|
+
success: true,
|
|
273
|
+
duration: 314,
|
|
274
|
+
last_check: 1669607748639
|
|
275
|
+
},
|
|
276
|
+
...
|
|
277
|
+
{
|
|
278
|
+
name: "Condenser | Get Disccusion By Blog",
|
|
279
|
+
description: "Retrieve a list of discussions by blog",
|
|
280
|
+
method: "condenser_api.get_discussions_by_blog",
|
|
281
|
+
success: true,
|
|
282
|
+
duration: 1181,
|
|
283
|
+
last_check: 1669607748639
|
|
284
|
+
}
|
|
285
|
+
],
|
|
286
|
+
version: "0.8.2",
|
|
287
|
+
duration: 579,
|
|
288
|
+
nexus: true,
|
|
289
|
+
average_time: 1140,
|
|
290
|
+
},
|
|
304
291
|
...
|
|
305
292
|
]
|
|
306
293
|
```
|
|
@@ -311,7 +298,7 @@ Pull requests for new features, bug fixes, and suggestions are welcome!
|
|
|
311
298
|
|
|
312
299
|
## Author
|
|
313
300
|
|
|
314
|
-
@beblurt (https://
|
|
301
|
+
@beblurt (https://beblurt.com/@beblurt)
|
|
315
302
|
|
|
316
303
|
## License
|
|
317
304
|
|