OverviewFilesCommitsIssuesDocsReleasesPeers

hypercompute commits / 0193114

deps: align on current holepunch stack + migrate storage to test-tmp
The dependency tree was never coherent: autobase 7.28.1 (hypercore 11) was paired with corestore ^6.18.4 (hypercore 10), and autobase-test-helpers ^2.2.0 does not exist on npm. Fresh installs failed outright. - corestore ^6.18.4 -> ^7.10.1 (hypercore 11, matches autobase) - autobase-test-helpers ^2.2.0 -> ^3.1.0 - corestore 7 is RocksDB-backed via hypercore-storage with no in-memory backend, so random-access-memory no longer works. Drop it; tests/demo now use test-tmp temp dirs (the current ecosystem convention). - ComputeNode.create now takes a Corestore or a path string (no ram default). - gitignore package-lock.json (holepunch repos don't track lockfiles). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
01931147d68a66be40c34eff3b3e15be9a31bdef
by plankatron <fleeky@gmail.com> · 2026-06-17T22:56:30.000Z

Changed files (5) +18 -16

.gitignore +1 -0
……@@ -1,4 +1,5 @@
11node_modules/
2package-lock.json
23*.log
34.DS_Store
45# local test/dev storage
index.js +4 -1
……@@ -16,7 +16,10 @@ async function demo () {
1616 const codeHash = 'square-v1'
1717 const executors = { [codeHash]: async (i) => i.n * i.n }
1818
19 const node = await ComputeNode.create(undefined, null, { executors })
19 // corestore 7 / hypercore 11 is RocksDB-backed (no in-memory backend) —
20 // the demo uses a throwaway temp dir.
21 const storage = '/tmp/hypercompute-demo-' + Date.now()
22 const node = await ComputeNode.create(storage, null, { executors })
2023 await node.grantSelf('owner')
2124
2225 const input = { n: 7 }
lib/node.js +4 -6
……@@ -7,7 +7,6 @@
77// via replicateAndSync (no network).
88
99const Corestore = require('corestore')
10const ram = require('random-access-memory')
1110const b4a = require('b4a')
1211const crypto = require('hypercore-crypto')
1312const { openPool, taskId, resultKey } = require('./pool')
……@@ -20,12 +19,11 @@ class ComputeNode {
2019 this.base = openPool(store, bootstrap)
2120 }
2221
23 // storage: a Corestore, a path string, or undefined (=> in-memory)
22 // storage: a Corestore instance, or a path string (corestore 7 / hypercore 11
23 // is RocksDB-backed via hypercore-storage — there is no random-access-memory
24 // backend in this era; tests/demos pass a temp dir).
2425 static async create (storage, bootstrap = null, opts = {}) {
25 let store = storage
26 if (!(storage instanceof Corestore)) {
27 store = new Corestore(storage || ram)
28 }
26 const store = storage instanceof Corestore ? storage : new Corestore(storage)
2927 const node = new ComputeNode(store, bootstrap, opts)
3028 await node.base.ready()
3129 return node
package.json +5 -5
……@@ -9,14 +9,14 @@
99 "dependencies": {
1010 "autobase": "^7.28.1",
1111 "b4a": "^1.6.7",
12 "corestore": "^6.18.4",
12 "corestore": "^7.10.1",
1313 "hyperbee": "^2.27.3",
14 "hypercore-crypto": "^3.6.1",
15 "random-access-memory": "^6.2.1"
14 "hypercore-crypto": "^3.6.1"
1615 },
1716 "devDependencies": {
18 "autobase-test-helpers": "^2.2.0",
19 "brittle": "^3.7.0"
17 "autobase-test-helpers": "^3.1.0",
18 "brittle": "^3.7.0",
19 "test-tmp": "^1.4.0"
2020 },
2121 "license": "MIT"
2222}
test/e2e.js +4 -4
……@@ -7,7 +7,7 @@
77
88const test = require('brittle')
99const Corestore = require('corestore')
10const ram = require('random-access-memory')
10const tmp = require('test-tmp')
1111const { replicateAndSync } = require('autobase-test-helpers')
1212const b4a = require('b4a')
1313const crypto = require('hypercore-crypto')
……@@ -24,10 +24,10 @@ test('P0: submit -> execute -> result converges + memoizes', async (t) => {
2424 const square = async (input) => input.n * input.n
2525 const executors = { [codeHash]: square }
2626
27 const owner = await ComputeNode.create(new Corestore(ram), null, { executors })
27 const owner = await ComputeNode.create(new Corestore(await tmp(t)), null, { executors })
2828 await owner.grantSelf('owner')
2929
30 const worker = await ComputeNode.create(new Corestore(ram), owner.key, { executors })
30 const worker = await ComputeNode.create(new Corestore(await tmp(t)), owner.key, { executors })
3131
3232 // P0 membership: owner adds the worker as an autobase writer + grants it.
3333 await owner.addWriter(worker.writerKey)
……@@ -66,7 +66,7 @@ test('P0: a different input is a separate content-addressed chunk', async (t) =>
6666 const codeHash = 'square-v1'
6767 const executors = { [codeHash]: async (i) => i.n * i.n }
6868
69 const owner = await ComputeNode.create(new Corestore(ram), null, { executors })
69 const owner = await ComputeNode.create(new Corestore(await tmp(t)), null, { executors })
7070 await owner.grantSelf('owner')
7171
7272 const ih = inputHashOf({ n: 9 })