Compare commits

..

No commits in common. "v0.1.0-develop.20" and "v0.1.0-develop.19" have entirely different histories.

4 changed files with 37 additions and 54 deletions

View File

@ -1,5 +1,3 @@
# [0.1.0-develop.20](https://git.lumeweb.com/LumeWeb/publish-kernel-module/compare/v0.1.0-develop.19...v0.1.0-develop.20) (2023-09-11)
# [0.1.0-develop.19](https://git.lumeweb.com/LumeWeb/publish-kernel-module/compare/v0.1.0-develop.18...v0.1.0-develop.19) (2023-09-04) # [0.1.0-develop.19](https://git.lumeweb.com/LumeWeb/publish-kernel-module/compare/v0.1.0-develop.18...v0.1.0-develop.19) (2023-09-04)
# [0.1.0-develop.18](https://git.lumeweb.com/LumeWeb/publish-kernel-module/compare/v0.1.0-develop.17...v0.1.0-develop.18) (2023-09-04) # [0.1.0-develop.18](https://git.lumeweb.com/LumeWeb/publish-kernel-module/compare/v0.1.0-develop.17...v0.1.0-develop.18) (2023-09-04)

49
npm-shrinkwrap.json generated
View File

@ -1,14 +1,14 @@
{ {
"name": "@lumeweb/publish-kernel-module", "name": "@lumeweb/publish-kernel-module",
"version": "0.1.0-develop.20", "version": "0.1.0-develop.19",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lumeweb/publish-kernel-module", "name": "@lumeweb/publish-kernel-module",
"version": "0.1.0-develop.20", "version": "0.1.0-develop.19",
"dependencies": { "dependencies": {
"@lumeweb/libweb": "0.2.0-develop.58", "@lumeweb/libweb": "0.2.0-develop.48",
"@scure/bip39": "^1.2.1", "@scure/bip39": "^1.2.1",
"chalk": "^5.2.0", "chalk": "^5.2.0",
"ed25519-keygen": "^0.4.8", "ed25519-keygen": "^0.4.8",
@ -1911,11 +1911,11 @@
} }
}, },
"node_modules/@lumeweb/libportal": { "node_modules/@lumeweb/libportal": {
"version": "0.2.0-develop.38", "version": "0.2.0-develop.23",
"resolved": "https://registry.npmjs.org/@lumeweb/libportal/-/libportal-0.2.0-develop.38.tgz", "resolved": "https://registry.npmjs.org/@lumeweb/libportal/-/libportal-0.2.0-develop.23.tgz",
"integrity": "sha512-ST6zc6MgXloLbnwbQZh4wGydOr9R3pR4AkPhZjCcn9tdhuMmTMJiEK5SLJ06Tl7dR9n/GX4lMVLlNVNRjvvcmQ==", "integrity": "sha512-KN7KqFu5I+aYDeOL8hhaw1sjFjof8TrrPRvbdGmlQ7RDgkRbqiOQ8LQx2zPteBJPPGJfOtrnWWygBqy9wjuiaw==",
"dependencies": { "dependencies": {
"@lumeweb/libs5": "^0.1.0-develop.59", "@lumeweb/libs5": "^0.1.0-develop.44",
"@noble/curves": "^1.1.0", "@noble/curves": "^1.1.0",
"@noble/hashes": "^1.3.1", "@noble/hashes": "^1.3.1",
"detect-node": "^2.1.0", "detect-node": "^2.1.0",
@ -1928,9 +1928,9 @@
} }
}, },
"node_modules/@lumeweb/libs5": { "node_modules/@lumeweb/libs5": {
"version": "0.1.0-develop.59", "version": "0.1.0-develop.44",
"resolved": "https://registry.npmjs.org/@lumeweb/libs5/-/libs5-0.1.0-develop.59.tgz", "resolved": "https://registry.npmjs.org/@lumeweb/libs5/-/libs5-0.1.0-develop.44.tgz",
"integrity": "sha512-O/sbv77MrNLQrGYkpXoEV8Pwe3wHoewXRa51ivTGa4GQKbihtmLThcCo6ZnxUQoWNjgx8yUmT5G29pPZqxjcww==", "integrity": "sha512-BR/pII6v9i556tPBSDYUBszhFvSyQq+/Ptuopk7JIoRSqFzSsXWL0RteBi6v0qQzEffft7kOhaI1dLFOGZvWVQ==",
"dependencies": { "dependencies": {
"@noble/curves": "^1.1.0", "@noble/curves": "^1.1.0",
"@noble/hashes": "^1.3.1", "@noble/hashes": "^1.3.1",
@ -1942,23 +1942,22 @@
} }
}, },
"node_modules/@lumeweb/libs5/node_modules/multiformats": { "node_modules/@lumeweb/libs5/node_modules/multiformats": {
"version": "12.1.1", "version": "12.1.0",
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.1.tgz", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.0.tgz",
"integrity": "sha512-GBSToTmri2vJYs8wqcZQ8kB21dCaeTOzHTIAlr8J06C1eL6UbzqURXFZ5Fl0EYm9GAFz1IlYY8SxGOs9G9NJRg==", "integrity": "sha512-/qTOKKnU8nwcVURjRcS+UN0QYgdS5BPZzY10Aiciu2SqncyCVMGV8KtD83EBFmsuJDsSEmT4sGvzcTkCoMw0sQ==",
"engines": { "engines": {
"node": ">=16.0.0", "node": ">=16.0.0",
"npm": ">=7.0.0" "npm": ">=7.0.0"
} }
}, },
"node_modules/@lumeweb/libweb": { "node_modules/@lumeweb/libweb": {
"version": "0.2.0-develop.58", "version": "0.2.0-develop.48",
"resolved": "https://registry.npmjs.org/@lumeweb/libweb/-/libweb-0.2.0-develop.58.tgz", "resolved": "https://registry.npmjs.org/@lumeweb/libweb/-/libweb-0.2.0-develop.48.tgz",
"integrity": "sha512-VObSCNXITDdqMIFGaBIOewx59ZEf8FNf0mnVrdKY5LdjDCg+ZLRskGyf8PQYOx30enT9v6yWFlD6Lu7XzjfyGQ==", "integrity": "sha512-4hznd3BrYW+YFLJ8BgGDVrJuexQnKfRRlLPM+KYDFsDwu4lhoGUDonVt0gk5KBAVlUp4x6XJxXc82aYn4rhECQ==",
"dependencies": { "dependencies": {
"@lumeweb/community-portals": "^0.1.0-develop.6", "@lumeweb/community-portals": "^0.1.0-develop.6",
"@lumeweb/libportal": "0.2.0-develop.38", "@lumeweb/libportal": "0.2.0-develop.23",
"@lumeweb/node-library-preset": "0.2.7", "@lumeweb/node-library-preset": "0.2.7",
"@noble/ciphers": "^0.3.0",
"@noble/curves": "^1.1.0", "@noble/curves": "^1.1.0",
"@noble/hashes": "^1.3.1", "@noble/hashes": "^1.3.1",
"binconv": "^0.2.0" "binconv": "^0.2.0"
@ -1976,14 +1975,6 @@
"semantic-release": "^21.0.5" "semantic-release": "^21.0.5"
} }
}, },
"node_modules/@noble/ciphers": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.3.0.tgz",
"integrity": "sha512-ldbrnOjmNRwFdXcTM6uXDcxpMIFrbzAWNnpBPp4oTJTFF0XByGD6vf45WrehZGXRQTRVV+Zm8YP+EgEf+e4cWA==",
"funding": {
"url": "https://paulmillr.com/funding/"
}
},
"node_modules/@noble/curves": { "node_modules/@noble/curves": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz",
@ -19107,9 +19098,9 @@
} }
}, },
"node_modules/ws": { "node_modules/ws": {
"version": "8.14.1", "version": "8.13.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.14.1.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz",
"integrity": "sha512-4OOseMUq8AzRBI/7SLMUwO+FEDnguetSk7KMb1sHwvF2w2Wv5Hoj0nlifx8vtGsftE/jWHojPy8sMMzYLJ2G/A==", "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==",
"engines": { "engines": {
"node": ">=10.0.0" "node": ">=10.0.0"
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "@lumeweb/publish-kernel-module", "name": "@lumeweb/publish-kernel-module",
"version": "0.1.0-develop.20", "version": "0.1.0-develop.19",
"type": "module", "type": "module",
"repository": { "repository": {
"type": "git", "type": "git",
@ -24,7 +24,7 @@
"lib/**" "lib/**"
], ],
"dependencies": { "dependencies": {
"@lumeweb/libweb": "0.2.0-develop.58", "@lumeweb/libweb": "0.2.0-develop.48",
"@scure/bip39": "^1.2.1", "@scure/bip39": "^1.2.1",
"chalk": "^5.2.0", "chalk": "^5.2.0",
"ed25519-keygen": "^0.4.8", "ed25519-keygen": "^0.4.8",

View File

@ -5,6 +5,8 @@ import * as process from "process";
import fs from "fs/promises"; import fs from "fs/promises";
import path from "path"; import path from "path";
import { import {
encodeRegistryCid,
encodeRegistryValue,
equalBytes, equalBytes,
hexToBytes, hexToBytes,
maybeInitDefaultPortals, maybeInitDefaultPortals,
@ -20,7 +22,6 @@ import { HDKey } from "ed25519-keygen/hdkey";
import { import {
BOOTSTRAP_NODES, BOOTSTRAP_NODES,
CID,
createKeyPair, createKeyPair,
createNode, createNode,
S5NodeConfig, S5NodeConfig,
@ -107,16 +108,13 @@ maybeInitDefaultPortals();
const fd = await fs.open(file as string); const fd = await fs.open(file as string);
let cid; const [cid, err] = await uploadObject(
try {
cid = await uploadObject(
fd.createReadStream(), fd.createReadStream(),
BigInt((await fd.stat()).size), BigInt((await fd.stat()).size),
); );
} catch (e) {
console.error("Failed to publish: ", e.message); if (err) {
process.exit(); console.error("Failed to publish: ", err);
} }
console.log( console.log(
@ -176,12 +174,10 @@ await peerDefer.promise;
revision = ret.revision + 1; revision = ret.revision + 1;
} }
let newEntry; let [newEntry, err] = encodeRegistryValue(cid);
try {
newEntry = CID.decode(cid).toRegistryEntry(); if (err) {
} catch (e) { throw new Error(err);
console.error("Failed to publish: ", e.message);
process.exit();
} }
if (!equalBytes(ret?.data ?? new Uint8Array(), newEntry)) { if (!equalBytes(ret?.data ?? new Uint8Array(), newEntry)) {
@ -197,12 +193,10 @@ await peerDefer.promise;
} }
let resolverCid; let resolverCid;
[resolverCid, err] = encodeRegistryCid(sre.pk);
try { if (err) {
resolverCid = CID.fromRegistryPublicKey(sre.pk); throw new Error(err);
} catch (e) {
console.error("Failed to publish: ", e.message);
process.exit();
} }
console.log( console.log(