prividium 0.13.0 → 0.14.0
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.
|
@@ -2,6 +2,7 @@ import * as net from 'node:net';
|
|
|
2
2
|
import { requireHttpOk } from '../../clients/http.js';
|
|
3
3
|
import { requireRpcResult } from '../../clients/rpc.js';
|
|
4
4
|
import { DEFAULT_DOCTOR_CALLBACK_PORT } from '../../constants.js';
|
|
5
|
+
import { getRawReason } from '../../utils.js';
|
|
5
6
|
export async function runCallbackPortProbe() {
|
|
6
7
|
const available = await new Promise((resolve) => {
|
|
7
8
|
const server = net.createServer();
|
|
@@ -17,8 +18,17 @@ export async function runUserPanelReachabilityProbe(context) {
|
|
|
17
18
|
await requireHttpOk(new URL('/health', context.targets.userPanelBaseUrl));
|
|
18
19
|
}
|
|
19
20
|
export async function runApiHealthProbe(context) {
|
|
20
|
-
await
|
|
21
|
+
const healthResponse = await fetch(new URL('/health', context.targets.apiBaseUrl));
|
|
22
|
+
if (!healthResponse.ok) {
|
|
23
|
+
const reason = getRawReason(healthResponse.status, await healthResponse.text());
|
|
24
|
+
throw new Error(reason);
|
|
25
|
+
}
|
|
21
26
|
await requireHttpOk(new URL('/readyz', context.targets.apiBaseUrl));
|
|
27
|
+
const body = (await healthResponse.json());
|
|
28
|
+
if (body.version) {
|
|
29
|
+
context.apiVersion = body.version;
|
|
30
|
+
}
|
|
31
|
+
return {};
|
|
22
32
|
}
|
|
23
33
|
export async function runPublicRpcProbe(context) {
|
|
24
34
|
const version = await requireRpcResult(context.targets.apiBaseUrl, { method: 'web3_clientVersion' });
|
|
@@ -21,6 +21,7 @@ function buildSummaryBlock(context) {
|
|
|
21
21
|
values: [
|
|
22
22
|
{ label: 'Status', value: `${failCount} failed, ${skipCount} skipped, ${passCount} passed` },
|
|
23
23
|
{ label: 'API', value: context.targets?.apiBaseUrl ?? context.rawRpcUrl },
|
|
24
|
+
...(context.apiVersion ? [{ label: 'API Version', value: context.apiVersion }] : []),
|
|
24
25
|
{ label: 'User Panel', value: context.targets?.userPanelBaseUrl ?? context.rawUserPanelUrl },
|
|
25
26
|
{ label: 'Time', value: new Date().toISOString() }
|
|
26
27
|
]
|