Compare commits

...

6 Commits

Author SHA1 Message Date
semantic-release-bot 9ae777f739 chore(release): 0.1.0-develop.9 [skip ci]
# [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](6b0d43fe9b))
* have resolveModuleRegistryEntry decode the cid and pass the pubkey ([e6318cd](e6318cdc38))
2023-09-03 05:02:42 +00:00
Derrick Hammer 5880c46643
Merge remote-tracking branch 'origin/develop' into develop 2023-09-03 01:01:26 -04:00
Derrick Hammer 2ca758f28c
dep: update module hashes 2023-09-03 01:01:18 -04:00
Derrick Hammer 6b83e4c5b4
dep: update resolver CID's 2023-09-03 01:01:11 -04:00
Derrick Hammer 6b0d43fe9b
fix: finalModule needs to be moduleDomain 2023-09-02 14:46:22 -04:00
Derrick Hammer e6318cdc38
fix: have resolveModuleRegistryEntry decode the cid and pass the pubkey 2023-09-02 14:46:06 -04:00
6 changed files with 28 additions and 15 deletions

View File

@ -1,3 +1,11 @@
# [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.8", "version": "0.1.0-develop.9",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lumeweb/kernel", "name": "@lumeweb/kernel",
"version": "0.1.0-develop.8", "version": "0.1.0-develop.9",
"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.8", "version": "0.1.0-develop.9",
"type": "module", "type": "module",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -1,14 +1,15 @@
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: "z3o47ar8NBrnaEneBVzZD7QuMRMXjDtQDCpt4xP6mhsdw1cjnJ8mQKfNKGv3", swarm: "zdiLmwHCC15afFNLYzzT2DVV7m27SrBde7oXHdSzAe95GpFZXzdpatUN6b",
peerDiscoveryRegistry: peerDiscoveryRegistry:
"z3o47aaLSspwrXzmu5mjuHPwaq3gRbyYQ3jL9RM1ammuHGB7uxSFBK2dRjqR", "zdiLW9MtAAMssP5vLBgd1FitouiVXzNUYZszFYG44uVKqCPDqUQox9aq1y",
ircPeerDiscovery: ircPeerDiscovery:
"z3o47admQjBj2QUrwHhvTB3nV1cBwQ5ZaKF7P5WELXeRyzzvBZr33QMJWTLs", "zdiLZaKjWwXkMU88GNEWf6d5NREHe1Yk4M7eQm1owSC4ezeqFGGuGpfYXR",
s5: "z3o47hB2zLuvBMFaWa55SmbFQe3u97dWUG4fssXXTEcT4ZvnPkPaRF14b1EF", s5: "zdiT6quMF8gh8BhQdXE7CZYhp8S1BxSgsucSS48WuTGdars1noejvak6Qo",
}; };
export async function networkReady() { export async function networkReady() {
@ -30,7 +31,11 @@ function moduleLoaded(module: string) {
return module in modules; return module in modules;
} }
export async function resolveModuleRegistryEntry(pubkey: string) { export async function resolveModuleRegistryEntry(module: 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(finalModule); resolvedModule = await resolveModuleRegistryEntry(moduleDomain);
} 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
z3o47ar8NBrnaEneBVzZD7QuMRMXjDtQDCpt4xP6mhsdw1cjnJ8mQKfNKGv3: zdiLmwHCC15afFNLYzzT2DVV7m27SrBde7oXHdSzAe95GpFZXzdpatUN6b:
"zduTR1y921Erd52dYq1DKLpA9J6sw8g8KPfUdbkqmwdXDGKCjQKL4SHvDd", "zduMnWZNBBk7yjTX46sP3Frbnx8btaVjn7ozKb3jgdWpJqH14Kn8Qk31LK",
// peerDiscoveryRegistry // peerDiscoveryRegistry
z3o47aaLSspwrXzmu5mjuHPwaq3gRbyYQ3jL9RM1ammuHGB7uxSFBK2dRjqR: zdiLW9MtAAMssP5vLBgd1FitouiVXzNUYZszFYG44uVKqCPDqUQox9aq1y:
"zduJceGhVmwR6wf2xUhJp9juU6rabynbi8mFwmBcKEaP8nc1mXyrDyRMmy", "zduJceGhVmwR6wf2xUhJp9juU6rabynbi8mFwmBcKEaP8nc1mXyrDyRMmy",
// ircPeerDiscovery // ircPeerDiscovery
z3o47admQjBj2QUrwHhvTB3nV1cBwQ5ZaKF7P5WELXeRyzzvBZr33QMJWTLs: zdiLZaKjWwXkMU88GNEWf6d5NREHe1Yk4M7eQm1owSC4ezeqFGGuGpfYXR:
"zduLx8mxrSWBPpTby1n9GtvxmCu6DwK9bsu26AgxesJmeEcWrVAF4NX7QK", "zduLx8mxrSWBPpTby1n9GtvxmCu6DwK9bsu26AgxesJmeEcWrVAF4NX7QK",
// s5 // s5
z3o47hB2zLuvBMFaWa55SmbFQe3u97dWUG4fssXXTEcT4ZvnPkPaRF14b1EF: zdiT6quMF8gh8BhQdXE7CZYhp8S1BxSgsucSS48WuTGdars1noejvak6Qo:
"zduTZ7NBNtGxQxbAaDNcp7d1xta7y2MXKnjvVA3m29ohwBeeLHL1GieTPd", "zduHdVUg8SUJQ5dwx1LnesjMTxDFxireNrppRng7z14QDZnqZCCiiWtcT9",
}), }),
); );
const REGISTRY_ITEM_ID = "registry"; const REGISTRY_ITEM_ID = "registry";