Run #1: Completed prettier/test/TODO for 2 projects + new hyperswarm-presence-demo + README table + diary
This commit is contained in:
@@ -9,3 +9,14 @@ node index.js
|
||||
```
|
||||
|
||||
Do not commit `node_modules/`; lockfiles (`package-lock.json`) should reflect current dependency ranges in each `package.json`.
|
||||
|
||||
## Project Status
|
||||
|
||||
| Project | Description | Status |
|
||||
|--------------------------|------------------------------------------|---------------------------------|
|
||||
| simple-hypercore-swarm | Basic Hypercore message replication | ✅ Prettier, test script, TODO |
|
||||
| hyperdrive-fileshare | P2P file sharing w/ manual key share | ✅ Prettier, test script, TODO |
|
||||
| hyperbee-chat | Timestamped KV chat w/ live read | Initial TODO |
|
||||
| p2p-notes | Indexed notes in Hyperdrive + Hyperbee | Initial TODO |
|
||||
| autobase-todo | Multi-writer todo list | Initial TODO |
|
||||
| hyperswarm-presence-demo| Peer presence heartbeats & active list | ✅ New: Prettier, test script |
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
# autobase-todo Production TODOs\n\n- [ ] Syntax check passes (node -c)\n- [ ] Code formatted with Prettier\n- [ ] Add unit tests (80% coverage)\n- [ ] Multi-peer e2e test (multi-writer)\n- [ ] Detailed README with usage\n- [ ] npm publish-ready
|
||||
@@ -0,0 +1 @@
|
||||
# hyperbee-chat Production TODOs\n\n- [ ] Syntax check passes (node -c)\n- [ ] Code formatted with Prettier\n- [ ] Add unit tests (80% coverage)\n- [ ] Multi-peer e2e test script\n- [ ] Detailed README with usage\n- [ ] npm publish-ready
|
||||
@@ -3,6 +3,7 @@
|
||||
P2P file sharing prototype using Hyperdrive + Hyperswarm.
|
||||
|
||||
## Features
|
||||
|
||||
- Drive on corestore default 'db' core (deterministic key)
|
||||
- Writer puts timestamped text files every 3s
|
||||
- Reader lists / and gets file contents every 5s
|
||||
@@ -10,6 +11,7 @@ P2P file sharing prototype using Hyperdrive + Hyperswarm.
|
||||
- Separate storages
|
||||
|
||||
## Run
|
||||
|
||||
```
|
||||
npm i
|
||||
node index.js writer # Puts files
|
||||
@@ -17,6 +19,7 @@ node index.js reader # Lists / gets
|
||||
```
|
||||
|
||||
## Expected
|
||||
|
||||
- Drive ready, keys logged
|
||||
- Writer: Puts increment version
|
||||
- Reader: Local empty until replicate
|
||||
@@ -27,11 +30,13 @@ Localhost DHT: Slow/no conn expected.
|
||||
Test: Writer 30s auto-exit.
|
||||
|
||||
## Test Results
|
||||
|
||||
**Writer** (./writer-storage):
|
||||
|
||||
- Key: `d5dfebef1968a44295232aa30a6b7e567efb0eb21fc6a4a8880f2e2293c31713`
|
||||
- Discovery Key: `52b3796ac54edb616cfb925f776940fd2e087940c43f42833a6959f57d44cd9b`
|
||||
- 9 files put (/msg-0.txt to /msg-8.txt), version from 1→10
|
||||
|
||||
**Reader** (./reader-storage): local empty scans, version 1.
|
||||
No P2P connections (localhost DHT limits).
|
||||
Ready for multi-host replication (drive.replicate(conn)).
|
||||
Ready for multi-host replication (drive.replicate(conn)).
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
# hyperdrive-fileshare Production TODOs\n\n- [x] Syntax check passes (node -c)\n- [x] Code formatted with Prettier\n- [ ] Add unit tests (80% coverage)\n- [ ] Multi-peer e2e test script (writer + 2 readers)\n- [ ] Detailed README with usage & key sharing\n- [ ] npm publish-ready (types, keywords)
|
||||
@@ -1,73 +1,77 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict'
|
||||
"use strict";
|
||||
|
||||
const Corestore = require('corestore')
|
||||
const Hyperdrive = require('hyperdrive')
|
||||
const Hyperswarm = require('hyperswarm')
|
||||
const Corestore = require("corestore");
|
||||
const Hyperdrive = require("hyperdrive");
|
||||
const Hyperswarm = require("hyperswarm");
|
||||
|
||||
async function main() {
|
||||
const isWriter = process.argv[2] === undefined
|
||||
const storageDir = isWriter ? './storage-writer' : './storage-reader'
|
||||
const store = new Corestore(storageDir)
|
||||
await store.ready()
|
||||
const isWriter = process.argv[2] === undefined;
|
||||
const storageDir = isWriter ? "./storage-writer" : "./storage-reader";
|
||||
const store = new Corestore(storageDir);
|
||||
await store.ready();
|
||||
|
||||
let drive
|
||||
let drive;
|
||||
if (isWriter) {
|
||||
drive = new Hyperdrive(store)
|
||||
drive = new Hyperdrive(store);
|
||||
} else {
|
||||
const key = Buffer.from(process.argv[2], 'hex')
|
||||
drive = new Hyperdrive(store, key, { sparse: true })
|
||||
const key = Buffer.from(process.argv[2], "hex");
|
||||
drive = new Hyperdrive(store, key, { sparse: true });
|
||||
}
|
||||
await drive.ready()
|
||||
await drive.ready();
|
||||
|
||||
if (isWriter) {
|
||||
const content = 'Test P2P file share content\n'
|
||||
await drive.put('/test.txt', Buffer.from(content))
|
||||
console.log('✅ File written: /test.txt')
|
||||
console.log('📤 Share this drive key with readers: ' + drive.key.toString('hex'))
|
||||
const content = "Test P2P file share content\n";
|
||||
await drive.put("/test.txt", Buffer.from(content));
|
||||
console.log("✅ File written: /test.txt");
|
||||
console.log(
|
||||
"📤 Share this drive key with readers: " + drive.key.toString("hex"),
|
||||
);
|
||||
} else {
|
||||
console.log('🔍 Connecting to drive key: ' + process.argv[2])
|
||||
console.log("🔍 Connecting to drive key: " + process.argv[2]);
|
||||
}
|
||||
|
||||
const swarm = new Hyperswarm()
|
||||
swarm.on('connection', (conn) => {
|
||||
console.log('🔗 New peer connection')
|
||||
drive.replicate(conn)
|
||||
})
|
||||
const swarm = new Hyperswarm();
|
||||
swarm.on("connection", (conn) => {
|
||||
console.log("🔗 New peer connection");
|
||||
drive.replicate(conn);
|
||||
});
|
||||
|
||||
swarm.join(drive.discoveryKey)
|
||||
console.log('🌐 Joined swarm on discovery key: ' + drive.discoveryKey.toString('hex'))
|
||||
swarm.join(drive.discoveryKey);
|
||||
console.log(
|
||||
"🌐 Joined swarm on discovery key: " + drive.discoveryKey.toString("hex"),
|
||||
);
|
||||
|
||||
if (!isWriter) {
|
||||
const checkFile = async () => {
|
||||
try {
|
||||
const content = await drive.get('/test.txt')
|
||||
const content = await drive.get("/test.txt");
|
||||
if (content) {
|
||||
console.log('📥 File received successfully:')
|
||||
console.log(content.toString())
|
||||
process.exit(0)
|
||||
console.log("📥 File received successfully:");
|
||||
console.log(content.toString());
|
||||
process.exit(0);
|
||||
}
|
||||
} catch (err) {
|
||||
// File not yet available
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Initial check
|
||||
await checkFile()
|
||||
await checkFile();
|
||||
|
||||
// Poll periodically
|
||||
const interval = setInterval(checkFile, 2000)
|
||||
const interval = setInterval(checkFile, 2000);
|
||||
|
||||
// Also react to updates
|
||||
const onUpdate = () => checkFile()
|
||||
drive.on('update', onUpdate)
|
||||
const onUpdate = () => checkFile();
|
||||
drive.on("update", onUpdate);
|
||||
}
|
||||
|
||||
// Keep writer alive
|
||||
await new Promise(resolve => {})
|
||||
await new Promise((resolve) => {});
|
||||
}
|
||||
|
||||
main().catch((err) => {
|
||||
console.error('❌ Error:', err.message)
|
||||
process.exit(1)
|
||||
})
|
||||
console.error("❌ Error:", err.message);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
"corestore": "^7.9.2",
|
||||
"hyperdrive": "^13.3.2",
|
||||
"hyperswarm": "^4.17.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier": "^3.8.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@hyperswarm/secret-stream": {
|
||||
@@ -728,6 +731,22 @@
|
||||
"sodium-universal": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.8.3",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz",
|
||||
"integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"prettier": "bin/prettier.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/protocol-buffers-encodings": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/protocol-buffers-encodings/-/protocol-buffers-encodings-1.2.0.tgz",
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "P2P file sharing prototype using Hyperdrive + Hyperswarm.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"test": "node -c index.js && npx prettier --check ."
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
@@ -13,5 +13,8 @@
|
||||
"corestore": "^7.9.2",
|
||||
"hyperdrive": "^13.3.2",
|
||||
"hyperswarm": "^4.17.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier": "^3.8.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
# hyperswarm-presence-demo Production TODOs\n\n- [x] Syntax check passes (node -c)\n- [x] Code formatted with Prettier\n- [ ] Add unit tests (80% coverage)\n- [ ] Multi-peer e2e test (3+ instances, verify presence detection)\n- [ ] Detailed README with usage, screenshots of peer list\n- [ ] npm publish-ready (types, keywords, badges)
|
||||
@@ -0,0 +1,89 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const Hyperswarm = require("hyperswarm");
|
||||
const Corestore = require("corestore");
|
||||
const b4a = require("b4a");
|
||||
|
||||
async function main(name = "Anonymous") {
|
||||
const corestore = new Corestore("./presence-storage");
|
||||
const core = corestore.get({ name: "presence-core", valueEncoding: "json" });
|
||||
await core.ready();
|
||||
console.log(
|
||||
"🤝 Presence core ready:",
|
||||
core.key.toString("hex").slice(0, 16) + "...",
|
||||
);
|
||||
|
||||
const swarm = new Hyperswarm();
|
||||
const topic = Buffer.alloc(32).fill("hyperswarm-presence-demo");
|
||||
console.log(
|
||||
"🌐 Joining presence swarm on topic:",
|
||||
topic.toString("hex").slice(0, 16) + "...",
|
||||
);
|
||||
|
||||
swarm.join(topic, { server: true, client: true });
|
||||
await swarm.flush();
|
||||
|
||||
swarm.on("connection", (conn, info) => {
|
||||
console.log("🔗 New peer connection:", info?.client ? "client" : "server");
|
||||
corestore.replicate(conn);
|
||||
});
|
||||
|
||||
swarm.on("updated", () => {
|
||||
console.log(`📊 Swarm peers: ${swarm.connections.size}`);
|
||||
});
|
||||
|
||||
const peerId = b4a.toString(b4a.random(8), "hex");
|
||||
console.log(`👤 My ID: ${peerId} (${name})`);
|
||||
|
||||
const peers = new Map(); // id -> last heartbeat ts
|
||||
|
||||
core.on("append", async () => {
|
||||
const now = Date.now();
|
||||
// Update local peer list from recent appends
|
||||
for (let i = Math.max(0, core.length - 20); i < core.length; i++) {
|
||||
const msg = await core.get(i);
|
||||
if (msg && msg.peerId && msg.ts && now - msg.ts < 45000) {
|
||||
peers.set(msg.peerId, msg.ts);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const heartbeat = () => {
|
||||
const msg = { peerId, name, ts: Date.now(), online: true };
|
||||
core.append(msg).catch(console.error);
|
||||
console.log("💓 Heartbeat sent:", peerId.slice(0, 8));
|
||||
};
|
||||
|
||||
heartbeat();
|
||||
setInterval(heartbeat, 10000);
|
||||
|
||||
// Log active peers every 15s
|
||||
setInterval(() => {
|
||||
const now = Date.now();
|
||||
let active = 0;
|
||||
for (const [id, ts] of peers) {
|
||||
if (now - ts < 30000) active++;
|
||||
}
|
||||
console.log(
|
||||
`👥 Active peers: ${active} (${name} included) | Total seen: ${peers.size}`,
|
||||
);
|
||||
if (active > 1) {
|
||||
console.log(
|
||||
" Peers:",
|
||||
Array.from(peers.entries())
|
||||
.filter(([id, ts]) => now - ts < 30000)
|
||||
.map(([id, ts]) => id.slice(0, 8) + `(${ts})`)
|
||||
.join(", "),
|
||||
);
|
||||
}
|
||||
}, 15000);
|
||||
|
||||
// Graceful exit
|
||||
process.on("SIGINT", async () => {
|
||||
console.log("👋 Shutting down...");
|
||||
await swarm.destroy();
|
||||
process.exit(0);
|
||||
});
|
||||
}
|
||||
|
||||
main(process.argv[2] || "Anonymous");
|
||||
@@ -0,0 +1,945 @@
|
||||
{
|
||||
"name": "hyperswarm-presence-demo",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "hyperswarm-presence-demo",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"b4a": "^1.8.0",
|
||||
"corestore": "^7.9.2",
|
||||
"hypercore": "^11.28.1",
|
||||
"hyperswarm": "^4.17.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier": "^3.8.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@hyperswarm/secret-stream": {
|
||||
"version": "6.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@hyperswarm/secret-stream/-/secret-stream-6.9.1.tgz",
|
||||
"integrity": "sha512-xb0S5y3YJwBakD77JOGBHlBxdp63mHClZoXBYoLv+9wH8e054ESKlmQptWqjJK5dv5VMUIVYOJB4MaOpB0JdGw==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"b4a": "^1.1.0",
|
||||
"hypercore-crypto": "^3.3.1",
|
||||
"noise-curve-ed": "^2.0.1",
|
||||
"noise-handshake": "^4.0.0",
|
||||
"sodium-secretstream": "^1.1.0",
|
||||
"sodium-universal": "^5.0.0",
|
||||
"streamx": "^2.14.0",
|
||||
"timeout-refresh": "^2.0.0",
|
||||
"unslab": "^1.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/adaptive-timeout": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/adaptive-timeout/-/adaptive-timeout-1.0.1.tgz",
|
||||
"integrity": "sha512-+seGiBtHqbnyZ0Quq/ZGxxwP66153WBABawa07/QeyuPFzbduPBjiGQAyCiriiLDzt3dkbMBskSlfqtRwblK8Q==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"xache": "^1.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/b4a": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/b4a/-/b4a-1.8.0.tgz",
|
||||
"integrity": "sha512-qRuSmNSkGQaHwNbM7J78Wwy+ghLEYF1zNrSeMxj4Kgw6y33O3mXcQ6Ie9fRvfU/YnxWkOchPXbaLb73TkIsfdg==",
|
||||
"license": "Apache-2.0",
|
||||
"peerDependencies": {
|
||||
"react-native-b4a": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react-native-b4a": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/bare-addon-resolve": {
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/bare-addon-resolve/-/bare-addon-resolve-1.10.0.tgz",
|
||||
"integrity": "sha512-sSd0jieRJlDaODOzj0oe0RjFVC1QI0ZIjGIdPkbrTXsdVVtENg14c+lHHAhHwmWCZ2nQlMhy8jA3Y5LYPc/isA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"bare-module-resolve": "^1.10.0",
|
||||
"bare-semver": "^1.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"bare-url": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"bare-url": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/bare-ansi-escapes": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/bare-ansi-escapes/-/bare-ansi-escapes-2.2.3.tgz",
|
||||
"integrity": "sha512-02ES4/E2RbrtZSnHJ9LntBhYkLA6lPpSEeP8iqS3MccBIVhVBlEmruF1I7HZqx5Q8aiTeYfQVeqmrU9YO2yYoQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"bare-stream": "^2.6.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"bare-buffer": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"bare-buffer": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/bare-assert": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/bare-assert/-/bare-assert-1.2.0.tgz",
|
||||
"integrity": "sha512-c6uvgvTJBspTDxtVnPgrBKmLgcpW3Fp72NVKDLg6oT4QjQbhGtvrkHMhGYMK1sh4vjBHOBmuUalyt9hSzV37fQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"bare-inspect": "^3.1.2"
|
||||
}
|
||||
},
|
||||
"node_modules/bare-events": {
|
||||
"version": "2.8.2",
|
||||
"resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.8.2.tgz",
|
||||
"integrity": "sha512-riJjyv1/mHLIPX4RwiK+oW9/4c3TEUeORHKefKAKnZ5kyslbN+HXowtbaVEqt4IMUB7OXlfixcs6gsFeo/jhiQ==",
|
||||
"license": "Apache-2.0",
|
||||
"peerDependencies": {
|
||||
"bare-abort-controller": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"bare-abort-controller": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/bare-fs": {
|
||||
"version": "4.7.1",
|
||||
"resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.7.1.tgz",
|
||||
"integrity": "sha512-WDRsyVN52eAx/lBamKD6uyw8H4228h/x0sGGGegOamM2cd7Pag88GfMQalobXI+HaEUxpCkbKQUDOQqt9wawRw==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"bare-events": "^2.5.4",
|
||||
"bare-path": "^3.0.0",
|
||||
"bare-stream": "^2.6.4",
|
||||
"bare-url": "^2.2.2",
|
||||
"fast-fifo": "^1.3.2"
|
||||
},
|
||||
"engines": {
|
||||
"bare": ">=1.16.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"bare-buffer": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"bare-buffer": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/bare-inspect": {
|
||||
"version": "3.1.4",
|
||||
"resolved": "https://registry.npmjs.org/bare-inspect/-/bare-inspect-3.1.4.tgz",
|
||||
"integrity": "sha512-jfW5KRA84o3REpI6Vr4nbvMn+hqVAw8GU1mMdRwUsY5yJovQamxYeKGVKGqdzs+8ZbG4jRzGUXP/3Ji/DnqfPg==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"bare-ansi-escapes": "^2.1.0",
|
||||
"bare-type": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"bare": ">=1.18.0"
|
||||
}
|
||||
},
|
||||
"node_modules/bare-module-resolve": {
|
||||
"version": "1.12.1",
|
||||
"resolved": "https://registry.npmjs.org/bare-module-resolve/-/bare-module-resolve-1.12.1.tgz",
|
||||
"integrity": "sha512-hbmAPyFpEq8FoZMd5sFO3u6MC5feluWoGE8YKlA8fCrl6mNtx68Wjg4DTiDJcqRJaovTvOYKfYngoBUnbaT7eg==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"bare-semver": "^1.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"bare-url": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"bare-url": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/bare-os": {
|
||||
"version": "3.8.7",
|
||||
"resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.8.7.tgz",
|
||||
"integrity": "sha512-G4Gr1UsGeEy2qtDTZwL7JFLo2wapUarz7iTMcYcMFdS89AIQuBoyjgXZz0Utv7uHs3xA9LckhVbeBi8lEQrC+w==",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"bare": ">=1.14.0"
|
||||
}
|
||||
},
|
||||
"node_modules/bare-path": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.0.0.tgz",
|
||||
"integrity": "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"bare-os": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/bare-semver": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/bare-semver/-/bare-semver-1.0.3.tgz",
|
||||
"integrity": "sha512-HS/A30bi2+PiRJfU6R4+Kp+6KeLSCSByjYM2iiobOKzLAvtu1CT+S8xWfiU7wz0erknjkUoC+yXy108tzIuP5Q==",
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/bare-stream": {
|
||||
"version": "2.13.0",
|
||||
"resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.13.0.tgz",
|
||||
"integrity": "sha512-3zAJRZMDFGjdn+RVnNpF9kuELw+0Fl3lpndM4NcEOhb9zwtSo/deETfuIwMSE5BXanA0FrN1qVjffGwAg2Y7EA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"streamx": "^2.25.0",
|
||||
"teex": "^1.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"bare-abort-controller": "*",
|
||||
"bare-buffer": "*",
|
||||
"bare-events": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"bare-abort-controller": {
|
||||
"optional": true
|
||||
},
|
||||
"bare-buffer": {
|
||||
"optional": true
|
||||
},
|
||||
"bare-events": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/bare-type": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/bare-type/-/bare-type-1.1.0.tgz",
|
||||
"integrity": "sha512-LdtnnEEYldOc87Dr4GpsKnStStZk3zfgoEMXy8yvEZkXrcCv9RtYDrUYWFsBQHtaB0s1EUWmcvS6XmEZYIj3Bw==",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"bare": ">=1.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/bare-url": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/bare-url/-/bare-url-2.4.1.tgz",
|
||||
"integrity": "sha512-fZapLWNB25gS+etK27NV9KgBNXgo2yeYHuj+OyPblQd6GYAE3JVy6aKxszMV5jhGGFwraXQKA5fldvf3lMyEqw==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"bare-path": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/big-sparse-array": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/big-sparse-array/-/big-sparse-array-1.0.3.tgz",
|
||||
"integrity": "sha512-6RjV/3mSZORlMdpUaQ6rUSpG637cZm0//E54YYGtQg1c1O+AbZP8UTdJ/TchsDZcTVLmyWZcseBfp2HBeXUXOQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/bits-to-bytes": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/bits-to-bytes/-/bits-to-bytes-1.3.0.tgz",
|
||||
"integrity": "sha512-OJoHTpFXS9bXHBCekGTByf3MqM8CGblBDIduKQeeVVeiU9dDWywSSirXIBYGgg3d1zbVuvnMa1vD4r6PA0kOKg==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"b4a": "^1.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/blind-relay": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/blind-relay/-/blind-relay-1.4.0.tgz",
|
||||
"integrity": "sha512-6xt7fDfCs6eGmNNym6I9N42jmjcMQn2qwwOVnkP9ZnrkXFk6c4/tdO1xqRmDEzKzV8gigd+DVdCUG/RUYnen7Q==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"b4a": "^1.6.4",
|
||||
"bare-events": "^2.2.0",
|
||||
"bits-to-bytes": "^1.3.0",
|
||||
"compact-encoding": "^2.12.0",
|
||||
"compact-encoding-bitfield": "^1.0.0",
|
||||
"protomux": "^3.5.1",
|
||||
"sodium-universal": "^5.0.0",
|
||||
"streamx": "^2.15.1"
|
||||
}
|
||||
},
|
||||
"node_modules/bogon": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/bogon/-/bogon-1.2.0.tgz",
|
||||
"integrity": "sha512-FqOBr/1VMzCOsoJd+fzNUMarUYki2+TKt07A2+xaulsNx4r53iJ7MV5k0jbqg7W2U0CsLqxCZOrFibdG6h6HSg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"compact-encoding": "^2.11.0",
|
||||
"compact-encoding-net": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/compact-encoding": {
|
||||
"version": "2.19.2",
|
||||
"resolved": "https://registry.npmjs.org/compact-encoding/-/compact-encoding-2.19.2.tgz",
|
||||
"integrity": "sha512-/YjhHQE/5L4F7l5Bht69dRbP9RV6zoJPeowi8bMKQxNKe3Nh6hOY8pBGoVE9fz5GaWfEd8fWJ2aU9sB4KZuMYg==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"b4a": "^1.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/compact-encoding-bitfield": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/compact-encoding-bitfield/-/compact-encoding-bitfield-1.0.0.tgz",
|
||||
"integrity": "sha512-3nMVKUg+PF72UHfainmCL8uKvyWfxsjqOtUY+HiMPGLPCTjnwzoKfFAMo1Ad7nwTPdjBqtGK5b3BOFTFW4EBTg==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"compact-encoding": "^2.4.1"
|
||||
}
|
||||
},
|
||||
"node_modules/compact-encoding-net": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/compact-encoding-net/-/compact-encoding-net-1.2.0.tgz",
|
||||
"integrity": "sha512-LVXpNpF7PGQeHRVVLGgYWzuVoYAaDZvKUsUxRioGfkotzvOh4AzoQF1HBH3zMNaSnx7gJXuUr3hkjnijaH/Eng==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"compact-encoding": "^2.4.1"
|
||||
}
|
||||
},
|
||||
"node_modules/corestore": {
|
||||
"version": "7.9.2",
|
||||
"resolved": "https://registry.npmjs.org/corestore/-/corestore-7.9.2.tgz",
|
||||
"integrity": "sha512-dyIktVSVLu0skZ1UM4yODbNbZ46dBpTHypzwlwET1btVuS3YIf66Zz8Tx8h3Xa8nbLO2USGqrYtvPYzSRj2wCA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"b4a": "^1.6.7",
|
||||
"hypercore": "^11.19.0",
|
||||
"hypercore-crypto": "^3.4.2",
|
||||
"hypercore-errors": "^1.4.0",
|
||||
"hypercore-id-encoding": "^1.3.0",
|
||||
"ready-resource": "^1.1.1",
|
||||
"sodium-universal": "^5.0.1",
|
||||
"which-runtime": "^1.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/device-file": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/device-file/-/device-file-2.3.1.tgz",
|
||||
"integrity": "sha512-bmON44lwxJPle9N2OcH4tqM44pMGZKT8G6OkzXkz0urvqQ9LKkoQdTS6w0ztYfmLdUE27R4UUmx0+y2gEz4Jug==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"b4a": "^1.6.7",
|
||||
"bare-fs": "^4.0.1",
|
||||
"bare-path": "^3.0.0",
|
||||
"fd-lock": "^2.1.0",
|
||||
"fs-native-extensions": "^1.4.0",
|
||||
"ready-resource": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/dht-rpc": {
|
||||
"version": "6.26.4",
|
||||
"resolved": "https://registry.npmjs.org/dht-rpc/-/dht-rpc-6.26.4.tgz",
|
||||
"integrity": "sha512-bMI625c13DXaiYN8vHEFmcM4CIauwK1SJgOMWAAqsXhsKXO8WCdp0fgYwTHH40cBB6J9MkDXPa2f79Vj5Ah1iA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"adaptive-timeout": "^1.0.1",
|
||||
"b4a": "^1.6.1",
|
||||
"bare-events": "^2.2.0",
|
||||
"compact-encoding": "^2.11.0",
|
||||
"compact-encoding-net": "^1.2.0",
|
||||
"fast-fifo": "^1.1.0",
|
||||
"kademlia-routing-table": "^1.0.1",
|
||||
"nat-sampler": "^1.0.1",
|
||||
"sodium-universal": "^5.0.0",
|
||||
"streamx": "^2.13.2",
|
||||
"time-ordered-set": "^2.0.0",
|
||||
"udx-native": "^1.5.3"
|
||||
}
|
||||
},
|
||||
"node_modules/events-universal": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/events-universal/-/events-universal-1.0.1.tgz",
|
||||
"integrity": "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"bare-events": "^2.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fast-fifo": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz",
|
||||
"integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fd-lock": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/fd-lock/-/fd-lock-2.1.1.tgz",
|
||||
"integrity": "sha512-H3VkcWFl39Rk0xBokDcUyBcVs6VrYTUo/DhDWMzJOF99wXWDAvmvq/GlLTS2NTehsznZhp3fXVyrtB2ldDXhwg==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"bare-fs": "^4.5.0",
|
||||
"fs-native-extensions": "^1.4.4",
|
||||
"ready-resource": "^1.2.0",
|
||||
"resource-on-exit": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/flat-tree": {
|
||||
"version": "1.13.0",
|
||||
"resolved": "https://registry.npmjs.org/flat-tree/-/flat-tree-1.13.0.tgz",
|
||||
"integrity": "sha512-fT3HIuCPwHhFgJ20QYzDHgUG0zMmFg5cHvFiFo5h+QMSJ28TihsEVY0f8HGliuO+pOzmvjMx1odToeaEWkTnyQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fs-native-extensions": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-native-extensions/-/fs-native-extensions-1.5.0.tgz",
|
||||
"integrity": "sha512-nuZLFm9mGCxvyi7Llww/J4OyifKCS21nEUTAmnlTZp3FObPOvA32aCedCmt4Z+8yk+caqfClNaSCfn/P7T7FLQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"require-addon": "^1.1.0",
|
||||
"which-runtime": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/generate-object-property": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-2.0.0.tgz",
|
||||
"integrity": "sha512-KwuURPyqn2Mz8DdV29pJwQu0Y7tcsbkULr82eeOcY/ZllFK6I9Wm8dsRByIu7CKWlFi9BdW1b3mcXMp/kQBQsw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"is-property": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/generate-string": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/generate-string/-/generate-string-1.0.1.tgz",
|
||||
"integrity": "sha512-IfTY0dKZM43ACyGvXkbG7De7WY7MxTS5VO6Juhe8oJKpCmrYYXoqp/cJMskkpi0k9H8wuXq0H+eI898/BCqvXg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/hypercore": {
|
||||
"version": "11.28.1",
|
||||
"resolved": "https://registry.npmjs.org/hypercore/-/hypercore-11.28.1.tgz",
|
||||
"integrity": "sha512-d8jqUilG7Gri8wT+sRdkFTYRPMHGyvBz/NCYHf5rX7+LoivRNRxQm5nWChT7caiUKbcsDak6h7IiEQ5wbD1wCg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@hyperswarm/secret-stream": "^6.0.0",
|
||||
"b4a": "^1.1.0",
|
||||
"bare-events": "^2.2.0",
|
||||
"big-sparse-array": "^1.0.3",
|
||||
"compact-encoding": "^2.11.0",
|
||||
"fast-fifo": "^1.3.0",
|
||||
"flat-tree": "^1.9.0",
|
||||
"hypercore-crypto": "^3.2.1",
|
||||
"hypercore-errors": "^1.5.0",
|
||||
"hypercore-id-encoding": "^1.2.0",
|
||||
"hypercore-storage": "^2.8.0",
|
||||
"is-options": "^1.0.1",
|
||||
"nanoassert": "^2.0.0",
|
||||
"protomux": "^3.5.0",
|
||||
"quickbit-universal": "^2.2.0",
|
||||
"random-array-iterator": "^1.0.0",
|
||||
"safety-catch": "^1.0.1",
|
||||
"sodium-universal": "^5.0.1",
|
||||
"streamx": "^2.12.4",
|
||||
"unslab": "^1.3.0",
|
||||
"z32": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hypercore-crypto": {
|
||||
"version": "3.6.1",
|
||||
"resolved": "https://registry.npmjs.org/hypercore-crypto/-/hypercore-crypto-3.6.1.tgz",
|
||||
"integrity": "sha512-ltIz2uDwy9pO/ZGTvqcjzyBkvt6O4cVm4r/nNxh0GFs/RbQtqP/i4wCvLEdmU7ptgtnw7fI67WYD1aHPuv4OVA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"b4a": "^1.6.6",
|
||||
"compact-encoding": "^2.15.0",
|
||||
"sodium-universal": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hypercore-errors": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/hypercore-errors/-/hypercore-errors-1.5.0.tgz",
|
||||
"integrity": "sha512-5KQ/SuDxsvet+7qWA35Ay6zdD9WyAHQoyWHGcPUTbmJBd300gvNIJoi3oma7kp4TTCSzii6qYumNZe/s0j/saQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"hypercore-id-encoding": "^1.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hypercore-id-encoding": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/hypercore-id-encoding/-/hypercore-id-encoding-1.3.0.tgz",
|
||||
"integrity": "sha512-W6sHdGo5h7LXEsoWfKf/KfuROZmZRQDlGqJF2EPHW+noCK66Vvr0+zE6cL0vqQi18s0kQPeN7Sq3QyR0Ytc2VQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"b4a": "^1.5.3",
|
||||
"z32": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hypercore-storage": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/hypercore-storage/-/hypercore-storage-2.8.0.tgz",
|
||||
"integrity": "sha512-s35HllFMYvrkSHvkIIklVFmCI/bRVNO7H3pi4mKvWl0XLyhGGGM+NtJ7fpsh82oPRCmL9XtMRO+pT6LiMAO8MA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"b4a": "^1.6.7",
|
||||
"bare-fs": "^4.0.1",
|
||||
"bare-path": "^3.0.0",
|
||||
"compact-encoding": "^2.16.0",
|
||||
"device-file": "^2.1.2",
|
||||
"flat-tree": "^1.12.1",
|
||||
"hypercore-crypto": "^3.4.2",
|
||||
"hyperschema": "^1.7.0",
|
||||
"index-encoder": "^3.3.2",
|
||||
"resolve-reject-promise": "^1.0.0",
|
||||
"rocksdb-native": "^3.11.0",
|
||||
"scope-lock": "^1.2.4",
|
||||
"streamx": "^2.21.1"
|
||||
}
|
||||
},
|
||||
"node_modules/hyperdht": {
|
||||
"version": "6.30.0",
|
||||
"resolved": "https://registry.npmjs.org/hyperdht/-/hyperdht-6.30.0.tgz",
|
||||
"integrity": "sha512-LkfeAFVnOIvOpr2ILtJ38CzPgXmye7jXDS12xndVKfNoxzIrM0GonY+Bz5lHutoc08ZbT3Olr/w2NSeq5Pj0Ng==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@hyperswarm/secret-stream": "^6.6.2",
|
||||
"b4a": "^1.3.1",
|
||||
"bare-events": "^2.2.0",
|
||||
"blind-relay": "^1.3.0",
|
||||
"bogon": "^1.0.0",
|
||||
"compact-encoding": "^2.4.1",
|
||||
"dht-rpc": "^6.15.1",
|
||||
"hypercore-crypto": "^3.3.0",
|
||||
"hypercore-id-encoding": "^1.2.0",
|
||||
"hyperdht-address": "^1.0.1",
|
||||
"noise-curve-ed": "^2.0.0",
|
||||
"noise-handshake": "^4.0.0",
|
||||
"record-cache": "^1.1.1",
|
||||
"safety-catch": "^1.0.1",
|
||||
"signal-promise": "^1.0.3",
|
||||
"sodium-universal": "^5.0.1",
|
||||
"streamx": "^2.16.1",
|
||||
"unslab": "^1.3.0",
|
||||
"xache": "^1.1.0"
|
||||
},
|
||||
"bin": {
|
||||
"hyperdht": "bin.js"
|
||||
}
|
||||
},
|
||||
"node_modules/hyperdht-address": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/hyperdht-address/-/hyperdht-address-1.0.1.tgz",
|
||||
"integrity": "sha512-v817eJkhryWNtMGQHLxVo6jtfEeIV9k429fRUWUKkp1bm+3/rzH8r5BFef9VT7Jq4Tvgt0Gw11FV32CacsqMZA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"compact-encoding": "^2.19.0",
|
||||
"hyperschema": "^1.20.1"
|
||||
}
|
||||
},
|
||||
"node_modules/hyperschema": {
|
||||
"version": "1.20.1",
|
||||
"resolved": "https://registry.npmjs.org/hyperschema/-/hyperschema-1.20.1.tgz",
|
||||
"integrity": "sha512-7gnvaTNUs8FqdrU3NNE6nzhOneGyDlUlpROu9YFlHA61fE8ppKKf2gLZjZjsx/enNt+VFN4ITxy8ijypfyWBLw==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"bare-fs": "^4.0.1",
|
||||
"compact-encoding": "^2.19.0",
|
||||
"generate-object-property": "^2.0.0",
|
||||
"generate-string": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/hyperswarm": {
|
||||
"version": "4.17.0",
|
||||
"resolved": "https://registry.npmjs.org/hyperswarm/-/hyperswarm-4.17.0.tgz",
|
||||
"integrity": "sha512-oe86sK961Ueg7rvDN/veFwG8xH+Iv6vObPhGDkPJcDVxk/NduW41ZhAcVDnHzRbm7S0eLU7WaDUvehOYoKSpRQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"b4a": "^1.3.1",
|
||||
"bare-events": "^2.2.0",
|
||||
"hyperdht": "^6.21.0",
|
||||
"safety-catch": "^1.0.2",
|
||||
"shuffled-priority-queue": "^2.1.0",
|
||||
"streamx": "^2.22.1",
|
||||
"unslab": "^1.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/index-encoder": {
|
||||
"version": "3.5.0",
|
||||
"resolved": "https://registry.npmjs.org/index-encoder/-/index-encoder-3.5.0.tgz",
|
||||
"integrity": "sha512-idZ1cxtZz2dRV6rUiaP9Xo99UjXbSzjcMacoQmxUMu/A7fEQcNPngvwDJYeWelQUS5XFlY71/or70lKn6XnwbQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"b4a": "^1.6.4"
|
||||
}
|
||||
},
|
||||
"node_modules/is-options": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-options/-/is-options-1.0.2.tgz",
|
||||
"integrity": "sha512-u+Ai74c8Q74aS8BuHwPdI1jptGOT1FQXgCq8/zv0xRuE+wRgSMEJLj8lVO8Zp9BeGb29BXY6AsNPinfqjkr7Fg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"b4a": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/is-property": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
|
||||
"integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/kademlia-routing-table": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/kademlia-routing-table/-/kademlia-routing-table-1.0.6.tgz",
|
||||
"integrity": "sha512-Ve6jwIlUCYvUzBnXnzVRHDZCFgXURW9gmF3r7n05kZs/2rNbLHXwGdcq0qIaSwdmJCvtosgR4JensnVU65hzNQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bare-events": "^2.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/nanoassert": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-2.0.0.tgz",
|
||||
"integrity": "sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/nat-sampler": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/nat-sampler/-/nat-sampler-1.0.1.tgz",
|
||||
"integrity": "sha512-yQvyNN7xbqR8crTKk3U8gRgpcV1Az+vfCEijiHu9oHHsnIl8n3x+yXNHl42M6L3czGynAVoOT9TqBfS87gDdcw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/noise-curve-ed": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/noise-curve-ed/-/noise-curve-ed-2.1.0.tgz",
|
||||
"integrity": "sha512-zAzJx+VwZM3w6EA1hTmDhJfvAnCeBQn/1FAeZ0LtGxCcCtlAK/uJXQVF/eDVUOaAZ286lHlx77WJ+qj9SmsRRg==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"b4a": "^1.1.0",
|
||||
"nanoassert": "^2.0.0",
|
||||
"sodium-universal": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/noise-handshake": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/noise-handshake/-/noise-handshake-4.2.0.tgz",
|
||||
"integrity": "sha512-9O/VTNX/E2/AToyMTTDU0J/4WhaXMTdqc2DHs9vf+snoZ0cenSBq0dNYTVV1snYYEkmo6QeRrYMxtqtoYnY+LA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"b4a": "^1.1.0",
|
||||
"nanoassert": "^2.0.0",
|
||||
"sodium-universal": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.8.3",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz",
|
||||
"integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"prettier": "bin/prettier.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/protomux": {
|
||||
"version": "3.10.1",
|
||||
"resolved": "https://registry.npmjs.org/protomux/-/protomux-3.10.1.tgz",
|
||||
"integrity": "sha512-jgBqx8ZyaBWea/DFG4eOu1scOaeBwcnagiRC1XFVrjeGt7oAb0Pk5udPpBUpJ4DJBRjra50jD6YcZiQQTRqaaA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"b4a": "^1.3.1",
|
||||
"compact-encoding": "^2.5.1",
|
||||
"queue-tick": "^1.0.0",
|
||||
"safety-catch": "^1.0.1",
|
||||
"unslab": "^1.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/queue-tick": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz",
|
||||
"integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/quickbit-native": {
|
||||
"version": "2.4.8",
|
||||
"resolved": "https://registry.npmjs.org/quickbit-native/-/quickbit-native-2.4.8.tgz",
|
||||
"integrity": "sha512-FcCcqI+nIAWGknqhtrYT5TSD7t/N+Xd8ctM+2PrIIBuwOi5hx0SxAvuPtzLIEMfT/2h9+fhBakUe2uALOHX6yw==",
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"require-addon": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/quickbit-universal": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/quickbit-universal/-/quickbit-universal-2.2.0.tgz",
|
||||
"integrity": "sha512-w02i1R8n7+6pEKTud8DfF8zbFY9o7RtPlUc3jWbtCkDKvhbx/AvV7oNnz4/TcmsPGpSJS+fq5Ud6RH6+YPvSGg==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"b4a": "^1.6.0",
|
||||
"simdle-universal": "^1.1.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"quickbit-native": "^2.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/random-array-iterator": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/random-array-iterator/-/random-array-iterator-1.0.0.tgz",
|
||||
"integrity": "sha512-u7xCM93XqKEvPTP6xZp2ehttcAemKnh73oKNf1FvzuVCfpt6dILDt1Kxl1LeBjm2iNIeR49VGFhy4Iz3yOun+Q==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/ready-resource": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/ready-resource/-/ready-resource-1.2.0.tgz",
|
||||
"integrity": "sha512-nfcco/8iAFV0M+2PYnmIc+/xY0iRb35d42HFHQ7AfjulbGEAFa+XWpByfwSyeVeiBoMLLFVMv1HixxNCqzSQ1g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bare-events": "^2.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/record-cache": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/record-cache/-/record-cache-1.2.0.tgz",
|
||||
"integrity": "sha512-kyy3HWCez2WrotaL3O4fTn0rsIdfRKOdQQcEJ9KpvmKmbffKVvwsloX063EgRUlpJIXHiDQFhJcTbZequ2uTZw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"b4a": "^1.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/refcounter": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/refcounter/-/refcounter-1.0.0.tgz",
|
||||
"integrity": "sha512-1WosVzUy0kPUaPMEtlNDwm99UsteALIhXXR8rerELoa63WkYIXAl0hxgwPFrIYBRWZPGUyekQ04FRtPJ7dHk9w==",
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/require-addon": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/require-addon/-/require-addon-1.2.0.tgz",
|
||||
"integrity": "sha512-VNPDZlYgIYQwWp9jMTzljx+k0ZtatKlcvOhktZ/anNPI3dQ9NXk7cq2U4iJ1wd9IrytRnYhyEocFWbkdPb+MYA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"bare-addon-resolve": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"bare": ">=1.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/resolve-reject-promise": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-reject-promise/-/resolve-reject-promise-1.1.0.tgz",
|
||||
"integrity": "sha512-LWsTOA91AqzBTjSGgX79Tc130pwcBK6xjpJEO+qRT5IKZ6bGnHKcc8QL3upUBcWuU8OTIDzKK2VNSwmmlqvAVg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/resource-on-exit": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resource-on-exit/-/resource-on-exit-1.0.0.tgz",
|
||||
"integrity": "sha512-ViJwJAknCkLRJRPR+9SISQQ7R5eRgtdIHLJsM2hHx1MweAJbJxJ5XnMjjq0Lc7ZGv44ufzAqds1nKxiVkdy4ag==",
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/rocksdb-native": {
|
||||
"version": "3.15.0",
|
||||
"resolved": "https://registry.npmjs.org/rocksdb-native/-/rocksdb-native-3.15.0.tgz",
|
||||
"integrity": "sha512-czYx0hOzKAy+HYmJROZm7thvJ1tHFWHNkGI3nomumXWzrJghJdrWo4MIhehGX4OTff0lnOCoB2zu6ekzIKY0rQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"compact-encoding": "^2.15.0",
|
||||
"ready-resource": "^1.0.0",
|
||||
"refcounter": "^1.0.0",
|
||||
"require-addon": "^1.0.2",
|
||||
"resolve-reject-promise": "^1.1.0",
|
||||
"signal-promise": "^1.0.3",
|
||||
"streamx": "^2.16.1"
|
||||
},
|
||||
"engines": {
|
||||
"bare": ">=1.16.0"
|
||||
}
|
||||
},
|
||||
"node_modules/safety-catch": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/safety-catch/-/safety-catch-1.0.3.tgz",
|
||||
"integrity": "sha512-Zq+J1TefpoEq/HTUabo0YXX5MNvttjWYODGohgPBO2jfko8Wqx3JYMgE823szDFVamdH5PlpByvfiWScTdSYDA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/scope-lock": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/scope-lock/-/scope-lock-1.2.4.tgz",
|
||||
"integrity": "sha512-BpSd8VCuCxW9ZitcdIC/vjs3gMaP9bRBL5nkHcyfX2VrS52n13/rHuBA2xJ/S/4DPuRdAO/Bk8pWd8eD/gHCIA==",
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/shuffled-priority-queue": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/shuffled-priority-queue/-/shuffled-priority-queue-2.1.0.tgz",
|
||||
"integrity": "sha512-xhdh7fHyMsr0m/w2kDfRJuBFRS96b9l8ZPNWGaQ+PMvnUnZ/Eh+gJJ9NsHBd7P9k0399WYlCLzsy18EaMfyadA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"unordered-set": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/signal-promise": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/signal-promise/-/signal-promise-1.0.3.tgz",
|
||||
"integrity": "sha512-WBgv0UnIq2C+Aeh0/n+IRpP6967eIx9WpynTUoiW3isPpfe1zu2LJzyfXdo9Tgef8yR/sGjcMvoUXD7EYdiz+g==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/simdle-native": {
|
||||
"version": "1.3.9",
|
||||
"resolved": "https://registry.npmjs.org/simdle-native/-/simdle-native-1.3.9.tgz",
|
||||
"integrity": "sha512-Isc8sP4OiiIU0mpslD4GHEnR0VQWvR/54WN7YtwEDkNdTJVWtpmvsSvsgRlw5BNGxdYXlVRegdnrSu10H/PhvA==",
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"b4a": "^1.6.0",
|
||||
"require-addon": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/simdle-universal": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/simdle-universal/-/simdle-universal-1.1.2.tgz",
|
||||
"integrity": "sha512-3n3w1bs+uwgHKQjt6arez83EywNlhZzYvNOhvAASTl/8KqNIcqr6aHyGt3JRlfuUC7iB0tomJRPlJ2cRGIpBzA==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"b4a": "^1.6.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"simdle-native": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/sodium-native": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/sodium-native/-/sodium-native-5.1.0.tgz",
|
||||
"integrity": "sha512-3RxgyWyJlhTsABPnJVpCI5CoTDANZTqqFrEPqr+kjfnRaBihpVtMUE3yTF40ukdoB1APXeoBNKF3MzZAIHg39g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bare-assert": "^1.2.0",
|
||||
"require-addon": "^1.1.0",
|
||||
"which-runtime": "^1.2.1"
|
||||
},
|
||||
"engines": {
|
||||
"bare": ">=1.16.0"
|
||||
}
|
||||
},
|
||||
"node_modules/sodium-secretstream": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/sodium-secretstream/-/sodium-secretstream-1.2.0.tgz",
|
||||
"integrity": "sha512-q/DbraNFXm1KfCiiZvapmz5UC3OlpirYFIvBK2MhGaOFSb3gRyk8OXTi17UI9SGfshQNCpsVvlopogbzZNyW6Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"b4a": "^1.1.1",
|
||||
"sodium-universal": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/sodium-universal": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/sodium-universal/-/sodium-universal-5.0.1.tgz",
|
||||
"integrity": "sha512-rv+aH+tnKB5H0MAc2UadHShLMslpJsc4wjdnHRtiSIEYpOetCgu8MS4ExQRia+GL/MK3uuCyZPeEsi+J3h+Q+Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"sodium-native": "^5.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"sodium-javascript": "~0.8.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"sodium-javascript": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/streamx": {
|
||||
"version": "2.25.0",
|
||||
"resolved": "https://registry.npmjs.org/streamx/-/streamx-2.25.0.tgz",
|
||||
"integrity": "sha512-0nQuG6jf1w+wddNEEXCF4nTg3LtufWINB5eFEN+5TNZW7KWJp6x87+JFL43vaAUPyCfH1wID+mNVyW6OHtFamg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"events-universal": "^1.0.0",
|
||||
"fast-fifo": "^1.3.2",
|
||||
"text-decoder": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/teex": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/teex/-/teex-1.0.1.tgz",
|
||||
"integrity": "sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"streamx": "^2.12.5"
|
||||
}
|
||||
},
|
||||
"node_modules/text-decoder": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.7.tgz",
|
||||
"integrity": "sha512-vlLytXkeP4xvEq2otHeJfSQIRyWxo/oZGEbXrtEEF9Hnmrdly59sUbzZ/QgyWuLYHctCHxFF4tRQZNQ9k60ExQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"b4a": "^1.6.4"
|
||||
}
|
||||
},
|
||||
"node_modules/time-ordered-set": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/time-ordered-set/-/time-ordered-set-2.0.1.tgz",
|
||||
"integrity": "sha512-VJEKmgSN2UiOLB8BpN8Sh2b9LGMHTP5OPrQRpnKjvOheOyzk0mufbjzjKTIG2gO4A+Y+vDJ+0TcLbpUmMLsg8A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/timeout-refresh": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/timeout-refresh/-/timeout-refresh-2.0.1.tgz",
|
||||
"integrity": "sha512-SVqEcMZBsZF9mA78rjzCrYrUs37LMJk3ShZ851ygZYW1cMeIjs9mL57KO6Iv5mmjSQnOe/29/VAfGXo+oRCiVw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/udx-native": {
|
||||
"version": "1.19.2",
|
||||
"resolved": "https://registry.npmjs.org/udx-native/-/udx-native-1.19.2.tgz",
|
||||
"integrity": "sha512-RNYh+UhfryCsF5hE2ZOuIqcZ+qdipXK3UsarwxWJwsUQZFE3ybwz0mPjwb5ev1PMBcjFahWiepS/q0wwL51c2g==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"b4a": "^1.5.0",
|
||||
"bare-events": "^2.2.0",
|
||||
"require-addon": "^1.1.0",
|
||||
"streamx": "^2.22.0"
|
||||
},
|
||||
"engines": {
|
||||
"bare": ">=1.17.4"
|
||||
}
|
||||
},
|
||||
"node_modules/unordered-set": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/unordered-set/-/unordered-set-2.0.1.tgz",
|
||||
"integrity": "sha512-eUmNTPzdx+q/WvOHW0bgGYLWvWHNT3PTKEQLg0MAQhc0AHASHVHoP/9YytYd4RBVariqno/mEUhVZN98CmD7bg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/unslab": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/unslab/-/unslab-1.3.0.tgz",
|
||||
"integrity": "sha512-YATkfKAFj47kTzmiQrWXMyRvaVrHsW6MEALa4bm+FhiA2YG4oira+Z3DXN6LrYOYn2Y8eO94Lwl9DOHjs1FpoQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"b4a": "^1.6.6"
|
||||
}
|
||||
},
|
||||
"node_modules/which-runtime": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/which-runtime/-/which-runtime-1.3.2.tgz",
|
||||
"integrity": "sha512-5kwCfWml7+b2NO7KrLMhYihjRx0teKkd3yGp1Xk5Vaf2JGdSh+rgVhEALAD9c/59dP+YwJHXoEO7e8QPy7gOkw==",
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/xache": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/xache/-/xache-1.2.1.tgz",
|
||||
"integrity": "sha512-igRS6jPreJ54ABdzhh4mCDXcz+XMaWO2q1ABRV2yWYuk29jlp8VT7UBdCqNkX7rpYBbXsebVVKkwIuYZjyZNqA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/z32": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/z32/-/z32-1.1.0.tgz",
|
||||
"integrity": "sha512-1WUHy+VS6d0HPNspDxvLssBbeQjXMjSnpv0vH82vRAUfg847NmX3OXozp/hRP5jPhxBbrVzrgvAt+UsGNzRFQQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"b4a": "^1.5.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "hyperswarm-presence-demo",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "node -c index.js && npx prettier --check ."
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"b4a": "^1.8.0",
|
||||
"corestore": "^7.9.2",
|
||||
"hypercore": "^11.28.1",
|
||||
"hyperswarm": "^4.17.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier": "^3.8.3"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
# p2p-notes Production TODOs\n\n- [ ] Syntax check passes (node -c)\n- [ ] Code formatted with Prettier\n- [ ] Add unit tests (80% coverage)\n- [ ] Multi-peer e2e test script\n- [ ] Detailed README with usage\n- [ ] npm publish-ready
|
||||
@@ -3,6 +3,7 @@
|
||||
Basic P2P replication app using Holepunch stack.
|
||||
|
||||
## Run
|
||||
|
||||
```
|
||||
npm i
|
||||
node index.js writer # Appends msgs every 3s
|
||||
@@ -10,9 +11,10 @@ node index.js reader # Replicates on swarm connect
|
||||
```
|
||||
|
||||
## Verification
|
||||
|
||||
- Same core key via Corestore name ('test-core').
|
||||
- Fixed topic swarm.
|
||||
- Separate storages for concurrent runs.
|
||||
- Logs: 'New connection', 'Appended/Replicated #N'
|
||||
|
||||
Tested: Writer appends, ready for DHT discovery (slow on localhost).
|
||||
Tested: Writer appends, ready for DHT discovery (slow on localhost).
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
# simple-hypercore-swarm Production TODOs\n\n- [x] Syntax check passes (node -c)\n- [x] Code formatted with Prettier\n- [ ] Add unit tests (80% coverage)\n- [ ] Multi-peer e2e test script\n- [ ] Detailed README with usage & screenshots\n- [ ] npm publish-ready (types, keywords)
|
||||
@@ -1,42 +1,49 @@
|
||||
const Hyperswarm = require('hyperswarm')
|
||||
const Corestore = require('corestore')
|
||||
const Hyperswarm = require("hyperswarm");
|
||||
const Corestore = require("corestore");
|
||||
|
||||
async function run(mode) {
|
||||
const isWriter = mode === 'writer'
|
||||
const topic = Buffer.alloc(32).fill('simple hyperswarm hypercore test')
|
||||
const isWriter = mode === "writer";
|
||||
const topic = Buffer.alloc(32).fill("simple hyperswarm hypercore test");
|
||||
|
||||
console.log(`${isWriter ? 'Writer' : 'Reader'} starting...`)
|
||||
console.log(`${isWriter ? "Writer" : "Reader"} starting...`);
|
||||
|
||||
const corestore = new Corestore(isWriter ? './writer-storage' : './reader-storage')
|
||||
const core = corestore.get({ name: 'test-core', valueEncoding: 'utf-8' })
|
||||
await core.ready()
|
||||
console.log('Core public key:', core.key.toString('hex'))
|
||||
const corestore = new Corestore(
|
||||
isWriter ? "./writer-storage" : "./reader-storage",
|
||||
);
|
||||
const core = corestore.get({ name: "test-core", valueEncoding: "utf-8" });
|
||||
await core.ready();
|
||||
console.log("Core public key:", core.key.toString("hex"));
|
||||
|
||||
const swarm = new Hyperswarm()
|
||||
const discovery = swarm.join(topic, { server: true, client: true })
|
||||
const swarm = new Hyperswarm();
|
||||
const discovery = swarm.join(topic, { server: true, client: true });
|
||||
|
||||
swarm.on('connection', (conn, info) => {
|
||||
console.log('New connection:', isWriter ? 'from peer' : 'to peer', info ? (info.topics ? info.topics.length : 0) : 0, 'topics')
|
||||
corestore.replicate(conn)
|
||||
})
|
||||
swarm.on("connection", (conn, info) => {
|
||||
console.log(
|
||||
"New connection:",
|
||||
isWriter ? "from peer" : "to peer",
|
||||
info ? (info.topics ? info.topics.length : 0) : 0,
|
||||
"topics",
|
||||
);
|
||||
corestore.replicate(conn);
|
||||
});
|
||||
|
||||
core.on('append', () => {
|
||||
console.log(`${isWriter ? 'Appended' : 'Replicated'} #${core.length}`)
|
||||
})
|
||||
core.on("append", () => {
|
||||
console.log(`${isWriter ? "Appended" : "Replicated"} #${core.length}`);
|
||||
});
|
||||
|
||||
if (isWriter) {
|
||||
setInterval(async () => {
|
||||
const msg = `Hello from writer #${core.length} at ${new Date().toISOString()}`
|
||||
await core.append(msg)
|
||||
console.log('Sent:', msg)
|
||||
}, 3000)
|
||||
const msg = `Hello from writer #${core.length} at ${new Date().toISOString()}`;
|
||||
await core.append(msg);
|
||||
console.log("Sent:", msg);
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
await discovery.flushed()
|
||||
console.log('Joined swarm, ready for peers. Core length:', core.length)
|
||||
await discovery.flushed();
|
||||
console.log("Joined swarm, ready for peers. Core length:", core.length);
|
||||
|
||||
// Keep alive
|
||||
process.stdin.resume()
|
||||
process.stdin.resume();
|
||||
}
|
||||
|
||||
run(process.argv[2] || 'reader')
|
||||
run(process.argv[2] || "reader");
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
"hypercore": "^11.28.1",
|
||||
"hyperswarm": "^4.17.0",
|
||||
"random-access-memory": "^6.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier": "^3.8.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@hyperswarm/secret-stream": {
|
||||
@@ -625,6 +628,22 @@
|
||||
"sodium-universal": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.8.3",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz",
|
||||
"integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"prettier": "bin/prettier.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/protomux": {
|
||||
"version": "3.10.1",
|
||||
"resolved": "https://registry.npmjs.org/protomux/-/protomux-3.10.1.tgz",
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"test": "node -c index.js && npx prettier --check ."
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
@@ -14,5 +14,8 @@
|
||||
"hypercore": "^11.28.1",
|
||||
"hyperswarm": "^4.17.0",
|
||||
"random-access-memory": "^6.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier": "^3.8.3"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user