Updates
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## [0.0.0-scaffold] — Wave 8
|
||||
|
||||
- Registry scaffold: file tree, load smoke tests, docs stubs
|
||||
@@ -0,0 +1,28 @@
|
||||
# hyper-p2p-peer-bootstrap-store
|
||||
|
||||
**Status:** scaffold (`0.0.0-scaffold`) · **Protocol:** `peer-bootstrap-store/v1` · **Wave:** 8
|
||||
|
||||
Bootstrap peer store.
|
||||
|
||||
## Holepunch references (inspiration only)
|
||||
|
||||
- (none yet)
|
||||
|
||||
> This module composes on Hyperswarm/Hypercore — it does **not** re-implement upstream packages.
|
||||
|
||||
## Composes with
|
||||
|
||||
- (none yet)
|
||||
|
||||
## Planned API
|
||||
|
||||
- `constructor(opts)` — topic, optional keyPair
|
||||
- `getStats()` — scaffold counters
|
||||
- `ready()` — no-op until implemented
|
||||
- Domain methods — throw `not implemented: scaffold` until Wave 8+ pass
|
||||
|
||||
## Layout
|
||||
|
||||
`modules/network-discovery/hyper-p2p-peer-bootstrap-store/`
|
||||
|
||||
See [`modules/_shared/MODULE_SYSTEM.md`](../../_shared/MODULE_SYSTEM.md).
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "hyper-p2p-peer-bootstrap-store",
|
||||
"category": "network-discovery",
|
||||
"tier": "scaffold",
|
||||
"protocol": "peer-bootstrap-store/v1",
|
||||
"class": "HyperP2PPeerBootstrapStore",
|
||||
"wave": 8,
|
||||
"holepunch_refs": [],
|
||||
"composes_with": [],
|
||||
"status": "scaffold"
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
# hyper-p2p-peer-bootstrap-store API
|
||||
|
||||
**Status:** scaffold · **Protocol:** `peer-bootstrap-store/v1`
|
||||
|
||||
## Class `HyperP2PPeerBootstrapStore`
|
||||
|
||||
Scaffold stub — methods throw `not implemented: scaffold` until promoted to production tier.
|
||||
|
||||
### `constructor(opts?)`
|
||||
|
||||
### `getStats()`
|
||||
|
||||
Returns `{ created, errors, protocol, tier: 'scaffold' }`.
|
||||
|
||||
### `ready()`
|
||||
|
||||
Resolves immediately (no-op).
|
||||
|
||||
## Wire (planned)
|
||||
|
||||
| Message | Direction | Notes |
|
||||
|---------|-----------|-------|
|
||||
| TBD | gossip | Defined in implementation pass |
|
||||
@@ -0,0 +1,15 @@
|
||||
# hyper-p2p-peer-bootstrap-store architecture
|
||||
|
||||
**Tier:** scaffold · **Category:** `network-discovery`
|
||||
|
||||
## Role
|
||||
|
||||
Bootstrap peer store.
|
||||
|
||||
## Composition
|
||||
|
||||
Uses `../../_shared/p2p-bare.js` for Hyperswarm + Protomux when implemented. Does **not** duplicate Holepunch core storage/transport.
|
||||
|
||||
## Holepunch boundary
|
||||
|
||||
Inspiration: n/a
|
||||
@@ -0,0 +1,8 @@
|
||||
require('bare-process/global')
|
||||
const { HyperP2PPeerBootstrapStore } = require('../index.js')
|
||||
|
||||
async function main () {
|
||||
const m = new HyperP2PPeerBootstrapStore()
|
||||
console.log('[scaffold]', m.getStats())
|
||||
}
|
||||
main().catch(console.error)
|
||||
@@ -0,0 +1,25 @@
|
||||
require('bare-process/global')
|
||||
const EventEmitter = require('bare-events')
|
||||
|
||||
const PROTOCOL = 'peer-bootstrap-store/v1'
|
||||
|
||||
class HyperP2PPeerBootstrapStore extends EventEmitter {
|
||||
constructor (opts = {}) {
|
||||
super()
|
||||
this.topic = opts.topic || null
|
||||
this._stats = { created: 0, errors: 0 }
|
||||
}
|
||||
|
||||
getStats () {
|
||||
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' }
|
||||
}
|
||||
|
||||
async ready () { return true }
|
||||
|
||||
_notImplemented (method) {
|
||||
this._stats.errors++
|
||||
throw new Error(`not implemented: scaffold (${method})`)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { HyperP2PPeerBootstrapStore, PROTOCOL }
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "hyper-p2p-peer-bootstrap-store",
|
||||
"version": "0.0.0-scaffold",
|
||||
"description": "Bootstrap peer store.",
|
||||
"main": "index.js",
|
||||
"type": "commonjs",
|
||||
"license": "Apache-2.0",
|
||||
"scripts": { "test": "brittle-bare test/test.js" },
|
||||
"dependencies": {
|
||||
"bare-events": "^2.8.0",
|
||||
"bare-process": "^4.4.0",
|
||||
"bare-timers": "^2.0.0",
|
||||
"b4a": "^1.6.7",
|
||||
"hypercore-crypto": "^3.0.0",
|
||||
"protomux": "^3.0.0",
|
||||
"compact-encoding": "^2.0.0"
|
||||
},
|
||||
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
|
||||
"devDependencies": { "brittle": "^3.0.0" },
|
||||
"imports": {
|
||||
"process": { "bare": "bare-process", "default": "process" },
|
||||
"events": { "bare": "bare-events", "default": "events" },
|
||||
"timers": { "bare": "bare-timers", "default": "timers" }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
const test = require('brittle')
|
||||
const { HyperP2PPeerBootstrapStore, PROTOCOL } = require('../index.js')
|
||||
|
||||
test('exports load', (t) => {
|
||||
t.ok(HyperP2PPeerBootstrapStore)
|
||||
t.is(PROTOCOL, 'peer-bootstrap-store/v1')
|
||||
})
|
||||
|
||||
test('getStats shape', async (t) => {
|
||||
const m = new HyperP2PPeerBootstrapStore()
|
||||
const s = m.getStats()
|
||||
t.is(s.tier, 'scaffold')
|
||||
t.is(s.protocol, 'peer-bootstrap-store/v1')
|
||||
})
|
||||
Reference in New Issue
Block a user