@abtnode/core 1.17.4 → 1.17.5-beta-20251209-090953-3a59e7ac
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.
|
@@ -514,7 +514,7 @@ module.exports = Object.freeze({
|
|
|
514
514
|
BLOCKLET_STORE: {
|
|
515
515
|
id: 'zNKqX7D8ZAYa77HgzpoFfnV3BFbcmSRrE9aT',
|
|
516
516
|
name: 'Official Store',
|
|
517
|
-
description: 'ArcBlock official
|
|
517
|
+
description: 'ArcBlock official store for production ready blocklets',
|
|
518
518
|
url: BLOCKLET_STORE_URL,
|
|
519
519
|
logoUrl: '/logo.png',
|
|
520
520
|
maintainer: 'arcblock',
|
|
@@ -522,11 +522,19 @@ module.exports = Object.freeze({
|
|
|
522
522
|
BLOCKLET_STORE_DEV: {
|
|
523
523
|
id: 'zNKmfUatDhzfMVACfr3u97eqndj8f1yXXw3m',
|
|
524
524
|
name: 'Dev Store',
|
|
525
|
-
description: 'ArcBlock
|
|
525
|
+
description: 'ArcBlock official store for demo and example blocklets',
|
|
526
526
|
url: BLOCKLET_STORE_URL_DEV,
|
|
527
527
|
maintainer: 'arcblock',
|
|
528
528
|
logoUrl: '/logo.png',
|
|
529
529
|
},
|
|
530
|
+
BLOCKLET_TEST_STORE: {
|
|
531
|
+
id: 'zNKirQVRx4xbyTPMkvH3kguRfofTJana8WBK',
|
|
532
|
+
name: 'Test Store',
|
|
533
|
+
description: 'ArcBlock official store for non-production ready blocklets',
|
|
534
|
+
url: TEST_STORE_URL,
|
|
535
|
+
maintainer: 'arcblock',
|
|
536
|
+
logoUrl: '/logo.png',
|
|
537
|
+
},
|
|
530
538
|
|
|
531
539
|
// application is a container, components have no hierarchy and are tiled in application
|
|
532
540
|
APP_STRUCT_VERSION: '2',
|
|
@@ -39036,7 +39044,7 @@ module.exports = require("zlib");
|
|
|
39036
39044
|
/***/ ((module) => {
|
|
39037
39045
|
|
|
39038
39046
|
"use strict";
|
|
39039
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@abtnode/core","publishConfig":{"access":"public"},"version":"1.17.
|
|
39047
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@abtnode/core","publishConfig":{"access":"public"},"version":"1.17.4","description":"","main":"lib/index.js","files":["lib"],"scripts":{"lint":"eslint tests lib --ignore-pattern \'tests/assets/*\'","lint:fix":"eslint --fix tests lib"},"keywords":[],"author":"wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)","license":"Apache-2.0","dependencies":{"@abtnode/analytics":"1.17.4","@abtnode/auth":"1.17.4","@abtnode/certificate-manager":"1.17.4","@abtnode/constant":"1.17.4","@abtnode/cron":"1.17.4","@abtnode/db-cache":"1.17.4","@abtnode/docker-utils":"1.17.4","@abtnode/logger":"1.17.4","@abtnode/models":"1.17.4","@abtnode/queue":"1.17.4","@abtnode/rbac":"1.17.4","@abtnode/router-provider":"1.17.4","@abtnode/static-server":"1.17.4","@abtnode/timemachine":"1.17.4","@abtnode/util":"1.17.4","@aigne/aigne-hub":"^0.10.10","@arcblock/did":"^1.27.12","@arcblock/did-connect-js":"^1.27.12","@arcblock/did-ext":"^1.27.12","@arcblock/did-motif":"^1.1.14","@arcblock/did-util":"^1.27.12","@arcblock/event-hub":"^1.27.12","@arcblock/jwt":"^1.27.12","@arcblock/pm2-events":"^0.0.5","@arcblock/validator":"^1.27.12","@arcblock/vc":"^1.27.12","@blocklet/constant":"1.17.4","@blocklet/did-space-js":"^1.2.6","@blocklet/env":"1.17.4","@blocklet/error":"^0.3.3","@blocklet/meta":"1.17.4","@blocklet/resolver":"1.17.4","@blocklet/sdk":"1.17.4","@blocklet/server-js":"1.17.4","@blocklet/store":"1.17.4","@blocklet/theme":"^3.2.11","@fidm/x509":"^1.2.1","@ocap/mcrypto":"^1.27.12","@ocap/util":"^1.27.12","@ocap/wallet":"^1.27.12","@slack/webhook":"^7.0.6","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":{"axios-mock-adapter":"^2.1.0","expand-tilde":"^2.0.2","express":"^4.18.2","unzipper":"^0.10.11"},"gitHead":"e5764f753181ed6a7c615cd4fc6682aacf0cb7cd"}');
|
|
39040
39048
|
|
|
39041
39049
|
/***/ }),
|
|
39042
39050
|
|
package/lib/event/index.js
CHANGED
|
@@ -25,6 +25,7 @@ const { encode } = require('@abtnode/util/lib/base32');
|
|
|
25
25
|
const dayjs = require('@abtnode/util/lib/dayjs');
|
|
26
26
|
|
|
27
27
|
const { isInstanceWorker } = require('@abtnode/util/lib/pm2/is-instance-worker');
|
|
28
|
+
const { isInServerlessMode } = require('@abtnode/util/lib/serverless');
|
|
28
29
|
const { NodeMonitSender } = require('../monitor/node-monit-sender');
|
|
29
30
|
const { isCLI } = require('../util');
|
|
30
31
|
|
|
@@ -44,6 +45,7 @@ const {
|
|
|
44
45
|
routingSnapshotPrefix,
|
|
45
46
|
} = require('./util');
|
|
46
47
|
const { ensureBlockletHasMultipleInterfaces } = require('../router/helper');
|
|
48
|
+
const { sendServerlessHeartbeat } = require('../util/launcher');
|
|
47
49
|
|
|
48
50
|
/**
|
|
49
51
|
*
|
|
@@ -80,6 +82,10 @@ module.exports = ({
|
|
|
80
82
|
const events = new EventEmitter();
|
|
81
83
|
events.setMaxListeners(0);
|
|
82
84
|
|
|
85
|
+
// Throttle serverless heartbeat: only call once every 30 seconds
|
|
86
|
+
let lastServerlessHeartbeatTime = 0;
|
|
87
|
+
const SERVERLESS_HEARTBEAT_THROTTLE_MS = 30000;
|
|
88
|
+
|
|
83
89
|
let eventHandler = null;
|
|
84
90
|
events.setEventHandler = (handler) => {
|
|
85
91
|
if (typeof handler === 'function') {
|
|
@@ -521,6 +527,39 @@ module.exports = ({
|
|
|
521
527
|
} else {
|
|
522
528
|
onEvent(eventName, payload);
|
|
523
529
|
}
|
|
530
|
+
|
|
531
|
+
if (
|
|
532
|
+
[
|
|
533
|
+
BlockletEvents.started,
|
|
534
|
+
BlockletEvents.removed,
|
|
535
|
+
BlockletEvents.statusChange,
|
|
536
|
+
BlockletEvents.installed,
|
|
537
|
+
BlockletEvents.componentInstalled,
|
|
538
|
+
BlockletEvents.componentRemoved,
|
|
539
|
+
].includes(eventName)
|
|
540
|
+
) {
|
|
541
|
+
const now = Date.now();
|
|
542
|
+
const remainingMs = SERVERLESS_HEARTBEAT_THROTTLE_MS - (now - lastServerlessHeartbeatTime);
|
|
543
|
+
if (remainingMs <= 0) {
|
|
544
|
+
lastServerlessHeartbeatTime = now;
|
|
545
|
+
node
|
|
546
|
+
.getNodeInfo()
|
|
547
|
+
.then((nodeInfo) => {
|
|
548
|
+
if (isInServerlessMode({ mode: nodeInfo.mode })) {
|
|
549
|
+
logger.info('send serverless heartbeat', { eventName });
|
|
550
|
+
sendServerlessHeartbeat();
|
|
551
|
+
}
|
|
552
|
+
})
|
|
553
|
+
.catch((error) => {
|
|
554
|
+
logger.error('Failed to get node info to send serverless heartbeat', { error, eventName });
|
|
555
|
+
});
|
|
556
|
+
} else {
|
|
557
|
+
logger.debug('serverless heartbeat throttled', {
|
|
558
|
+
eventName,
|
|
559
|
+
remainingMs,
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
}
|
|
524
563
|
};
|
|
525
564
|
|
|
526
565
|
const downloadAddedBlocklet = async () => {
|
package/lib/router/helper.js
CHANGED
|
@@ -67,6 +67,7 @@ const {
|
|
|
67
67
|
BlockletEvents,
|
|
68
68
|
BLOCKLET_MODES,
|
|
69
69
|
} = require('@blocklet/constant');
|
|
70
|
+
const { isInstanceWorker } = require('@abtnode/util/lib/pm2/is-instance-worker');
|
|
70
71
|
|
|
71
72
|
const pkg = require('../../package.json');
|
|
72
73
|
// eslint-disable-next-line
|
|
@@ -1647,7 +1648,7 @@ module.exports = function getRouterHelpers({
|
|
|
1647
1648
|
|
|
1648
1649
|
const startAccessLogWatcher = (info) => {
|
|
1649
1650
|
const providerName = get(info, 'routing.provider', null);
|
|
1650
|
-
if (!providerName || !providers[providerName]) {
|
|
1651
|
+
if (!providerName || !providers[providerName] || isInstanceWorker()) {
|
|
1651
1652
|
return;
|
|
1652
1653
|
}
|
|
1653
1654
|
|
|
@@ -1673,7 +1674,7 @@ module.exports = function getRouterHelpers({
|
|
|
1673
1674
|
|
|
1674
1675
|
const startErrorLogWatcher = async (info, shouldScheduleReload = false) => {
|
|
1675
1676
|
const providerName = get(info, 'routing.provider', null);
|
|
1676
|
-
if (!providerName || !providers[providerName]) {
|
|
1677
|
+
if (!providerName || !providers[providerName] || isInstanceWorker()) {
|
|
1677
1678
|
return;
|
|
1678
1679
|
}
|
|
1679
1680
|
|
package/lib/util/blocklet.js
CHANGED
|
@@ -2052,7 +2052,7 @@ const getConfigFromPreferences = (blocklet) => {
|
|
|
2052
2052
|
return result;
|
|
2053
2053
|
};
|
|
2054
2054
|
|
|
2055
|
-
const shouldEnableSlpDomain = (
|
|
2055
|
+
const shouldEnableSlpDomain = (mode) => {
|
|
2056
2056
|
if (process.env.ABT_NODE_ENABLE_SLP_DOMAIN === 'true') {
|
|
2057
2057
|
return true;
|
|
2058
2058
|
}
|
|
@@ -2061,11 +2061,11 @@ const shouldEnableSlpDomain = ({ mode, launcher }) => {
|
|
|
2061
2061
|
return false;
|
|
2062
2062
|
}
|
|
2063
2063
|
|
|
2064
|
-
return isInServerlessMode({ mode })
|
|
2064
|
+
return isInServerlessMode({ mode });
|
|
2065
2065
|
};
|
|
2066
2066
|
|
|
2067
2067
|
const getBlockletURLForLauncher = ({ blocklet, nodeInfo }) => {
|
|
2068
|
-
const enableSlpDomain = shouldEnableSlpDomain(
|
|
2068
|
+
const enableSlpDomain = shouldEnableSlpDomain(nodeInfo.mode);
|
|
2069
2069
|
let didDomain = '';
|
|
2070
2070
|
if (enableSlpDomain) {
|
|
2071
2071
|
didDomain = getDidDomainForBlocklet({
|
|
@@ -2464,10 +2464,7 @@ const getBlockletDidDomainList = (blocklet, nodeInfo) => {
|
|
|
2464
2464
|
});
|
|
2465
2465
|
|
|
2466
2466
|
// eslint-disable-next-line no-use-before-define
|
|
2467
|
-
const enableSlpDomain = shouldEnableSlpDomain(
|
|
2468
|
-
mode: nodeInfo.mode,
|
|
2469
|
-
launcher: nodeInfo.launcher,
|
|
2470
|
-
});
|
|
2467
|
+
const enableSlpDomain = shouldEnableSlpDomain(nodeInfo.mode);
|
|
2471
2468
|
if (enableSlpDomain) {
|
|
2472
2469
|
// eslint-disable-next-line no-use-before-define
|
|
2473
2470
|
const slpDid = getSlpDid(nodeInfo.did, blocklet.appPid);
|
|
@@ -2672,10 +2669,10 @@ const getSlpDid = (serverDid, appPid) => {
|
|
|
2672
2669
|
const updateDidDocument = async ({ blocklet, nodeInfo }) => {
|
|
2673
2670
|
const alsoKnownAs = getBlockletKnownAs(blocklet);
|
|
2674
2671
|
const { wallet } = getBlockletInfo(blocklet, nodeInfo.sk);
|
|
2675
|
-
const { mode,
|
|
2672
|
+
const { mode, did: serverDid } = nodeInfo;
|
|
2676
2673
|
|
|
2677
2674
|
let slpDid = null;
|
|
2678
|
-
const enableSlpDomain = shouldEnableSlpDomain(
|
|
2675
|
+
const enableSlpDomain = shouldEnableSlpDomain(mode);
|
|
2679
2676
|
if (enableSlpDomain) {
|
|
2680
2677
|
slpDid = getSlpDid(serverDid, blocklet.appPid);
|
|
2681
2678
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { BLOCKLET_LAUNCHER_URL, BLOCKLET_STORE, BLOCKLET_STORE_DEV } = require('@abtnode/constant');
|
|
1
|
+
const { BLOCKLET_LAUNCHER_URL, BLOCKLET_STORE, BLOCKLET_STORE_DEV, BLOCKLET_TEST_STORE } = require('@abtnode/constant');
|
|
2
2
|
const canPackageReadWrite = require('@abtnode/util/lib/can-pkg-rw');
|
|
3
3
|
|
|
4
4
|
const getDefaultAutoUpgrade = () => {
|
|
@@ -24,6 +24,10 @@ const defaultNodeConfigs = {
|
|
|
24
24
|
...BLOCKLET_STORE_DEV,
|
|
25
25
|
protected: false,
|
|
26
26
|
},
|
|
27
|
+
{
|
|
28
|
+
...BLOCKLET_TEST_STORE,
|
|
29
|
+
protected: false,
|
|
30
|
+
},
|
|
27
31
|
],
|
|
28
32
|
},
|
|
29
33
|
registerUrl: { getDefaultValue: () => BLOCKLET_LAUNCHER_URL },
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.17.
|
|
6
|
+
"version": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -17,21 +17,21 @@
|
|
|
17
17
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
18
18
|
"license": "Apache-2.0",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@abtnode/analytics": "1.17.
|
|
21
|
-
"@abtnode/auth": "1.17.
|
|
22
|
-
"@abtnode/certificate-manager": "1.17.
|
|
23
|
-
"@abtnode/constant": "1.17.
|
|
24
|
-
"@abtnode/cron": "1.17.
|
|
25
|
-
"@abtnode/db-cache": "1.17.
|
|
26
|
-
"@abtnode/docker-utils": "1.17.
|
|
27
|
-
"@abtnode/logger": "1.17.
|
|
28
|
-
"@abtnode/models": "1.17.
|
|
29
|
-
"@abtnode/queue": "1.17.
|
|
30
|
-
"@abtnode/rbac": "1.17.
|
|
31
|
-
"@abtnode/router-provider": "1.17.
|
|
32
|
-
"@abtnode/static-server": "1.17.
|
|
33
|
-
"@abtnode/timemachine": "1.17.
|
|
34
|
-
"@abtnode/util": "1.17.
|
|
20
|
+
"@abtnode/analytics": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
21
|
+
"@abtnode/auth": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
22
|
+
"@abtnode/certificate-manager": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
23
|
+
"@abtnode/constant": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
24
|
+
"@abtnode/cron": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
25
|
+
"@abtnode/db-cache": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
26
|
+
"@abtnode/docker-utils": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
27
|
+
"@abtnode/logger": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
28
|
+
"@abtnode/models": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
29
|
+
"@abtnode/queue": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
30
|
+
"@abtnode/rbac": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
31
|
+
"@abtnode/router-provider": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
32
|
+
"@abtnode/static-server": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
33
|
+
"@abtnode/timemachine": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
34
|
+
"@abtnode/util": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
35
35
|
"@aigne/aigne-hub": "^0.10.10",
|
|
36
36
|
"@arcblock/did": "^1.27.12",
|
|
37
37
|
"@arcblock/did-connect-js": "^1.27.12",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
"@arcblock/pm2-events": "^0.0.5",
|
|
44
44
|
"@arcblock/validator": "^1.27.12",
|
|
45
45
|
"@arcblock/vc": "^1.27.12",
|
|
46
|
-
"@blocklet/constant": "1.17.
|
|
46
|
+
"@blocklet/constant": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
47
47
|
"@blocklet/did-space-js": "^1.2.6",
|
|
48
|
-
"@blocklet/env": "1.17.
|
|
48
|
+
"@blocklet/env": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
49
49
|
"@blocklet/error": "^0.3.3",
|
|
50
|
-
"@blocklet/meta": "1.17.
|
|
51
|
-
"@blocklet/resolver": "1.17.
|
|
52
|
-
"@blocklet/sdk": "1.17.
|
|
53
|
-
"@blocklet/server-js": "1.17.
|
|
54
|
-
"@blocklet/store": "1.17.
|
|
50
|
+
"@blocklet/meta": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
51
|
+
"@blocklet/resolver": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
52
|
+
"@blocklet/sdk": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
53
|
+
"@blocklet/server-js": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
54
|
+
"@blocklet/store": "1.17.5-beta-20251209-090953-3a59e7ac",
|
|
55
55
|
"@blocklet/theme": "^3.2.11",
|
|
56
56
|
"@fidm/x509": "^1.2.1",
|
|
57
57
|
"@ocap/mcrypto": "^1.27.12",
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"express": "^4.18.2",
|
|
117
117
|
"unzipper": "^0.10.11"
|
|
118
118
|
},
|
|
119
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "514964082a28e8c6658d9a62cf283811dd6a8baf"
|
|
120
120
|
}
|