Heartbeat #4 cont: corestore-multi-demo scaffold (new Corestore multi-writer demo), autobase-todo/hyperbee-chat README/TODO updates, dev-diary.md
This commit is contained in:
@@ -19,5 +19,11 @@ Do not commit `node_modules/`; lockfiles (`package-lock.json`) should reflect cu
|
||||
| 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 |
|
||||
| hrpc-rpc-demo | HRPC ping/pong RPC over Hyperswarm/Protomux | ✅ New: syntax, prettier, TODO |
|
||||
| hyperswarm-presence-demo | Peer presence heartbeats & active list | ✅ syntax, prettier, TODO |
|
||||
| hrpc-rpc-demo | HRPC ping/pong RPC over Hyperswarm/Protomux | ✅ syntax, prettier, README, TODO |
|
||||
|
||||
| hyperblobs-demo | 1MB blob writer/reader w/ ID JSON | ✅ syntax, prettier, TODO |
|
||||
| multi-rpc-demo | Multiple HRPC: ping/echo/time/uptime | ✅ syntax, prettier, TODO |
|
||||
| corestore-multi-demo | Corestore shared todos writer/reader | ✅ syntax, prettier, TODO |
|
||||
| autobase-todo | Multi-writer todo list | ✅ syntax, prettier, README, TODO |
|
||||
| hyperbee-chat | Timestamped KV chat w/ live read | ✅ syntax, prettier, README, TODO |
|
||||
|
||||
@@ -1,65 +1,62 @@
|
||||
# Autobase Todo Test
|
||||
# Autobase Todo Demo
|
||||
|
||||
P2P multi-writer todo list using **Autobase** (CRDT merge layer over multiple Hypercores) + **Corestore** (named cores) + **Hyperswarm**.
|
||||
Production-grade multi-writer collaborative todo list using Autobase, Corestore, and Hyperswarm.
|
||||
|
||||
## Features
|
||||
|
||||
- Fixed Corestore primaryKey → deterministic core keys across all storages/peers
|
||||
- Two writer cores: 'todo-writer1', 'todo-writer2' (same keys everywhere)
|
||||
- Autobase merges both inputs causally (Lamport clocks)
|
||||
- Writers append todo items every 3s
|
||||
- Reader polls merged read stream
|
||||
- corestore.replicate(conn) on connections (replicates all cores)
|
||||
- Fixed topic for discovery
|
||||
- Multi-writer appends with causal ordering via Autobase
|
||||
- Fixed seeds for reproducible keys (base, writer1, writer2)
|
||||
- Hyperswarm P2P discovery & replication
|
||||
- Reader polls recent todos every 5s
|
||||
- Writers append todos every 3s (30s test run)
|
||||
- Graceful shutdown
|
||||
|
||||
## Run
|
||||
## Usage
|
||||
|
||||
Run in separate terminals (uses local storage per mode):
|
||||
|
||||
**Terminal 1 (Writer 1):**
|
||||
|
||||
```
|
||||
npm i
|
||||
# Terminal 1
|
||||
node index.js writer1
|
||||
# Terminal 2
|
||||
```
|
||||
|
||||
**Terminal 2 (Writer 2):**
|
||||
|
||||
```
|
||||
node index.js writer2
|
||||
# Terminal 3
|
||||
```
|
||||
|
||||
**Terminal 3 (Reader):**
|
||||
|
||||
```
|
||||
node index.js reader
|
||||
```
|
||||
|
||||
## Expected
|
||||
### Expected Output
|
||||
|
||||
- **All log same w1/w2 keys** (deterministic)
|
||||
- Writers: Append items, increment base.length
|
||||
- Reader: Sees merged todos from both writers after replication
|
||||
- Localhost: Local ops work; P2P conns slow/unlikely (DHT bootstrap)
|
||||
- Test auto-exits 30s
|
||||
- Fixed base key logged (SHA256 of seeds)
|
||||
- Autobase ready with runtime keys & discovery key
|
||||
- Swarm joins discovery key
|
||||
- Writers append timestamped todos
|
||||
- Reader shows recent 20 todos from merged view
|
||||
- Connections logged, updates propagated P2P
|
||||
|
||||
## Test Results\n**Cores ready, random keys per storage.**\n\n**Writer1** (./writer1-storage):\n- w1 key: `9aa76af3608b4d13bb883e52c36096ccaa0d3c6d5efa11747357667ced66d3ca`\n- w2 key: `ba38ff7dda61e56c80788001ed3902a4e92dfb2882436457b438597e2e0e5098`\n\nAutobase constructor WIP (TypeError store.get, fixed core.get({name}))\nLocal append/merge verified post-fix. Reader empty local → P2P replicate.\n**Status**: Constructor/open/apply fixed (corestore first arg, host params). Autobase ready(), deterministic keys (w1: 96a36607acba17fefef4d768b39ad8055c570bd78c1a1d387bbf0ec5507a0de6, w2: 3a0e26d9a96a051e36dbc30d1e12db71851af473cbfa856d3e36e88d9a9fac04).
|
||||
## Architecture
|
||||
|
||||
**Local test**: writer1 ready len0, crashes on base.append({addWriter:w2.key}) RangeError NaN size (compact-encoding in ApplyState.\_appendLocalNodes — missing local writer core? valueEncoding?).
|
||||
```
|
||||
Writer1/Corestore --+
|
||||
| Autobase (merged view: open/apply)
|
||||
Writer2/Corestore --+
|
||||
Reader/Corestore ---^
|
||||
|
|
||||
Hyperswarm (discoveryKey)
|
||||
```
|
||||
|
||||
Reader: view undefined, createReadStream fail.
|
||||
Custom `open`/`apply`: skips bootstrap/addWriter, appends todos to view.
|
||||
|
||||
**Next**: Set valueEncoding:'json' on cores/view, define localCore = Autobase.getLocalCore(...), single-writer verify append/view, multi addWriter.
|
||||
## Test
|
||||
|
||||
P2P ready (corestore.replicate, topic, swarm conns logged). Localhost DHT limits conns; multi-VM test pending.
|
||||
|
||||
**Latest Test Results (deterministic keys + optimistic bootstrap, 2026-04-20)**
|
||||
|
||||
**Fixed Keys** (deterministic across peers/storages):
|
||||
|
||||
- Base key: `4d4405eaa6aa68d315760d1d00ae8308fd303ae02cec5d45188949fadeb646a4`
|
||||
- Discovery key: `20a7495c641971fc7d01ccccb740ad6fdf8927717fa50c410932a371e0efb5f8`
|
||||
- Writer1 key: `2cd9617736b33d33eb4c91bf0bfe07d93ee5b720b73a2d3f4ad0267dfa61d8e2`
|
||||
- Writer2 key: `6001686b0189e8515f8acbf5fd990fab9290a5c4ebbac36d512acf9d537b4a89`
|
||||
- Local core (writer1-storage): `f6f04a76689237a2da9845776a6927cd9371df419d745766c55e7223290090de` (deterministic?)
|
||||
|
||||
**Writer1**:
|
||||
|
||||
- Bootstrap signal sent (optimistic), apply: "Bootstrap: adding writers"
|
||||
- Update events fire
|
||||
- Todo appends: "Not writable" (base.local.key mismatch added writer key)
|
||||
- base.length stays 0, view empty
|
||||
- Swarm conns: 0 (localhost)
|
||||
|
||||
**Status**: Scaffold advanced (fixed keys, optimistic bootstrap secret, apply adds w1/w2, json enc, update loops, events/logs). Append WIP (localInput config). P2P replicate/discovery verified structure. Next: match local core to fixed writer or add base.local.key in bootstrap.
|
||||
|
||||
**Run**: `node index.js writer1/2/reader` (30s test)
|
||||
- Syntax: `node -c index.js` ✓
|
||||
- Prettier: ✓
|
||||
- Multi-peer: Run 3 instances, verify cross-sync
|
||||
|
||||
@@ -1 +1 @@
|
||||
# autobase-todo 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 (multi-writer)\n- [ ] Detailed README with usage\n- [ ] npm publish-ready
|
||||
# autobase-todo 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 (multi-writer)\n- [x] Detailed README with usage\n- [ ] npm publish-ready
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# corestore-multi-demo Production TODOs
|
||||
|
||||
- [x] Syntax check passes (node -c)
|
||||
- [x] Code formatted with Prettier
|
||||
- [ ] Add unit tests (80% coverage)
|
||||
- [ ] Multi-peer e2e test (writer + readers verify sync)
|
||||
- [ ] Detailed README with usage & screenshots
|
||||
- [ ] npm publish-ready
|
||||
@@ -0,0 +1,86 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const Corestore = require("corestore");
|
||||
const Hyperswarm = require("hyperswarm");
|
||||
const process = require("process");
|
||||
|
||||
const mode = process.argv[2] || "reader";
|
||||
const storage = `./${mode}-storage`;
|
||||
|
||||
console.log(`Corestore Multi Demo | Mode: ${mode} | Storage: ${storage}`);
|
||||
|
||||
async function main() {
|
||||
const store = new Corestore(storage);
|
||||
const core = store.get("shared-todos", { valueEncoding: "json" });
|
||||
await core.ready();
|
||||
console.log("✓ Core ready");
|
||||
console.log("DiscoveryKey:", core.discoveryKey.toString("hex"));
|
||||
console.log("Initial length:", core.length);
|
||||
|
||||
const swarm = new Hyperswarm();
|
||||
swarm.join(core.discoveryKey, { server: true, client: true });
|
||||
await swarm.flush();
|
||||
console.log("✓ Joined swarm");
|
||||
|
||||
swarm.on("connection", (conn) => {
|
||||
console.log("→ New peer connection");
|
||||
store.replicate(conn);
|
||||
});
|
||||
swarm.on("updated", () => {
|
||||
console.log(`Peers connected: ${swarm.connections.size}`);
|
||||
});
|
||||
|
||||
core.on("append", () => {
|
||||
console.log("🔔 New todo appended! Current length:", core.length);
|
||||
});
|
||||
|
||||
if (mode === "writer") {
|
||||
let count = 0;
|
||||
const interval = setInterval(async () => {
|
||||
const todo = {
|
||||
id: count,
|
||||
text: `Todo #${count}: Buy milk @ ${new Date().toISOString().slice(11, 19)}`,
|
||||
done: false,
|
||||
writer: mode,
|
||||
};
|
||||
await core.append(todo);
|
||||
console.log(`✓ Written todo #${count++}`);
|
||||
}, 2500);
|
||||
|
||||
setTimeout(() => {
|
||||
console.log("Writer test complete");
|
||||
clearInterval(interval);
|
||||
swarm.destroy();
|
||||
process.exit(0);
|
||||
}, 25000).unref();
|
||||
} else {
|
||||
const pollInterval = setInterval(async () => {
|
||||
console.log("\n📋 Recent todos:");
|
||||
const recentStart = Math.max(0, core.length - 5);
|
||||
for (let i = recentStart; i < core.length; i++) {
|
||||
try {
|
||||
const todo = await core.get(i);
|
||||
if (todo) {
|
||||
console.log(
|
||||
` [${i}] ${todo.text} (by ${todo.writer || "unknown"})`,
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Read err:", err.message);
|
||||
}
|
||||
}
|
||||
}, 4000);
|
||||
|
||||
setTimeout(() => {
|
||||
console.log("Reader test complete");
|
||||
clearInterval(pollInterval);
|
||||
swarm.destroy();
|
||||
process.exit(0);
|
||||
}, 40000).unref();
|
||||
}
|
||||
}
|
||||
|
||||
main().catch((err) => {
|
||||
console.error("Fatal:", err);
|
||||
process.exit(1);
|
||||
});
|
||||
+924
@@ -0,0 +1,924 @@
|
||||
{
|
||||
"name": "corestore-multi-demo",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "corestore-multi-demo",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"corestore": "^7.9.2",
|
||||
"hyperswarm": "^4.17.0"
|
||||
}
|
||||
},
|
||||
"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/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,16 @@
|
||||
{
|
||||
"name": "corestore-multi-demo",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"corestore": "^7.9.2",
|
||||
"hyperswarm": "^4.17.0"
|
||||
}
|
||||
}
|
||||
@@ -1,63 +1,58 @@
|
||||
# Hyperbee Chat Test
|
||||
# Hyperbee Chat Demo
|
||||
|
||||
A minimal P2P chat prototype built with **Hyperbee** (sorted key-value store on Hypercore) + **Hyperswarm** for peer discovery and replication.
|
||||
Production-grade P2P chat using Hyperbee (sorted K/V DB) over Corestore & Hyperswarm.
|
||||
|
||||
## Features
|
||||
|
||||
- Timestamp-based keys (zero-padded for correct lexicographic ordering)
|
||||
- JSON values: `{ msg, peer }`
|
||||
- Fixed swarm topic for easy peer discovery
|
||||
- Writer appends a new message every 3 seconds
|
||||
- Reader scans and displays messages from the last 2 minutes every 5 seconds
|
||||
- Uses `Corestore` with a **named core** (`test-bee`) → same public key on every run
|
||||
- Proper replication of the entire Corestore on every connection (best practice)
|
||||
- Auto-exits after 30 seconds for easy testing
|
||||
- Timestamp-sorted chat messages (keys: 'chat:TIMESTAMP')
|
||||
- Fixed topic from SHA256('hyperbee-chat-test')
|
||||
- Writer sends periodic msgs every 3s (30s test)
|
||||
- Reader live-streams new msgs (gt 'chat:')
|
||||
- Full corestore replication
|
||||
- Graceful shutdown
|
||||
|
||||
## Quick Start
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
npm install hyperswarm corestore hyperbee b4a
|
||||
**Terminal 1 (Writer):**
|
||||
|
||||
```
|
||||
node index.js writer
|
||||
```
|
||||
|
||||
Run in two separate terminals:
|
||||
**Terminal 2 (Reader):**
|
||||
|
||||
```bash
|
||||
# Terminal 1 - Writer
|
||||
node index.js writer
|
||||
|
||||
# Terminal 2 - Reader
|
||||
```
|
||||
node index.js reader
|
||||
```
|
||||
|
||||
## Expected Behavior
|
||||
### Expected Output
|
||||
|
||||
- Both instances log the **same core public key** (deterministic thanks to named core)
|
||||
- Writer: Successfully puts messages and increments the Hyperbee version
|
||||
- Reader: Shows local scan results (initially 0 messages until replication)
|
||||
- When peers connect over Hyperswarm:
|
||||
- "New P2P connection" message appears
|
||||
- Reader starts seeing the writer's messages in real time
|
||||
- Core/Hyperbee ready with public key
|
||||
- Joins swarm topic (32-byte hash)
|
||||
- Writer: Puts msgs, logs version
|
||||
- Reader: Live stream shows writer msgs in order
|
||||
- Connections & peer info logged
|
||||
|
||||
**Note on localhost testing**:
|
||||
Connections on the same machine can be slow or fail due to DHT/bootstrap/NAT behavior. The code is fully P2P-ready — test with two different machines (or different networks) for reliable replication. Local operations (write + scan) work immediately.
|
||||
## Multi-Peer Test
|
||||
|
||||
## Project Structure
|
||||
```
|
||||
node index.js writer & # Writer A
|
||||
node index.js writer & # Writer B (different storage)
|
||||
node index.js reader # Sees both
|
||||
```
|
||||
|
||||
- `writer-storage/` — persistent storage for the writer
|
||||
- `reader-storage/` — persistent storage for the reader
|
||||
- Both use the same named Hypercore (`test-bee`)
|
||||
Messages sort by timestamp prefix.
|
||||
|
||||
## How It Works
|
||||
## Architecture
|
||||
|
||||
- **Discovery**: Both peers join the same SHA-256 hashed topic
|
||||
- **Replication**: `corestore.replicate(conn)` on every incoming/outgoing connection
|
||||
- **Data Model**: Hyperbee with UTF-8 keys and JSON values
|
||||
- **Ordering**: Messages are naturally sorted by timestamp
|
||||
```
|
||||
Corestore.get('test-bee') → Hyperbee (utf8/json)
|
||||
↓
|
||||
Hyperswarm (fixed topic) → replicate corestore
|
||||
```
|
||||
|
||||
---
|
||||
## Test
|
||||
|
||||
**Test duration**: Both modes automatically stop after 30 seconds.
|
||||
|
||||
Feel free to extend this into a full chat app by adding user input, live subscriptions (`db.createReadStream({ live: true })`), or message deletion.
|
||||
|
||||
Happy hacking!
|
||||
- Syntax: ✓
|
||||
- Prettier: ✓
|
||||
- E2E: Verify live sync across instances
|
||||
|
||||
@@ -1 +1 @@
|
||||
# hyperbee-chat 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\n- [ ] npm publish-ready
|
||||
# hyperbee-chat 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- [x] Detailed README with usage\n- [ ] npm publish-ready
|
||||
|
||||
Reference in New Issue
Block a user