@abtnode/core 1.16.17-beta-7ec31a60 → 1.16.17-beta-0213b250
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.
|
@@ -3432,6 +3432,7 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
3432
3432
|
await updateBlockletDocument({
|
|
3433
3433
|
blocklet,
|
|
3434
3434
|
nodeInfo,
|
|
3435
|
+
states,
|
|
3435
3436
|
});
|
|
3436
3437
|
logger.info('updated blocklet dns document', { appPid: blocklet.appPid, appDid: blocklet.appDid });
|
|
3437
3438
|
}
|
|
@@ -2,7 +2,7 @@ const { sign } = require('@arcblock/jwt');
|
|
|
2
2
|
|
|
3
3
|
const logger = require('@abtnode/logger')('@abtnode/core:install-component-url');
|
|
4
4
|
|
|
5
|
-
const { isFreeBlocklet
|
|
5
|
+
const { isFreeBlocklet } = require('@blocklet/meta/lib/util');
|
|
6
6
|
const { titleSchema } = require('@blocklet/meta/lib/schema');
|
|
7
7
|
const hasReservedKey = require('@blocklet/meta/lib/has-reserved-key');
|
|
8
8
|
|
|
@@ -66,14 +66,6 @@ const installComponentFromUrl = async ({
|
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
if (!isComponentBlocklet(meta)) {
|
|
70
|
-
throw new Error(
|
|
71
|
-
`The blocklet cannot be a component : ${
|
|
72
|
-
meta.title || meta.name
|
|
73
|
-
}. The reason may be that the developer set capabilities.component to false in blocklet.yml`
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
69
|
if (title) {
|
|
78
70
|
meta.title = await titleSchema.validateAsync(title);
|
|
79
71
|
}
|
package/lib/router/helper.js
CHANGED
|
@@ -984,6 +984,7 @@ module.exports = function getRouterHelpers({ dataDirs, routingSnapshot, routerMa
|
|
|
984
984
|
updateBlockletDocument({
|
|
985
985
|
blocklet,
|
|
986
986
|
nodeInfo,
|
|
987
|
+
states,
|
|
987
988
|
})
|
|
988
989
|
.then(() => {
|
|
989
990
|
logger.info(`updated blocklet ${blocklet.appDid} dns`);
|
|
@@ -1209,6 +1210,8 @@ module.exports = function getRouterHelpers({ dataDirs, routingSnapshot, routerMa
|
|
|
1209
1210
|
|
|
1210
1211
|
const providers = {}; // we need to keep reference for different router instances
|
|
1211
1212
|
const handleRouting = async (nodeInfo) => {
|
|
1213
|
+
const now = Date.now();
|
|
1214
|
+
logger.info('start handle routing');
|
|
1212
1215
|
const providerName = get(nodeInfo, 'routing.provider', null);
|
|
1213
1216
|
const httpsEnabled = get(nodeInfo, 'routing.https', true);
|
|
1214
1217
|
logger.debug('handle routing', { providerName, httpsEnabled });
|
|
@@ -1272,6 +1275,8 @@ module.exports = function getRouterHelpers({ dataDirs, routingSnapshot, routerMa
|
|
|
1272
1275
|
|
|
1273
1276
|
await providers[providerName].start();
|
|
1274
1277
|
}
|
|
1278
|
+
|
|
1279
|
+
logger.info('done handle routing', { cost: Date.now() - now });
|
|
1275
1280
|
};
|
|
1276
1281
|
|
|
1277
1282
|
const rotateRouterLog = async () => {
|
package/lib/util/blocklet.js
CHANGED
|
@@ -1803,12 +1803,12 @@ const getComponentNamesWithVersion = (app = {}, componentDids = []) => {
|
|
|
1803
1803
|
return str;
|
|
1804
1804
|
};
|
|
1805
1805
|
|
|
1806
|
-
const shouldEnableSlpDomain = ({ mode, launcher,
|
|
1806
|
+
const shouldEnableSlpDomain = ({ mode, launcher, blockletController }) => {
|
|
1807
1807
|
if (process.env.NODE_ENV === 'development' && process.env.ABT_NODE_ENABLE_SLP_DOMAIN === 'true') {
|
|
1808
1808
|
return true;
|
|
1809
1809
|
}
|
|
1810
1810
|
|
|
1811
|
-
return mode === NODE_MODES.SERVERLESS && !!launcher && !!
|
|
1811
|
+
return mode === NODE_MODES.SERVERLESS && !!launcher && !!blockletController;
|
|
1812
1812
|
};
|
|
1813
1813
|
|
|
1814
1814
|
const getSlpDid = (serverDid, appPid) => {
|
|
@@ -1824,13 +1824,15 @@ const getSlpDid = (serverDid, appPid) => {
|
|
|
1824
1824
|
};
|
|
1825
1825
|
|
|
1826
1826
|
// eslint-disable-next-line require-await
|
|
1827
|
-
const updateDidDocument = async ({ blocklet, nodeInfo }) => {
|
|
1827
|
+
const updateDidDocument = async ({ blocklet, nodeInfo, states }) => {
|
|
1828
1828
|
const alsoKnownAs = getBlockletKnownAs(blocklet);
|
|
1829
1829
|
const { wallet } = getBlockletInfo(blocklet, nodeInfo.sk);
|
|
1830
1830
|
const { mode, launcher, did: serverDid } = nodeInfo;
|
|
1831
1831
|
|
|
1832
1832
|
let slpDid = null;
|
|
1833
|
-
const
|
|
1833
|
+
const blockletExtra = await states.blockletExtras.getMeta(blocklet.meta.did);
|
|
1834
|
+
const blockletController = blockletExtra?.controller;
|
|
1835
|
+
const enableSlpDomain = shouldEnableSlpDomain({ mode, launcher, blockletController });
|
|
1834
1836
|
if (enableSlpDomain) {
|
|
1835
1837
|
slpDid = getSlpDid(serverDid, blocklet.appPid);
|
|
1836
1838
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.17-beta-
|
|
6
|
+
"version": "1.16.17-beta-0213b250",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -19,19 +19,19 @@
|
|
|
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.17-beta-
|
|
23
|
-
"@abtnode/auth": "1.16.17-beta-
|
|
24
|
-
"@abtnode/certificate-manager": "1.16.17-beta-
|
|
25
|
-
"@abtnode/constant": "1.16.17-beta-
|
|
26
|
-
"@abtnode/cron": "1.16.17-beta-
|
|
27
|
-
"@abtnode/logger": "1.16.17-beta-
|
|
28
|
-
"@abtnode/models": "1.16.17-beta-
|
|
29
|
-
"@abtnode/queue": "1.16.17-beta-
|
|
30
|
-
"@abtnode/rbac": "1.16.17-beta-
|
|
31
|
-
"@abtnode/router-provider": "1.16.17-beta-
|
|
32
|
-
"@abtnode/static-server": "1.16.17-beta-
|
|
33
|
-
"@abtnode/timemachine": "1.16.17-beta-
|
|
34
|
-
"@abtnode/util": "1.16.17-beta-
|
|
22
|
+
"@abtnode/analytics": "1.16.17-beta-0213b250",
|
|
23
|
+
"@abtnode/auth": "1.16.17-beta-0213b250",
|
|
24
|
+
"@abtnode/certificate-manager": "1.16.17-beta-0213b250",
|
|
25
|
+
"@abtnode/constant": "1.16.17-beta-0213b250",
|
|
26
|
+
"@abtnode/cron": "1.16.17-beta-0213b250",
|
|
27
|
+
"@abtnode/logger": "1.16.17-beta-0213b250",
|
|
28
|
+
"@abtnode/models": "1.16.17-beta-0213b250",
|
|
29
|
+
"@abtnode/queue": "1.16.17-beta-0213b250",
|
|
30
|
+
"@abtnode/rbac": "1.16.17-beta-0213b250",
|
|
31
|
+
"@abtnode/router-provider": "1.16.17-beta-0213b250",
|
|
32
|
+
"@abtnode/static-server": "1.16.17-beta-0213b250",
|
|
33
|
+
"@abtnode/timemachine": "1.16.17-beta-0213b250",
|
|
34
|
+
"@abtnode/util": "1.16.17-beta-0213b250",
|
|
35
35
|
"@arcblock/did": "1.18.91",
|
|
36
36
|
"@arcblock/did-auth": "1.18.91",
|
|
37
37
|
"@arcblock/did-ext": "^1.18.91",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"@arcblock/pm2-events": "^0.0.5",
|
|
43
43
|
"@arcblock/validator": "^1.18.91",
|
|
44
44
|
"@arcblock/vc": "1.18.91",
|
|
45
|
-
"@blocklet/constant": "1.16.17-beta-
|
|
46
|
-
"@blocklet/env": "1.16.17-beta-
|
|
47
|
-
"@blocklet/meta": "1.16.17-beta-
|
|
48
|
-
"@blocklet/resolver": "1.16.17-beta-
|
|
49
|
-
"@blocklet/sdk": "1.16.17-beta-
|
|
45
|
+
"@blocklet/constant": "1.16.17-beta-0213b250",
|
|
46
|
+
"@blocklet/env": "1.16.17-beta-0213b250",
|
|
47
|
+
"@blocklet/meta": "1.16.17-beta-0213b250",
|
|
48
|
+
"@blocklet/resolver": "1.16.17-beta-0213b250",
|
|
49
|
+
"@blocklet/sdk": "1.16.17-beta-0213b250",
|
|
50
50
|
"@did-space/client": "^0.3.8",
|
|
51
51
|
"@fidm/x509": "^1.2.1",
|
|
52
52
|
"@ocap/mcrypto": "1.18.91",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"jest": "^27.5.1",
|
|
102
102
|
"unzipper": "^0.10.11"
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "46a135c2ac17e4c8e8c4d75b35fec561792a637f"
|
|
105
105
|
}
|