@blocklet/cli 1.16.49-beta-20250819-084933-3bcbd851 → 1.16.49-beta-20250822-070545-6d3344cc

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.
@@ -12,7 +12,7 @@ class ScreenshotsBundler {
12
12
  * @param {{
13
13
  * blockletDir: string,
14
14
  * bundleDir: string,
15
- * meta: import('@abtnode/client').BlockletMeta
15
+ * meta: import('@blocklet/server-js').BlockletMeta
16
16
  * }} { blockletDir, bundleDir, meta }
17
17
  * @memberof ScreenshotsBundler
18
18
  */
@@ -8,7 +8,7 @@ const chalk = require('chalk');
8
8
  const { joinURL } = require('ufo');
9
9
 
10
10
  const { isValid: isValidDid, toAddress } = require('@arcblock/did');
11
- const Client = require('@abtnode/client');
11
+ const Client = require('@blocklet/server-js');
12
12
  const hashFiles = require('@abtnode/util/lib/hash-files');
13
13
  const { default: axios } = require('axios');
14
14
  const validateBlockletEntry = require('@blocklet/meta/lib/entry');
@@ -17,7 +17,6 @@ const cleanup = require('./cleanup');
17
17
  const logs = require('./logs');
18
18
  const status = require('./status');
19
19
  const upgrade = require('./upgrade');
20
- const rescue = require('./rescue');
21
20
  const migrate = require('./migrate');
22
21
  const { printVersionTip } = require('../../util');
23
22
 
@@ -107,13 +106,6 @@ module.exports = (parentCommand = '') => {
107
106
  .description('Stop Blocklet Server and blocklets')
108
107
  .action(parseOptions(stop.run));
109
108
 
110
- program
111
- .command('rescue')
112
- .option('--stopped-after <datetime>', 'Only start blocklets that are stopped after the specified time')
113
- .option('-f --force', 'Force start all blocklets, even if they are already running', false)
114
- .description('Start all blocklets in current running server')
115
- .action(parseOptions(rescue.run));
116
-
117
109
  program
118
110
  .command('info')
119
111
  .option('-C --clipboard', 'Automatically copy environment information to clipboard', false)
@@ -67,7 +67,7 @@ exports.run = ({ clipboard }) => {
67
67
  const correct = await ip.isDnsIpMappingCorrect(config.node.did);
68
68
 
69
69
  /**
70
- * @type {{node: import('@abtnode/client')}}
70
+ * @type {{node: import('@blocklet/server-js')}}
71
71
  */
72
72
  const { node } = await getNode({ dir: process.cwd() });
73
73
 
@@ -20,7 +20,6 @@ const {
20
20
  MAX_UPLOAD_FILE_SIZE,
21
21
  NODE_MODES,
22
22
  DEFAULT_DID_REGISTRY,
23
- PROXY_MAX_MEM_LIMIT_IN_MB,
24
23
  DEFAULT_DID_DOMAIN,
25
24
  DEFAULT_SLP_DOMAIN,
26
25
  } = require('@abtnode/constant');
@@ -389,7 +388,6 @@ exports.run = async ({
389
388
  },
390
389
  runtimeConfig: {
391
390
  daemonMaxMemoryLimit: Math.floor(daemonMaxMemoryLimit * 1024),
392
- proxyMaxMemoryLimit: PROXY_MAX_MEM_LIMIT_IN_MB,
393
391
  blockletMaxMemoryLimit: Math.floor(blockletMaxMemoryLimit * 1024),
394
392
  },
395
393
  didRegistry: (process.env.ABT_NODE_DID_REGISTRY || didRegistry || DEFAULT_DID_REGISTRY).trim(),
@@ -30,7 +30,6 @@ const {
30
30
  CONFIG_FOLDER_NAME_OLD,
31
31
  MAX_UPLOAD_FILE_SIZE,
32
32
  DAEMON_MAX_MEM_LIMIT_IN_MB,
33
- PROXY_MAX_MEM_LIMIT_IN_MB,
34
33
  BLOCKLET_MAX_MEM_LIMIT_IN_MB,
35
34
  EVENTS,
36
35
  NODE_MODES,
@@ -100,7 +99,6 @@ const updateVersionInConfigFileAndState = async (config, configFile, node) => {
100
99
  runtimeConfig: {
101
100
  daemonMaxMemoryLimit: calculatedLimit,
102
101
  blockletMaxMemoryLimit: get(info, 'runtimeConfig.blockletMaxMemoryLimit', BLOCKLET_MAX_MEM_LIMIT_IN_MB),
103
- proxyMaxMemoryLimit: get(info, 'runtimeConfig.proxyMaxMemoryLimit', DAEMON_MAX_MEM_LIMIT_IN_MB),
104
102
  },
105
103
  });
106
104
  if (semver.neq(config.node.version, version)) {
@@ -151,7 +149,6 @@ const getDifferentAttributes = (dbInfo, config) => {
151
149
  { name: 'routing.enableIpServer', type: Boolean, required: false },
152
150
  { name: 'mode', type: String, required: false },
153
151
  // { name: 'runtimeConfig.daemonMaxMemoryLimit', type: Number, required: false },
154
- { name: 'runtimeConfig.proxyMaxMemoryLimit', type: Number, required: false },
155
152
  { name: 'runtimeConfig.blockletMaxMemoryLimit', type: Number, required: false },
156
153
  { name: 'didRegistry', type: String, required: true },
157
154
  { name: 'didDomain', type: String, required: true },
@@ -433,7 +430,7 @@ const exec = async ({ workingDir, config, dataDir, mode, updateDb, forceIntranet
433
430
 
434
431
  const configFile = await getConfigFile(workingDir);
435
432
 
436
- const proxyMaxMemoryLimit = get(config, 'node.runtimeConfig.proxyMaxMemoryLimit', PROXY_MAX_MEM_LIMIT_IN_MB);
433
+ const blockletMaxMemoryLimit = get(config, 'node.runtimeConfig.blockletMaxMemoryLimit', BLOCKLET_MAX_MEM_LIMIT_IN_MB);
437
434
 
438
435
  // 如果日志目录不存在,pm2 会启动可能会失败, 测试发现 docker 里的 Ubuntu 18.04.4 LTS 系统会失败,
439
436
  // MAC OS 下正常,但是没搞明白为什么
@@ -444,7 +441,7 @@ const exec = async ({ workingDir, config, dataDir, mode, updateDb, forceIntranet
444
441
  const { node, getBaseUrls, publishEvent, wallet } = await nodeLib.getNode({ dir: workingDir });
445
442
 
446
443
  // start event-hub
447
- const [eventHubPort, pm2EventHubPort] = await startEventHub(logDir, proxyMaxMemoryLimit, config.node.sk);
444
+ const [eventHubPort, pm2EventHubPort] = await startEventHub(logDir, blockletMaxMemoryLimit, config.node.sk);
448
445
 
449
446
  return new Promise((resolve) => {
450
447
  node.onReady(async () => {
@@ -538,7 +535,6 @@ const exec = async ({ workingDir, config, dataDir, mode, updateDb, forceIntranet
538
535
  'node.runtimeConfig.blockletMaxMemoryLimit',
539
536
  BLOCKLET_MAX_MEM_LIMIT_IN_MB
540
537
  ),
541
- proxyMaxMemoryLimit: get(latest, 'node.runtimeConfig.proxyMaxMemoryLimit', DAEMON_MAX_MEM_LIMIT_IN_MB),
542
538
  },
543
539
  };
544
540
 
package/lib/util/index.js CHANGED
@@ -30,12 +30,12 @@ const { isProcessRunningByPm2 } = require('@abtnode/util/lib/pm2/pm2-start-or-re
30
30
 
31
31
  const {
32
32
  PROCESS_NAME_EVENT_HUB,
33
- PROXY_MAX_MEM_LIMIT_IN_MB,
34
33
  DEFAULT_DESCRIPTION,
35
34
  DEFAULT_HTTP_PORT,
36
35
  NODE_MODES,
37
36
  DEFAULT_HTTPS_PORT,
38
37
  PROCESS_NAME_PM2_EVENT_HUB,
38
+ BLOCKLET_MAX_MEM_LIMIT_IN_MB,
39
39
  } = require('@abtnode/constant');
40
40
  const gitUserName = require('git-user-name');
41
41
 
@@ -228,7 +228,7 @@ const getGitHash = (dir) => git.long(dir);
228
228
 
229
229
  const getCliCwd = () => path.dirname(path.dirname(__dirname));
230
230
 
231
- const startEventHub = async (logDir, maxMemoryRestart = PROXY_MAX_MEM_LIMIT_IN_MB, ABT_NODE_SK = '') => {
231
+ const startEventHub = async (logDir, maxMemoryRestart = BLOCKLET_MAX_MEM_LIMIT_IN_MB, ABT_NODE_SK = '') => {
232
232
  const port = getInternalPort(PROCESS_NAME_EVENT_HUB);
233
233
  const pm2EventHubPort = getInternalPort(PROCESS_NAME_PM2_EVENT_HUB);
234
234
  debug('start event hub', { port });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/cli",
3
- "version": "1.16.49-beta-20250819-084933-3bcbd851",
3
+ "version": "1.16.49-beta-20250822-070545-6d3344cc",
4
4
  "description": "Command line tools to manage Blocklet Server",
5
5
  "homepage": "https://github.com/ArcBlock/blocklet-server#readme",
6
6
  "bin": {
@@ -35,28 +35,28 @@
35
35
  "url": "https://github.com/ArcBlock/blocklet-server/issues"
36
36
  },
37
37
  "dependencies": {
38
- "@abtnode/blocklet-services": "1.16.49-beta-20250819-084933-3bcbd851",
39
- "@abtnode/client": "1.16.49-beta-20250819-084933-3bcbd851",
40
- "@abtnode/constant": "1.16.49-beta-20250819-084933-3bcbd851",
41
- "@abtnode/core": "1.16.49-beta-20250819-084933-3bcbd851",
42
- "@abtnode/db-cache": "1.16.49-beta-20250819-084933-3bcbd851",
43
- "@abtnode/logger": "1.16.49-beta-20250819-084933-3bcbd851",
44
- "@abtnode/models": "1.16.49-beta-20250819-084933-3bcbd851",
45
- "@abtnode/router-provider": "1.16.49-beta-20250819-084933-3bcbd851",
46
- "@abtnode/util": "1.16.49-beta-20250819-084933-3bcbd851",
47
- "@abtnode/webapp": "1.16.49-beta-20250819-084933-3bcbd851",
38
+ "@abtnode/blocklet-services": "1.16.49-beta-20250822-070545-6d3344cc",
39
+ "@abtnode/constant": "1.16.49-beta-20250822-070545-6d3344cc",
40
+ "@abtnode/core": "1.16.49-beta-20250822-070545-6d3344cc",
41
+ "@abtnode/db-cache": "1.16.49-beta-20250822-070545-6d3344cc",
42
+ "@abtnode/logger": "1.16.49-beta-20250822-070545-6d3344cc",
43
+ "@abtnode/models": "1.16.49-beta-20250822-070545-6d3344cc",
44
+ "@abtnode/router-provider": "1.16.49-beta-20250822-070545-6d3344cc",
45
+ "@abtnode/util": "1.16.49-beta-20250822-070545-6d3344cc",
46
+ "@abtnode/webapp": "1.16.49-beta-20250822-070545-6d3344cc",
48
47
  "@arcblock/did": "1.22.2",
49
48
  "@arcblock/event-hub": "1.22.2",
50
49
  "@arcblock/ipfs-only-hash": "^0.0.2",
51
50
  "@arcblock/jwt": "1.22.2",
52
51
  "@arcblock/ws": "1.22.2",
53
- "@blocklet/constant": "1.16.49-beta-20250819-084933-3bcbd851",
52
+ "@blocklet/constant": "1.16.49-beta-20250822-070545-6d3344cc",
54
53
  "@blocklet/error": "^0.2.5",
55
54
  "@blocklet/form-collector": "^0.1.8",
56
- "@blocklet/images": "1.16.49-beta-20250819-084933-3bcbd851",
57
- "@blocklet/meta": "1.16.49-beta-20250819-084933-3bcbd851",
58
- "@blocklet/resolver": "1.16.49-beta-20250819-084933-3bcbd851",
59
- "@blocklet/store": "1.16.49-beta-20250819-084933-3bcbd851",
55
+ "@blocklet/images": "1.16.49-beta-20250822-070545-6d3344cc",
56
+ "@blocklet/meta": "1.16.49-beta-20250822-070545-6d3344cc",
57
+ "@blocklet/resolver": "1.16.49-beta-20250822-070545-6d3344cc",
58
+ "@blocklet/server-js": "1.16.49-beta-20250822-070545-6d3344cc",
59
+ "@blocklet/store": "1.16.49-beta-20250822-070545-6d3344cc",
60
60
  "@blocklet/theme-builder": "^0.4.6",
61
61
  "@ocap/client": "1.22.2",
62
62
  "@ocap/mcrypto": "1.22.2",
@@ -154,7 +154,7 @@
154
154
  "engines": {
155
155
  "node": ">=14"
156
156
  },
157
- "gitHead": "b8bbf2279e9a29bd58eac7b66e1db16e851a183c",
157
+ "gitHead": "c5560fe749fe495b03003ac7325da29c71f5e62b",
158
158
  "devDependencies": {
159
159
  "@types/fs-extra": "^11.0.4",
160
160
  "@types/jest": "^29.5.13"
@@ -1,71 +0,0 @@
1
- /* eslint-disable no-await-in-loop */
2
- /* eslint-disable no-continue */
3
-
4
- const trim = require('lodash/trim');
5
- const { BLOCKLET_MODES, BlockletStatus } = require('@blocklet/constant');
6
-
7
- const { getDisplayName } = require('@blocklet/meta/lib/util');
8
- const { printError, printSuccess, printWarning, printInfo } = require('../../util');
9
- const { getNode } = require('../../node');
10
- const { checkRunning } = require('../../manager');
11
- const { wrapSpinner } = require('../../ui');
12
-
13
- const isAfter = (t1, t2) => new Date(t1).getTime() >= new Date(t2).getTime();
14
-
15
- exports.run = async ({ force = false, stoppedAfter }) => {
16
- const { node } = await getNode({ dir: process.cwd() });
17
-
18
- if (!trim(stoppedAfter) || !new Date(stoppedAfter).getTime()) {
19
- printError('Please provide a valid --stopped-after time');
20
- process.exit(1);
21
- }
22
-
23
- const isRunning = await checkRunning();
24
- if (!isRunning) {
25
- printWarning('Blocklet Server is not running!');
26
- process.exit(0);
27
- }
28
-
29
- node.onReady(async () => {
30
- let blocklets = [];
31
-
32
- blocklets = await node.getBlocklets({ includeRuntimeInfo: false });
33
-
34
- for (let i = 0; i < blocklets.length; i++) {
35
- const blocklet = blocklets[i];
36
- const title = getDisplayName(blocklet);
37
- if (blocklet.mode === BLOCKLET_MODES.DEVELOPMENT) {
38
- printInfo(`Skip development blocklet: ${title}`);
39
- continue;
40
- }
41
-
42
- if (blocklet.status === BlockletStatus.running && !force) {
43
- printInfo(`Skip running blocklet: ${title}`);
44
- continue;
45
- }
46
-
47
- let minStoppedAt = 0;
48
- blocklet.children.forEach((child) => {
49
- if (isAfter(child.stoppedAt, minStoppedAt)) {
50
- minStoppedAt = child.stoppedAt;
51
- }
52
- });
53
-
54
- if (!isAfter(minStoppedAt, stoppedAfter)) {
55
- printInfo(`Skip blocklet: ${title} because it was not stopped after ${stoppedAfter}`);
56
- continue;
57
- }
58
-
59
- try {
60
- await wrapSpinner(`Starting blocklet: ${title}`, async () => {
61
- await node.startBlocklet({ did: blocklet.appDid, checkHealthImmediately: true, throwOnError: true });
62
- });
63
- } catch (err) {
64
- printError(`Failed to start blocklet ${title}`, err.message);
65
- }
66
- }
67
-
68
- printSuccess('Done!');
69
- process.exit(0);
70
- });
71
- };