@abtnode/core 1.16.50-beta-20250902-084222-ed7de4a8 → 1.16.51-beta-20250904-031834-c611f059
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.
|
@@ -924,10 +924,14 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
924
924
|
{ parallel: true, concurrencyLimit: 4 }
|
|
925
925
|
);
|
|
926
926
|
if (nonEntryComponentIds.length) {
|
|
927
|
-
|
|
927
|
+
const params = {
|
|
928
|
+
did,
|
|
929
|
+
context,
|
|
930
|
+
minConsecutiveTime: 3000,
|
|
931
|
+
timeout: 5000,
|
|
928
932
|
componentDids: nonEntryComponentIds,
|
|
929
|
-
|
|
930
|
-
});
|
|
933
|
+
};
|
|
934
|
+
nonEntryComponentRes = await this._onCheckIfStarted(params, { throwOnError, skipRunningCheck: true });
|
|
931
935
|
}
|
|
932
936
|
} catch (err) {
|
|
933
937
|
logger.error('Failed to categorize components into entry and non-entry types', { error: err.message });
|
|
@@ -1156,7 +1160,7 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
1156
1160
|
|
|
1157
1161
|
logger.info('blocklet stopped successfully', { processId, did });
|
|
1158
1162
|
|
|
1159
|
-
launcher.
|
|
1163
|
+
launcher.notifyBlockletStopped(blocklet);
|
|
1160
1164
|
|
|
1161
1165
|
if (updateStatus) {
|
|
1162
1166
|
const res = await states.blocklet.setBlockletStatus(did, BlockletStatus.stopped, { componentDids, operator });
|
|
@@ -3379,7 +3383,7 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
3379
3383
|
await this.start({ did, componentDids, operator }, context);
|
|
3380
3384
|
}
|
|
3381
3385
|
|
|
3382
|
-
async _onCheckIfStarted(jobInfo, { throwOnError } = {}) {
|
|
3386
|
+
async _onCheckIfStarted(jobInfo, { throwOnError, skipRunningCheck = false } = {}) {
|
|
3383
3387
|
const startedAt = Date.now();
|
|
3384
3388
|
const { did, context, minConsecutiveTime = 2000, timeout, componentDids } = jobInfo;
|
|
3385
3389
|
const blocklet = await this.getBlocklet(did);
|
|
@@ -3389,18 +3393,19 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
3389
3393
|
|
|
3390
3394
|
const nodeInfo = await states.node.read();
|
|
3391
3395
|
try {
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3396
|
+
if (!skipRunningCheck) {
|
|
3397
|
+
await checkBlockletProcessHealthy(blocklet, {
|
|
3398
|
+
minConsecutiveTime,
|
|
3399
|
+
timeout,
|
|
3400
|
+
componentDids,
|
|
3401
|
+
enableDocker: nodeInfo.enableDocker,
|
|
3402
|
+
setBlockletRunning: async (componentDid) => {
|
|
3403
|
+
await states.blocklet.setBlockletStatus(did, BlockletStatus.running, { componentDids: [componentDid] });
|
|
3404
|
+
},
|
|
3405
|
+
});
|
|
3406
|
+
}
|
|
3402
3407
|
|
|
3403
|
-
await states.blocklet.setBlockletStatus(did, BlockletStatus.running, { componentDids });
|
|
3408
|
+
const runningRes = await states.blocklet.setBlockletStatus(did, BlockletStatus.running, { componentDids });
|
|
3404
3409
|
|
|
3405
3410
|
const res = await this.getBlocklet(did);
|
|
3406
3411
|
|
|
@@ -3413,14 +3418,16 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
3413
3418
|
this.emit(BlockletEvents.statusChange, res);
|
|
3414
3419
|
this.emit(BlockletEvents.started, { ...res, componentDids });
|
|
3415
3420
|
|
|
3416
|
-
launcher.
|
|
3421
|
+
launcher.notifyBlockletStarted(blocklet);
|
|
3417
3422
|
|
|
3418
3423
|
logger.info('blocklet healthy', { did, name, time: Date.now() - startedAt });
|
|
3424
|
+
|
|
3425
|
+
return runningRes;
|
|
3419
3426
|
} catch (error) {
|
|
3420
3427
|
const status = await states.blocklet.getBlockletStatus(did);
|
|
3421
3428
|
if ([BlockletStatus.stopping, BlockletStatus.stopped].includes(status)) {
|
|
3422
3429
|
logger.info(`Check blocklet healthy failing because blocklet is ${fromBlockletStatus(status)}`);
|
|
3423
|
-
return;
|
|
3430
|
+
return {};
|
|
3424
3431
|
}
|
|
3425
3432
|
|
|
3426
3433
|
logger.error('check blocklet if started failed', { did, name, context, timeout, error });
|
|
@@ -3449,6 +3456,8 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
3449
3456
|
if (throwOnError) {
|
|
3450
3457
|
throw error;
|
|
3451
3458
|
}
|
|
3459
|
+
|
|
3460
|
+
return doc;
|
|
3452
3461
|
}
|
|
3453
3462
|
}
|
|
3454
3463
|
|
|
@@ -38946,7 +38946,7 @@ module.exports = require("zlib");
|
|
|
38946
38946
|
/***/ ((module) => {
|
|
38947
38947
|
|
|
38948
38948
|
"use strict";
|
|
38949
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@abtnode/core","publishConfig":{"access":"public"},"version":"1.16.
|
|
38949
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@abtnode/core","publishConfig":{"access":"public"},"version":"1.16.50","description":"","main":"lib/index.js","files":["lib"],"scripts":{"lint":"eslint tests lib --ignore-pattern \'tests/assets/*\'","lint:fix":"eslint --fix tests lib","test":"node tools/jest.js","coverage":"npm run test -- --coverage"},"keywords":[],"author":"wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)","license":"Apache-2.0","dependencies":{"@abtnode/analytics":"1.16.50","@abtnode/auth":"1.16.50","@abtnode/certificate-manager":"1.16.50","@abtnode/constant":"1.16.50","@abtnode/cron":"1.16.50","@abtnode/db-cache":"1.16.50","@abtnode/docker-utils":"1.16.50","@abtnode/logger":"1.16.50","@abtnode/models":"1.16.50","@abtnode/queue":"1.16.50","@abtnode/rbac":"1.16.50","@abtnode/router-provider":"1.16.50","@abtnode/static-server":"1.16.50","@abtnode/timemachine":"1.16.50","@abtnode/util":"1.16.50","@aigne/aigne-hub":"^0.8.6","@arcblock/did":"1.24.0","@arcblock/did-connect-js":"1.24.0","@arcblock/did-ext":"1.24.0","@arcblock/did-motif":"^1.1.14","@arcblock/did-util":"1.24.0","@arcblock/event-hub":"1.24.0","@arcblock/jwt":"1.24.0","@arcblock/pm2-events":"^0.0.5","@arcblock/validator":"1.24.0","@arcblock/vc":"1.24.0","@blocklet/constant":"1.16.50","@blocklet/did-space-js":"^1.1.19","@blocklet/env":"1.16.50","@blocklet/error":"^0.2.5","@blocklet/meta":"1.16.50","@blocklet/resolver":"1.16.50","@blocklet/sdk":"1.16.50","@blocklet/server-js":"1.16.50","@blocklet/store":"1.16.50","@blocklet/theme":"^3.1.33","@fidm/x509":"^1.2.1","@ocap/mcrypto":"1.24.0","@ocap/util":"1.24.0","@ocap/wallet":"1.24.0","@slack/webhook":"^5.0.4","archiver":"^7.0.1","axios":"^1.7.9","axon":"^2.0.3","chalk":"^4.1.2","cross-spawn":"^7.0.3","dayjs":"^1.11.13","deep-diff":"^1.0.2","detect-port":"^1.5.1","envfile":"^7.1.0","escape-string-regexp":"^4.0.0","fast-glob":"^3.3.2","filesize":"^10.1.1","flat":"^5.0.2","fs-extra":"^11.2.0","get-port":"^5.1.1","hasha":"^5.2.2","is-base64":"^1.1.0","is-cidr":"4","is-ip":"3","is-url":"^1.2.4","joi":"17.12.2","joi-extension-semver":"^5.0.0","js-yaml":"^4.1.0","kill-port":"^2.0.1","lodash":"^4.17.21","node-stream-zip":"^1.15.0","p-all":"^3.0.0","p-limit":"^3.1.0","p-map":"^4.0.0","p-retry":"^4.6.2","p-wait-for":"^3.2.0","private-ip":"^2.3.4","rate-limiter-flexible":"^5.0.5","read-last-lines":"^1.8.0","semver":"^7.6.3","sequelize":"^6.35.0","shelljs":"^0.8.5","slugify":"^1.6.6","ssri":"^8.0.1","stream-throttle":"^0.1.3","stream-to-promise":"^3.0.0","systeminformation":"^5.23.3","tail":"^2.2.4","tar":"^6.1.11","transliteration":"^2.3.5","ua-parser-js":"^1.0.2","ufo":"^1.5.3","uuid":"^11.1.0","valid-url":"^1.0.9","which":"^2.0.2","xbytes":"^1.8.0"},"devDependencies":{"expand-tilde":"^2.0.2","express":"^4.18.2","jest":"^29.7.0","unzipper":"^0.10.11"},"gitHead":"e5764f753181ed6a7c615cd4fc6682aacf0cb7cd"}');
|
|
38950
38950
|
|
|
38951
38951
|
/***/ }),
|
|
38952
38952
|
|
package/lib/util/launcher.js
CHANGED
|
@@ -104,7 +104,7 @@ const reportComponentsEvent = async ({ blocklet, dids, type, time }) => {
|
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
-
const
|
|
107
|
+
const notifyLauncher = async (type, blocklet) => {
|
|
108
108
|
try {
|
|
109
109
|
const { controller } = blocklet;
|
|
110
110
|
|
|
@@ -120,7 +120,7 @@ const notifyBlockletUpdated = async (blocklet) => {
|
|
|
120
120
|
const { appLogo, appLogoRect } = getBlockletLogos(blocklet);
|
|
121
121
|
|
|
122
122
|
const payload = {
|
|
123
|
-
type
|
|
123
|
+
type,
|
|
124
124
|
payload: {
|
|
125
125
|
did: blocklet.appDid,
|
|
126
126
|
appId: blocklet.appDid,
|
|
@@ -152,6 +152,10 @@ const notifyBlockletUpdated = async (blocklet) => {
|
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
154
|
|
|
155
|
+
const notifyBlockletUpdated = (blocklet) => notifyLauncher('serverless.blocklet.updated', blocklet);
|
|
156
|
+
const notifyBlockletStarted = (blocklet) => notifyLauncher('serverless.blocklet.started', blocklet);
|
|
157
|
+
const notifyBlockletStopped = (blocklet) => notifyLauncher('serverless.blocklet.stopped', blocklet);
|
|
158
|
+
|
|
155
159
|
const consumeLauncherSession = async ({ params, blocklet }) => {
|
|
156
160
|
try {
|
|
157
161
|
const info = await states.node.read();
|
|
@@ -634,6 +638,8 @@ module.exports = {
|
|
|
634
638
|
isBlockletExpired,
|
|
635
639
|
isBlockletTerminated,
|
|
636
640
|
notifyBlockletUpdated,
|
|
641
|
+
notifyBlockletStarted,
|
|
642
|
+
notifyBlockletStopped,
|
|
637
643
|
launchBlockletByLauncher,
|
|
638
644
|
launchBlockletWithoutWallet,
|
|
639
645
|
};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.
|
|
6
|
+
"version": "1.16.51-beta-20250904-031834-c611f059",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -19,21 +19,21 @@
|
|
|
19
19
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
20
20
|
"license": "Apache-2.0",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@abtnode/analytics": "1.16.
|
|
23
|
-
"@abtnode/auth": "1.16.
|
|
24
|
-
"@abtnode/certificate-manager": "1.16.
|
|
25
|
-
"@abtnode/constant": "1.16.
|
|
26
|
-
"@abtnode/cron": "1.16.
|
|
27
|
-
"@abtnode/db-cache": "1.16.
|
|
28
|
-
"@abtnode/docker-utils": "1.16.
|
|
29
|
-
"@abtnode/logger": "1.16.
|
|
30
|
-
"@abtnode/models": "1.16.
|
|
31
|
-
"@abtnode/queue": "1.16.
|
|
32
|
-
"@abtnode/rbac": "1.16.
|
|
33
|
-
"@abtnode/router-provider": "1.16.
|
|
34
|
-
"@abtnode/static-server": "1.16.
|
|
35
|
-
"@abtnode/timemachine": "1.16.
|
|
36
|
-
"@abtnode/util": "1.16.
|
|
22
|
+
"@abtnode/analytics": "1.16.51-beta-20250904-031834-c611f059",
|
|
23
|
+
"@abtnode/auth": "1.16.51-beta-20250904-031834-c611f059",
|
|
24
|
+
"@abtnode/certificate-manager": "1.16.51-beta-20250904-031834-c611f059",
|
|
25
|
+
"@abtnode/constant": "1.16.51-beta-20250904-031834-c611f059",
|
|
26
|
+
"@abtnode/cron": "1.16.51-beta-20250904-031834-c611f059",
|
|
27
|
+
"@abtnode/db-cache": "1.16.51-beta-20250904-031834-c611f059",
|
|
28
|
+
"@abtnode/docker-utils": "1.16.51-beta-20250904-031834-c611f059",
|
|
29
|
+
"@abtnode/logger": "1.16.51-beta-20250904-031834-c611f059",
|
|
30
|
+
"@abtnode/models": "1.16.51-beta-20250904-031834-c611f059",
|
|
31
|
+
"@abtnode/queue": "1.16.51-beta-20250904-031834-c611f059",
|
|
32
|
+
"@abtnode/rbac": "1.16.51-beta-20250904-031834-c611f059",
|
|
33
|
+
"@abtnode/router-provider": "1.16.51-beta-20250904-031834-c611f059",
|
|
34
|
+
"@abtnode/static-server": "1.16.51-beta-20250904-031834-c611f059",
|
|
35
|
+
"@abtnode/timemachine": "1.16.51-beta-20250904-031834-c611f059",
|
|
36
|
+
"@abtnode/util": "1.16.51-beta-20250904-031834-c611f059",
|
|
37
37
|
"@aigne/aigne-hub": "^0.8.6",
|
|
38
38
|
"@arcblock/did": "1.24.0",
|
|
39
39
|
"@arcblock/did-connect-js": "1.24.0",
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"@arcblock/pm2-events": "^0.0.5",
|
|
46
46
|
"@arcblock/validator": "1.24.0",
|
|
47
47
|
"@arcblock/vc": "1.24.0",
|
|
48
|
-
"@blocklet/constant": "1.16.
|
|
48
|
+
"@blocklet/constant": "1.16.51-beta-20250904-031834-c611f059",
|
|
49
49
|
"@blocklet/did-space-js": "^1.1.19",
|
|
50
|
-
"@blocklet/env": "1.16.
|
|
50
|
+
"@blocklet/env": "1.16.51-beta-20250904-031834-c611f059",
|
|
51
51
|
"@blocklet/error": "^0.2.5",
|
|
52
|
-
"@blocklet/meta": "1.16.
|
|
53
|
-
"@blocklet/resolver": "1.16.
|
|
54
|
-
"@blocklet/sdk": "1.16.
|
|
55
|
-
"@blocklet/server-js": "1.16.
|
|
56
|
-
"@blocklet/store": "1.16.
|
|
52
|
+
"@blocklet/meta": "1.16.51-beta-20250904-031834-c611f059",
|
|
53
|
+
"@blocklet/resolver": "1.16.51-beta-20250904-031834-c611f059",
|
|
54
|
+
"@blocklet/sdk": "1.16.51-beta-20250904-031834-c611f059",
|
|
55
|
+
"@blocklet/server-js": "1.16.51-beta-20250904-031834-c611f059",
|
|
56
|
+
"@blocklet/store": "1.16.51-beta-20250904-031834-c611f059",
|
|
57
57
|
"@blocklet/theme": "^3.1.33",
|
|
58
58
|
"@fidm/x509": "^1.2.1",
|
|
59
59
|
"@ocap/mcrypto": "1.24.0",
|
|
@@ -118,5 +118,5 @@
|
|
|
118
118
|
"jest": "^29.7.0",
|
|
119
119
|
"unzipper": "^0.10.11"
|
|
120
120
|
},
|
|
121
|
-
"gitHead": "
|
|
121
|
+
"gitHead": "c5cedc16ca7239ec7dcadd8e046b2f8684df335c"
|
|
122
122
|
}
|