Compare commits

..

No commits in common. "v0.1.0-develop.9" and "v0.1.0-develop.8" have entirely different histories.

6 changed files with 15 additions and 28 deletions

View File

@ -1,11 +1,3 @@
# [0.1.0-develop.9](https://git.lumeweb.com/LumeWeb/kernel/compare/v0.1.0-develop.8...v0.1.0-develop.9) (2023-09-03)
### Bug Fixes
* finalModule needs to be moduleDomain ([6b0d43f](https://git.lumeweb.com/LumeWeb/kernel/commit/6b0d43fe9b41150a768025d8d6b2edc7033e1607))
* have resolveModuleRegistryEntry decode the cid and pass the pubkey ([e6318cd](https://git.lumeweb.com/LumeWeb/kernel/commit/e6318cdc38b839de8c95d36c1f5276596b57bd83))
# [0.1.0-develop.8](https://git.lumeweb.com/LumeWeb/kernel/compare/v0.1.0-develop.7...v0.1.0-develop.8) (2023-09-02) # [0.1.0-develop.8](https://git.lumeweb.com/LumeWeb/kernel/compare/v0.1.0-develop.7...v0.1.0-develop.8) (2023-09-02)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@lumeweb/kernel", "name": "@lumeweb/kernel",
"version": "0.1.0-develop.9", "version": "0.1.0-develop.8",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lumeweb/kernel", "name": "@lumeweb/kernel",
"version": "0.1.0-develop.9", "version": "0.1.0-develop.8",
"dependencies": { "dependencies": {
"@lumeweb/libkernel": "0.1.0-develop.38" "@lumeweb/libkernel": "0.1.0-develop.38"
}, },

View File

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

View File

@ -1,15 +1,14 @@
import { internalModuleCall, modules } from "./queries.js"; import { internalModuleCall, modules } from "./queries.js";
import { SignedRegistryEntry } from "@lumeweb/libs5"; import { SignedRegistryEntry } from "@lumeweb/libs5";
import { base58btc } from "multiformats/bases/base58"; import { base58btc } from "multiformats/bases/base58";
import { decodeCid } from "@lumeweb/libweb";
const CORE_MODULES = { const CORE_MODULES = {
swarm: "zdiLmwHCC15afFNLYzzT2DVV7m27SrBde7oXHdSzAe95GpFZXzdpatUN6b", swarm: "z3o47ar8NBrnaEneBVzZD7QuMRMXjDtQDCpt4xP6mhsdw1cjnJ8mQKfNKGv3",
peerDiscoveryRegistry: peerDiscoveryRegistry:
"zdiLW9MtAAMssP5vLBgd1FitouiVXzNUYZszFYG44uVKqCPDqUQox9aq1y", "z3o47aaLSspwrXzmu5mjuHPwaq3gRbyYQ3jL9RM1ammuHGB7uxSFBK2dRjqR",
ircPeerDiscovery: ircPeerDiscovery:
"zdiLZaKjWwXkMU88GNEWf6d5NREHe1Yk4M7eQm1owSC4ezeqFGGuGpfYXR", "z3o47admQjBj2QUrwHhvTB3nV1cBwQ5ZaKF7P5WELXeRyzzvBZr33QMJWTLs",
s5: "zdiT6quMF8gh8BhQdXE7CZYhp8S1BxSgsucSS48WuTGdars1noejvak6Qo", s5: "z3o47hB2zLuvBMFaWa55SmbFQe3u97dWUG4fssXXTEcT4ZvnPkPaRF14b1EF",
}; };
export async function networkReady() { export async function networkReady() {
@ -31,11 +30,7 @@ function moduleLoaded(module: string) {
return module in modules; return module in modules;
} }
export async function resolveModuleRegistryEntry(module: string) { export async function resolveModuleRegistryEntry(pubkey: string) {
const [cid] = decodeCid(module);
const pubkey = cid.hash;
const signedEntry = (await internalModuleCall( const signedEntry = (await internalModuleCall(
CORE_MODULES.s5, CORE_MODULES.s5,
"getRegistryEntry", "getRegistryEntry",

View File

@ -427,7 +427,7 @@ async function handleModuleCall(
let resolvedModule; let resolvedModule;
try { try {
resolvedModule = await resolveModuleRegistryEntry(moduleDomain); resolvedModule = await resolveModuleRegistryEntry(finalModule);
} catch (e) { } catch (e) {
registryFail(); registryFail();
return; return;

View File

@ -1,17 +1,17 @@
const DEFAULT_MODULE_REGISTRY = new Map<string, string>( const DEFAULT_MODULE_REGISTRY = new Map<string, string>(
Object.entries({ Object.entries({
// swarm // swarm
zdiLmwHCC15afFNLYzzT2DVV7m27SrBde7oXHdSzAe95GpFZXzdpatUN6b: z3o47ar8NBrnaEneBVzZD7QuMRMXjDtQDCpt4xP6mhsdw1cjnJ8mQKfNKGv3:
"zduMnWZNBBk7yjTX46sP3Frbnx8btaVjn7ozKb3jgdWpJqH14Kn8Qk31LK", "zduTR1y921Erd52dYq1DKLpA9J6sw8g8KPfUdbkqmwdXDGKCjQKL4SHvDd",
// peerDiscoveryRegistry // peerDiscoveryRegistry
zdiLW9MtAAMssP5vLBgd1FitouiVXzNUYZszFYG44uVKqCPDqUQox9aq1y: z3o47aaLSspwrXzmu5mjuHPwaq3gRbyYQ3jL9RM1ammuHGB7uxSFBK2dRjqR:
"zduJceGhVmwR6wf2xUhJp9juU6rabynbi8mFwmBcKEaP8nc1mXyrDyRMmy", "zduJceGhVmwR6wf2xUhJp9juU6rabynbi8mFwmBcKEaP8nc1mXyrDyRMmy",
// ircPeerDiscovery // ircPeerDiscovery
zdiLZaKjWwXkMU88GNEWf6d5NREHe1Yk4M7eQm1owSC4ezeqFGGuGpfYXR: z3o47admQjBj2QUrwHhvTB3nV1cBwQ5ZaKF7P5WELXeRyzzvBZr33QMJWTLs:
"zduLx8mxrSWBPpTby1n9GtvxmCu6DwK9bsu26AgxesJmeEcWrVAF4NX7QK", "zduLx8mxrSWBPpTby1n9GtvxmCu6DwK9bsu26AgxesJmeEcWrVAF4NX7QK",
// s5 // s5
zdiT6quMF8gh8BhQdXE7CZYhp8S1BxSgsucSS48WuTGdars1noejvak6Qo: z3o47hB2zLuvBMFaWa55SmbFQe3u97dWUG4fssXXTEcT4ZvnPkPaRF14b1EF:
"zduHdVUg8SUJQ5dwx1LnesjMTxDFxireNrppRng7z14QDZnqZCCiiWtcT9", "zduTZ7NBNtGxQxbAaDNcp7d1xta7y2MXKnjvVA3m29ohwBeeLHL1GieTPd",
}), }),
); );
const REGISTRY_ITEM_ID = "registry"; const REGISTRY_ITEM_ID = "registry";