Compare commits
No commits in common. "v0.1.0-develop.20" and "v0.1.0-develop.19" have entirely different histories.
v0.1.0-dev
...
v0.1.0-dev
|
@ -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.18](https://git.lumeweb.com/LumeWeb/publish-kernel-module/compare/v0.1.0-develop.17...v0.1.0-develop.18) (2023-09-04)
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
"name": "@lumeweb/publish-kernel-module",
|
||||
"version": "0.1.0-develop.20",
|
||||
"version": "0.1.0-develop.19",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@lumeweb/publish-kernel-module",
|
||||
"version": "0.1.0-develop.20",
|
||||
"version": "0.1.0-develop.19",
|
||||
"dependencies": {
|
||||
"@lumeweb/libweb": "0.2.0-develop.58",
|
||||
"@lumeweb/libweb": "0.2.0-develop.48",
|
||||
"@scure/bip39": "^1.2.1",
|
||||
"chalk": "^5.2.0",
|
||||
"ed25519-keygen": "^0.4.8",
|
||||
|
@ -1911,11 +1911,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@lumeweb/libportal": {
|
||||
"version": "0.2.0-develop.38",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libportal/-/libportal-0.2.0-develop.38.tgz",
|
||||
"integrity": "sha512-ST6zc6MgXloLbnwbQZh4wGydOr9R3pR4AkPhZjCcn9tdhuMmTMJiEK5SLJ06Tl7dR9n/GX4lMVLlNVNRjvvcmQ==",
|
||||
"version": "0.2.0-develop.23",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libportal/-/libportal-0.2.0-develop.23.tgz",
|
||||
"integrity": "sha512-KN7KqFu5I+aYDeOL8hhaw1sjFjof8TrrPRvbdGmlQ7RDgkRbqiOQ8LQx2zPteBJPPGJfOtrnWWygBqy9wjuiaw==",
|
||||
"dependencies": {
|
||||
"@lumeweb/libs5": "^0.1.0-develop.59",
|
||||
"@lumeweb/libs5": "^0.1.0-develop.44",
|
||||
"@noble/curves": "^1.1.0",
|
||||
"@noble/hashes": "^1.3.1",
|
||||
"detect-node": "^2.1.0",
|
||||
|
@ -1928,9 +1928,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@lumeweb/libs5": {
|
||||
"version": "0.1.0-develop.59",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libs5/-/libs5-0.1.0-develop.59.tgz",
|
||||
"integrity": "sha512-O/sbv77MrNLQrGYkpXoEV8Pwe3wHoewXRa51ivTGa4GQKbihtmLThcCo6ZnxUQoWNjgx8yUmT5G29pPZqxjcww==",
|
||||
"version": "0.1.0-develop.44",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libs5/-/libs5-0.1.0-develop.44.tgz",
|
||||
"integrity": "sha512-BR/pII6v9i556tPBSDYUBszhFvSyQq+/Ptuopk7JIoRSqFzSsXWL0RteBi6v0qQzEffft7kOhaI1dLFOGZvWVQ==",
|
||||
"dependencies": {
|
||||
"@noble/curves": "^1.1.0",
|
||||
"@noble/hashes": "^1.3.1",
|
||||
|
@ -1942,23 +1942,22 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@lumeweb/libs5/node_modules/multiformats": {
|
||||
"version": "12.1.1",
|
||||
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.1.tgz",
|
||||
"integrity": "sha512-GBSToTmri2vJYs8wqcZQ8kB21dCaeTOzHTIAlr8J06C1eL6UbzqURXFZ5Fl0EYm9GAFz1IlYY8SxGOs9G9NJRg==",
|
||||
"version": "12.1.0",
|
||||
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.0.tgz",
|
||||
"integrity": "sha512-/qTOKKnU8nwcVURjRcS+UN0QYgdS5BPZzY10Aiciu2SqncyCVMGV8KtD83EBFmsuJDsSEmT4sGvzcTkCoMw0sQ==",
|
||||
"engines": {
|
||||
"node": ">=16.0.0",
|
||||
"npm": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@lumeweb/libweb": {
|
||||
"version": "0.2.0-develop.58",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libweb/-/libweb-0.2.0-develop.58.tgz",
|
||||
"integrity": "sha512-VObSCNXITDdqMIFGaBIOewx59ZEf8FNf0mnVrdKY5LdjDCg+ZLRskGyf8PQYOx30enT9v6yWFlD6Lu7XzjfyGQ==",
|
||||
"version": "0.2.0-develop.48",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libweb/-/libweb-0.2.0-develop.48.tgz",
|
||||
"integrity": "sha512-4hznd3BrYW+YFLJ8BgGDVrJuexQnKfRRlLPM+KYDFsDwu4lhoGUDonVt0gk5KBAVlUp4x6XJxXc82aYn4rhECQ==",
|
||||
"dependencies": {
|
||||
"@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",
|
||||
"@noble/ciphers": "^0.3.0",
|
||||
"@noble/curves": "^1.1.0",
|
||||
"@noble/hashes": "^1.3.1",
|
||||
"binconv": "^0.2.0"
|
||||
|
@ -1976,14 +1975,6 @@
|
|||
"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": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz",
|
||||
|
@ -19107,9 +19098,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/ws": {
|
||||
"version": "8.14.1",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.14.1.tgz",
|
||||
"integrity": "sha512-4OOseMUq8AzRBI/7SLMUwO+FEDnguetSk7KMb1sHwvF2w2Wv5Hoj0nlifx8vtGsftE/jWHojPy8sMMzYLJ2G/A==",
|
||||
"version": "8.13.0",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz",
|
||||
"integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==",
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@lumeweb/publish-kernel-module",
|
||||
"version": "0.1.0-develop.20",
|
||||
"version": "0.1.0-develop.19",
|
||||
"type": "module",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -24,7 +24,7 @@
|
|||
"lib/**"
|
||||
],
|
||||
"dependencies": {
|
||||
"@lumeweb/libweb": "0.2.0-develop.58",
|
||||
"@lumeweb/libweb": "0.2.0-develop.48",
|
||||
"@scure/bip39": "^1.2.1",
|
||||
"chalk": "^5.2.0",
|
||||
"ed25519-keygen": "^0.4.8",
|
||||
|
|
34
src/index.ts
34
src/index.ts
|
@ -5,6 +5,8 @@ import * as process from "process";
|
|||
import fs from "fs/promises";
|
||||
import path from "path";
|
||||
import {
|
||||
encodeRegistryCid,
|
||||
encodeRegistryValue,
|
||||
equalBytes,
|
||||
hexToBytes,
|
||||
maybeInitDefaultPortals,
|
||||
|
@ -20,7 +22,6 @@ import { HDKey } from "ed25519-keygen/hdkey";
|
|||
|
||||
import {
|
||||
BOOTSTRAP_NODES,
|
||||
CID,
|
||||
createKeyPair,
|
||||
createNode,
|
||||
S5NodeConfig,
|
||||
|
@ -107,16 +108,13 @@ maybeInitDefaultPortals();
|
|||
|
||||
const fd = await fs.open(file as string);
|
||||
|
||||
let cid;
|
||||
|
||||
try {
|
||||
cid = await uploadObject(
|
||||
const [cid, err] = await uploadObject(
|
||||
fd.createReadStream(),
|
||||
BigInt((await fd.stat()).size),
|
||||
);
|
||||
} catch (e) {
|
||||
console.error("Failed to publish: ", e.message);
|
||||
process.exit();
|
||||
);
|
||||
|
||||
if (err) {
|
||||
console.error("Failed to publish: ", err);
|
||||
}
|
||||
|
||||
console.log(
|
||||
|
@ -176,12 +174,10 @@ await peerDefer.promise;
|
|||
revision = ret.revision + 1;
|
||||
}
|
||||
|
||||
let newEntry;
|
||||
try {
|
||||
newEntry = CID.decode(cid).toRegistryEntry();
|
||||
} catch (e) {
|
||||
console.error("Failed to publish: ", e.message);
|
||||
process.exit();
|
||||
let [newEntry, err] = encodeRegistryValue(cid);
|
||||
|
||||
if (err) {
|
||||
throw new Error(err);
|
||||
}
|
||||
|
||||
if (!equalBytes(ret?.data ?? new Uint8Array(), newEntry)) {
|
||||
|
@ -197,12 +193,10 @@ await peerDefer.promise;
|
|||
}
|
||||
|
||||
let resolverCid;
|
||||
[resolverCid, err] = encodeRegistryCid(sre.pk);
|
||||
|
||||
try {
|
||||
resolverCid = CID.fromRegistryPublicKey(sre.pk);
|
||||
} catch (e) {
|
||||
console.error("Failed to publish: ", e.message);
|
||||
process.exit();
|
||||
if (err) {
|
||||
throw new Error(err);
|
||||
}
|
||||
|
||||
console.log(
|
||||
|
|
Loading…
Reference in New Issue