@ar.io/sdk 3.11.0-alpha.3 → 3.11.0-alpha.4
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/bundles/web.bundle.min.js +64 -64
- package/lib/cjs/utils/ao.js +37 -0
- package/lib/cjs/version.js +1 -1
- package/lib/esm/utils/ao.js +37 -0
- package/lib/esm/version.js +1 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/utils/ao.js
CHANGED
|
@@ -54,6 +54,43 @@ async function spawnANT({ signer, module = constants_js_1.AOS_MODULE_ID, ao = (0
|
|
|
54
54
|
},
|
|
55
55
|
],
|
|
56
56
|
});
|
|
57
|
+
let bootRes;
|
|
58
|
+
let attempts = 0;
|
|
59
|
+
while (attempts < 5 && bootRes === undefined) {
|
|
60
|
+
try {
|
|
61
|
+
bootRes = await ao.result({
|
|
62
|
+
process: processId,
|
|
63
|
+
message: processId,
|
|
64
|
+
});
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
logger.debug('Retrying ANT boot result fetch', {
|
|
69
|
+
processId,
|
|
70
|
+
module,
|
|
71
|
+
scheduler,
|
|
72
|
+
attempts,
|
|
73
|
+
error,
|
|
74
|
+
});
|
|
75
|
+
attempts++;
|
|
76
|
+
await new Promise((resolve) => setTimeout(resolve, 1000 * attempts ** 2));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (bootRes === undefined ||
|
|
80
|
+
bootRes.Messages.find((m) => m.Tags.find((t) => t.value === 'Invalid-Boot-Notice'))) {
|
|
81
|
+
if (bootRes === undefined) {
|
|
82
|
+
throw new Error('Failed to get boot result');
|
|
83
|
+
}
|
|
84
|
+
const bootError = errorMessageFromOutput(bootRes);
|
|
85
|
+
logger.error('ANT failed to boot correctly', {
|
|
86
|
+
processId,
|
|
87
|
+
module,
|
|
88
|
+
scheduler,
|
|
89
|
+
bootRes,
|
|
90
|
+
bootError,
|
|
91
|
+
});
|
|
92
|
+
throw new Error(`ANT failed to boot correctly: ${bootError}`);
|
|
93
|
+
}
|
|
57
94
|
logger.debug(`Spawned ANT`, {
|
|
58
95
|
processId,
|
|
59
96
|
module,
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/utils/ao.js
CHANGED
|
@@ -43,6 +43,43 @@ export async function spawnANT({ signer, module = AOS_MODULE_ID, ao = connect(),
|
|
|
43
43
|
},
|
|
44
44
|
],
|
|
45
45
|
});
|
|
46
|
+
let bootRes;
|
|
47
|
+
let attempts = 0;
|
|
48
|
+
while (attempts < 5 && bootRes === undefined) {
|
|
49
|
+
try {
|
|
50
|
+
bootRes = await ao.result({
|
|
51
|
+
process: processId,
|
|
52
|
+
message: processId,
|
|
53
|
+
});
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
logger.debug('Retrying ANT boot result fetch', {
|
|
58
|
+
processId,
|
|
59
|
+
module,
|
|
60
|
+
scheduler,
|
|
61
|
+
attempts,
|
|
62
|
+
error,
|
|
63
|
+
});
|
|
64
|
+
attempts++;
|
|
65
|
+
await new Promise((resolve) => setTimeout(resolve, 1000 * attempts ** 2));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (bootRes === undefined ||
|
|
69
|
+
bootRes.Messages.find((m) => m.Tags.find((t) => t.value === 'Invalid-Boot-Notice'))) {
|
|
70
|
+
if (bootRes === undefined) {
|
|
71
|
+
throw new Error('Failed to get boot result');
|
|
72
|
+
}
|
|
73
|
+
const bootError = errorMessageFromOutput(bootRes);
|
|
74
|
+
logger.error('ANT failed to boot correctly', {
|
|
75
|
+
processId,
|
|
76
|
+
module,
|
|
77
|
+
scheduler,
|
|
78
|
+
bootRes,
|
|
79
|
+
bootError,
|
|
80
|
+
});
|
|
81
|
+
throw new Error(`ANT failed to boot correctly: ${bootError}`);
|
|
82
|
+
}
|
|
46
83
|
logger.debug(`Spawned ANT`, {
|
|
47
84
|
processId,
|
|
48
85
|
module,
|
package/lib/esm/version.js
CHANGED
package/lib/types/version.d.ts
CHANGED