feat(modules): deepen trust, experimental, routing, and search
Hyper-P2P Module Tests / unit-all (push) Failing after 1h17m5s
Hyper-P2P Module Tests / unit-all (push) Failing after 1h17m5s
Session revoke and encrypted-topic JSON helpers; silence/void channel snapshots; relay tunnel route listing; grow-only set algebra; CPU top donors; attestation chain slice/export; fulltext bulk and top terms. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -59,6 +59,29 @@ class HyperP2PAttestationChain extends EventEmitter {
|
||||
|
||||
chainLength () { return this._chain.length }
|
||||
|
||||
at (index) {
|
||||
if (index < 0 || index >= this._chain.length) return null
|
||||
return { ...this._chain[index] }
|
||||
}
|
||||
|
||||
slice (from = 0, to = this._chain.length) {
|
||||
return this._chain.slice(from, to).map((l) => ({ ...l }))
|
||||
}
|
||||
|
||||
payloads () {
|
||||
return this._chain.map((l) => l.payload)
|
||||
}
|
||||
|
||||
toJSON () {
|
||||
return { chain: this.slice() }
|
||||
}
|
||||
|
||||
fromJSON (snap) {
|
||||
if (!snap || !Array.isArray(snap.chain)) throw new Error('invalid snapshot')
|
||||
this._chain = snap.chain.map((l) => ({ ...l }))
|
||||
return this._chain.length
|
||||
}
|
||||
|
||||
async ready () {
|
||||
if (this.swarm || !this.topic) return this
|
||||
await initModuleSwarm(this, {
|
||||
|
||||
Reference in New Issue
Block a user