Compare commits
4 Commits
v0.0.2-dev
...
v0.1.0-dev
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | 40e7eb7b6f | |
Derrick Hammer | cb1608a4df | |
Derrick Hammer | 663a67c7ba | |
Derrick Hammer | 81f4fc2a0f |
|
@ -1,3 +1,10 @@
|
|||
# [0.1.0-develop.1](https://git.lumeweb.com/LumeWeb/kernel-ipfs/compare/v0.0.2-develop.4...v0.1.0-develop.1) (2023-07-19)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add register method for network registry ([663a67c](https://git.lumeweb.com/LumeWeb/kernel-ipfs/commit/663a67c7ba9450c6a499f6ce3dcb06d0245476d3))
|
||||
|
||||
## [0.0.2-develop.4](https://git.lumeweb.com/LumeWeb/kernel-ipfs/compare/v0.0.2-develop.3...v0.0.2-develop.4) (2023-07-12)
|
||||
|
||||
## [0.0.2-develop.3](https://git.lumeweb.com/LumeWeb/kernel-ipfs/compare/v0.0.2-develop.2...v0.0.2-develop.3) (2023-07-09)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@lumeweb/kernel-ipfs",
|
||||
"version": "0.0.2-develop.4",
|
||||
"version": "0.1.0-develop.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@lumeweb/kernel-ipfs",
|
||||
"version": "0.0.2-develop.4",
|
||||
"version": "0.1.0-develop.1",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"@helia/ipns": "^1.1.3",
|
||||
|
@ -15,6 +15,7 @@
|
|||
"@libp2p/delegated-peer-routing": "^4.0.9",
|
||||
"@libp2p/peer-id": "^2.0.4",
|
||||
"@libp2p/tcp": "7.0.3",
|
||||
"@lumeweb/kernel-network-registry-client": "^0.1.0-develop.2",
|
||||
"@lumeweb/kernel-swarm-client": "^0.0.2-develop.9",
|
||||
"@lumeweb/libhyperproxy": "^0.0.2-develop.2",
|
||||
"@lumeweb/libkernel": "0.1.0-develop.16",
|
||||
|
@ -3105,6 +3106,35 @@
|
|||
"@lumeweb/libweb": "^0.2.0-develop.19"
|
||||
}
|
||||
},
|
||||
"node_modules/@lumeweb/kernel-network-registry-client": {
|
||||
"version": "0.1.0-develop.2",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/kernel-network-registry-client/-/kernel-network-registry-client-0.1.0-develop.2.tgz",
|
||||
"integrity": "sha512-e2iJylhabt+T++lcVJ2o+hoR6DNXtyTWeodROyJ+f1VPhS9rgzAGflDOKyd7Zpi4DDHzpRY2gJtiL18FHOmMrw==",
|
||||
"dependencies": {
|
||||
"@lumeweb/libkernel": "^0.1.0-develop.20"
|
||||
}
|
||||
},
|
||||
"node_modules/@lumeweb/kernel-network-registry-client/node_modules/@lumeweb/libkernel": {
|
||||
"version": "0.1.0-develop.20",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libkernel/-/libkernel-0.1.0-develop.20.tgz",
|
||||
"integrity": "sha512-z7yRk6B0P0bxPe+a4Xm5/Bl6eIfkDCB2IJhNK2Gm+o7j4RbWbizRk79+zgBFWMrYzo8bVrpBKK7nGI3iNOgT9g==",
|
||||
"dependencies": {
|
||||
"@lumeweb/libweb": "0.2.0-develop.26",
|
||||
"emittery": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@lumeweb/kernel-network-registry-client/node_modules/@lumeweb/libweb": {
|
||||
"version": "0.2.0-develop.26",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libweb/-/libweb-0.2.0-develop.26.tgz",
|
||||
"integrity": "sha512-XRIDiqRFqlEbcwjxAfkv7UYnyTflN3Q4rki8YAd9QrLQM2vycslgPLYS53vVJVL9GPH93V5J9z2V4DPQZlOOkQ==",
|
||||
"dependencies": {
|
||||
"@lumeweb/community-portals": "^0.1.0-develop.6",
|
||||
"@lumeweb/libportal": "^0.2.0-develop.16",
|
||||
"@lumeweb/node-library-preset": "0.2.7",
|
||||
"@noble/curves": "^1.1.0",
|
||||
"@noble/hashes": "^1.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@lumeweb/kernel-swarm-client": {
|
||||
"version": "0.0.2-develop.9",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/kernel-swarm-client/-/kernel-swarm-client-0.0.2-develop.9.tgz",
|
||||
|
@ -3138,9 +3168,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@lumeweb/libportal": {
|
||||
"version": "0.2.0-develop.12",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libportal/-/libportal-0.2.0-develop.12.tgz",
|
||||
"integrity": "sha512-FKdMzeOvi8viXwFbKLeD7c4SadLDaz/ZvSLaAumuyXiJCKk0gVM0aPO8mTkibDtJG5JfeFHef0jI9aOSMYWfXw==",
|
||||
"version": "0.2.0-develop.16",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libportal/-/libportal-0.2.0-develop.16.tgz",
|
||||
"integrity": "sha512-wyzza/ttvU6I1gIs4tnYSkcT6s7MIBnUdJSNAbe6k6NsQ1w4bhBVJhEKbBru/lAEASO/PAhHGBwaOCv20rZZfA==",
|
||||
"dependencies": {
|
||||
"@lumeweb/node-library-preset": "git+https://git.lumeweb.com/LumeWeb/node-library-preset.git",
|
||||
"@noble/curves": "^1.1.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@lumeweb/kernel-ipfs",
|
||||
"version": "0.0.2-develop.4",
|
||||
"version": "0.1.0-develop.1",
|
||||
"type": "module",
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
|
@ -20,6 +20,7 @@
|
|||
"@libp2p/delegated-peer-routing": "^4.0.9",
|
||||
"@libp2p/peer-id": "^2.0.4",
|
||||
"@libp2p/tcp": "7.0.3",
|
||||
"@lumeweb/kernel-network-registry-client": "^0.1.0-develop.2",
|
||||
"@lumeweb/kernel-swarm-client": "^0.0.2-develop.9",
|
||||
"@lumeweb/libhyperproxy": "^0.0.2-develop.2",
|
||||
"@lumeweb/libkernel": "0.1.0-develop.16",
|
||||
|
|
11
src/index.ts
11
src/index.ts
|
@ -26,6 +26,7 @@ import { Helia } from "@helia/interface";
|
|||
// @ts-ignore
|
||||
import type { Components } from "libp2p/src/components.js";
|
||||
import { libp2pConfig } from "./config.js";
|
||||
import { createClient as createNetworkRegistryClient } from "@lumeweb/kernel-network-registry-client";
|
||||
|
||||
const basesByPrefix: { [prefix: string]: MultibaseDecoder<any> } = Object.keys(
|
||||
bases,
|
||||
|
@ -35,11 +36,14 @@ const basesByPrefix: { [prefix: string]: MultibaseDecoder<any> } = Object.keys(
|
|||
return acc;
|
||||
}, {});
|
||||
|
||||
const TYPES = ["content"];
|
||||
|
||||
onmessage = handleMessage;
|
||||
|
||||
const moduleDefer = defer();
|
||||
let activeIpfsPeersDefer = defer();
|
||||
let networkPeersAvailable = defer();
|
||||
const networkRegistry = createNetworkRegistryClient();
|
||||
|
||||
let swarm;
|
||||
let proxy: MultiSocketProxy;
|
||||
|
@ -53,6 +57,7 @@ BigInt.prototype.toJSON = function () {
|
|||
};
|
||||
|
||||
addHandler("presentKey", handlePresentKey);
|
||||
addHandler("register", handleRegister);
|
||||
addHandler("ready", handleReady);
|
||||
addHandler("stat", handleStat);
|
||||
addHandler("ls", handleLs, { receiveUpdates: true });
|
||||
|
@ -284,3 +289,9 @@ async function ready() {
|
|||
await moduleDefer.promise;
|
||||
await networkPeersAvailable.promise;
|
||||
}
|
||||
|
||||
async function handleRegister(aq: ActiveQuery) {
|
||||
await networkRegistry.registerNetwork(TYPES);
|
||||
|
||||
aq.respond();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue