@abtnode/core 1.16.0 → 1.16.1-beta-cd775909

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.
@@ -6,7 +6,7 @@ const Client = require('@ocap/client');
6
6
 
7
7
  const logger = require('@abtnode/logger')('@abtnode/core:migrate-application-to-struct-v2');
8
8
 
9
- const { forEachBlockletSync, forEachChildSync, getSharedConfigObj, getChainInfo } = require('@blocklet/meta/lib/util');
9
+ const { forEachBlockletSync, getSharedConfigObj, getBlockletChainInfo } = require('@blocklet/meta/lib/util');
10
10
  const { SLOT_FOR_IP_DNS_SITE } = require('@abtnode/constant');
11
11
 
12
12
  const {
@@ -92,28 +92,7 @@ const fillBlockletData = (data, app, id) => {
92
92
  const appSystemFiles = ['logo.svg', 'rbac.db', 'session.db', 'user.db', '.assets', BLOCKLET_UPLOADS_DIR];
93
93
 
94
94
  const getChainHost = (blocklet) => {
95
- if (!blocklet) {
96
- return 'none';
97
- }
98
-
99
- const chainInfo = getChainInfo(blocklet.configObj);
100
- if (chainInfo.host !== 'none') {
101
- return chainInfo.host;
102
- }
103
-
104
- let childChainHost;
105
- forEachChildSync(blocklet, (b) => {
106
- if (childChainHost) {
107
- return;
108
- }
109
-
110
- const childChainInfo = getChainInfo(b.configObj);
111
- if (childChainInfo.host !== 'none') {
112
- childChainHost = childChainInfo.host;
113
- }
114
- });
115
-
116
- return childChainHost || 'none';
95
+ return getBlockletChainInfo(blocklet).host;
117
96
  };
118
97
 
119
98
  const migrateAppOnChain = async (blocklet, oldSk, newSk) => {
@@ -19,13 +19,13 @@ const semver = require('semver');
19
19
  const axios = require('@abtnode/util/lib/axios');
20
20
  const { stableStringify } = require('@arcblock/vc');
21
21
 
22
- const { fromSecretKey, WalletType } = require('@ocap/wallet');
22
+ const { fromSecretKey } = require('@ocap/wallet');
23
23
  const { toHex, toBase58, isHex, toDid } = require('@ocap/util');
24
- const { types } = require('@ocap/mcrypto');
25
24
  const { isValid: isValidDid, isEthereumDid } = require('@arcblock/did');
26
25
  const logger = require('@abtnode/logger')('@abtnode/core:util:blocklet');
27
26
  const pm2 = require('@abtnode/util/lib/async-pm2');
28
27
  const sleep = require('@abtnode/util/lib/sleep');
28
+ const getNodeWallet = require('@abtnode/util/lib/get-app-wallet');
29
29
  const { formatEnv } = require('@abtnode/util/lib/security');
30
30
  const ensureEndpointHealthy = require('@abtnode/util/lib/ensure-endpoint-healthy');
31
31
  const CustomError = require('@abtnode/util/lib/custom-error');
@@ -1508,12 +1508,7 @@ const consumeServerlessNFT = async ({ nftId, nodeInfo, blocklet }) => {
1508
1508
  throw new Error(`get nft state failed, chainHost: ${blocklet.controller.chainHost}, nftId: ${nftId}`);
1509
1509
  }
1510
1510
 
1511
- const type = WalletType({
1512
- role: types.RoleType.ROLE_APPLICATION,
1513
- pk: types.KeyType.ED25519,
1514
- hash: types.HashType.SHA3,
1515
- });
1516
- const wallet = fromSecretKey(nodeInfo.sk, type);
1511
+ const wallet = getNodeWallet(nodeInfo.sk);
1517
1512
  const appURL = blocklet.environments.find((item) => item.key === 'BLOCKLET_APP_URL').value;
1518
1513
 
1519
1514
  const body = { nftId, appURL };
package/lib/util/store.js CHANGED
@@ -5,6 +5,7 @@ const isBase64 = require('is-base64');
5
5
  const { BLOCKLET_STORE_API_PREFIX, BLOCKLET_STORE_META_PATH } = require('@abtnode/constant');
6
6
  const { validateMeta, fixAndValidateService } = require('@blocklet/meta/lib/validate');
7
7
  const verifyMultiSig = require('@blocklet/meta/lib/verify-multi-sig');
8
+ const isRequirementsSatisfied = require('./requirement');
8
9
 
9
10
  const { name } = require('../../package.json');
10
11
  const logger = require('@abtnode/logger')(`${name}:util:registry`); // eslint-disable-line
@@ -14,6 +15,8 @@ const request = require('./request');
14
15
  const fixAndVerifyMetaFromStore = (meta) => {
15
16
  const sanitized = validateMeta(meta, { ensureDist: false, schemaOptions: { noDefaults: true, stripUnknown: true } });
16
17
 
18
+ isRequirementsSatisfied(meta.requirements);
19
+
17
20
  if (meta.children) {
18
21
  sanitized.children = meta.children;
19
22
  delete sanitized.components;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.0",
6
+ "version": "1.16.1-beta-cd775909",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -19,18 +19,18 @@
19
19
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@abtnode/auth": "1.16.0",
23
- "@abtnode/certificate-manager": "1.16.0",
24
- "@abtnode/constant": "1.16.0",
25
- "@abtnode/cron": "1.16.0",
26
- "@abtnode/db": "1.16.0",
27
- "@abtnode/logger": "1.16.0",
28
- "@abtnode/queue": "1.16.0",
29
- "@abtnode/rbac": "1.16.0",
30
- "@abtnode/router-provider": "1.16.0",
31
- "@abtnode/static-server": "1.16.0",
32
- "@abtnode/timemachine": "1.16.0",
33
- "@abtnode/util": "1.16.0",
22
+ "@abtnode/auth": "1.16.1-beta-cd775909",
23
+ "@abtnode/certificate-manager": "1.16.1-beta-cd775909",
24
+ "@abtnode/constant": "1.16.1-beta-cd775909",
25
+ "@abtnode/cron": "1.16.1-beta-cd775909",
26
+ "@abtnode/db": "1.16.1-beta-cd775909",
27
+ "@abtnode/logger": "1.16.1-beta-cd775909",
28
+ "@abtnode/queue": "1.16.1-beta-cd775909",
29
+ "@abtnode/rbac": "1.16.1-beta-cd775909",
30
+ "@abtnode/router-provider": "1.16.1-beta-cd775909",
31
+ "@abtnode/static-server": "1.16.1-beta-cd775909",
32
+ "@abtnode/timemachine": "1.16.1-beta-cd775909",
33
+ "@abtnode/util": "1.16.1-beta-cd775909",
34
34
  "@arcblock/did": "1.18.65",
35
35
  "@arcblock/did-motif": "^1.1.10",
36
36
  "@arcblock/did-util": "1.18.65",
@@ -38,9 +38,9 @@
38
38
  "@arcblock/jwt": "^1.18.65",
39
39
  "@arcblock/pm2-events": "^0.0.5",
40
40
  "@arcblock/vc": "1.18.65",
41
- "@blocklet/constant": "1.16.0",
42
- "@blocklet/meta": "1.16.0",
43
- "@blocklet/sdk": "1.16.0",
41
+ "@blocklet/constant": "1.16.1-beta-cd775909",
42
+ "@blocklet/meta": "1.16.1-beta-cd775909",
43
+ "@blocklet/sdk": "1.16.1-beta-cd775909",
44
44
  "@did-space/client": "^0.2.45",
45
45
  "@fidm/x509": "^1.2.1",
46
46
  "@ocap/client": "1.18.65",
@@ -91,5 +91,5 @@
91
91
  "express": "^4.18.2",
92
92
  "jest": "^27.5.1"
93
93
  },
94
- "gitHead": "da461546c6db9c7d347689708af27654c17ac28e"
94
+ "gitHead": "9fd68e48cd87d5d8feafcf37dac1b586c1dccd8f"
95
95
  }