Compare commits

..

No commits in common. "v0.1.0-develop.15" and "v0.1.0-develop.14" have entirely different histories.

4 changed files with 16 additions and 33 deletions

View File

@ -1,10 +1,3 @@
# [0.1.0-develop.15](https://git.lumeweb.com/LumeWeb/publish-kernel-module/compare/v0.1.0-develop.14...v0.1.0-develop.15) (2023-09-02)
### Bug Fixes
* only submit a new registry entry if the data has changed ([39b0117](https://git.lumeweb.com/LumeWeb/publish-kernel-module/commit/39b0117e4f02550c9ac7b58961e83b2e82757b41))
# [0.1.0-develop.14](https://git.lumeweb.com/LumeWeb/publish-kernel-module/compare/v0.1.0-develop.13...v0.1.0-develop.14) (2023-09-02) # [0.1.0-develop.14](https://git.lumeweb.com/LumeWeb/publish-kernel-module/compare/v0.1.0-develop.13...v0.1.0-develop.14) (2023-09-02)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@lumeweb/publish-kernel-module", "name": "@lumeweb/publish-kernel-module",
"version": "0.1.0-develop.15", "version": "0.1.0-develop.14",
"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.15", "version": "0.1.0-develop.14",
"dependencies": { "dependencies": {
"@lumeweb/libweb": "0.2.0-develop.36", "@lumeweb/libweb": "0.2.0-develop.36",
"@scure/bip39": "^1.2.1", "@scure/bip39": "^1.2.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@lumeweb/publish-kernel-module", "name": "@lumeweb/publish-kernel-module",
"version": "0.1.0-develop.15", "version": "0.1.0-develop.14",
"type": "module", "type": "module",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -6,7 +6,6 @@ import fs from "fs/promises";
import path from "path"; import path from "path";
import { import {
concatBytes, concatBytes,
equalBytes,
hexToBytes, hexToBytes,
maybeInitDefaultPortals, maybeInitDefaultPortals,
setActivePortalMasterKey, setActivePortalMasterKey,
@ -28,7 +27,6 @@ import {
Logger, Logger,
REGISTRY_TYPES, REGISTRY_TYPES,
S5NodeConfig, S5NodeConfig,
SignedRegistryEntry,
} from "@lumeweb/libs5"; } from "@lumeweb/libs5";
import { MemoryLevel } from "memory-level"; import { MemoryLevel } from "memory-level";
@ -164,7 +162,6 @@ await peerDefer.promise;
const key = hdKey as HDKey; const key = hdKey as HDKey;
let revision = 0; let revision = 0;
let sre: SignedRegistryEntry;
const ret = await node.services.registry.get( const ret = await node.services.registry.get(
new KeyPairEd25519(key.privateKey).publicKey, new KeyPairEd25519(key.privateKey).publicKey,
@ -173,27 +170,20 @@ await peerDefer.promise;
if (ret) { if (ret) {
revision = ret.revision + 1; revision = ret.revision + 1;
} }
const sre = node.services.registry.signRegistryEntry({
kp: new KeyPairEd25519((hdKey as HDKey).privateKey),
data: concatBytes(
Uint8Array.from([
REGISTRY_TYPES.CID,
CID_TYPES.RESOLVER,
CID_HASH_TYPES.BLAKE3,
]),
cidBytes,
),
revision,
});
const newEntry = concatBytes( await node.services.registry.set(sre);
Uint8Array.from([
REGISTRY_TYPES.CID,
CID_TYPES.RESOLVER,
CID_HASH_TYPES.BLAKE3,
]),
cidBytes,
);
if (!equalBytes(ret?.data ?? new Uint8Array(), newEntry)) {
sre = node.services.registry.signRegistryEntry({
kp: new KeyPairEd25519((hdKey as HDKey).privateKey),
data: newEntry,
revision,
});
await node.services.registry.set(sre);
} else {
sre = ret as SignedRegistryEntry;
}
console.log( console.log(
util.format( util.format(