This commit is contained in:
Raven Scott
2026-05-20 21:57:50 -04:00
parent c5d54be3ca
commit 341542f41b
426 changed files with 18651 additions and 3519 deletions
+87 -87
View File
@@ -17,24 +17,24 @@ Source of truth: [`MODULE_REGISTRY.yaml`](MODULE_REGISTRY.yaml).
## Applications (collaboration) (`applications-collab`) — 4 modules ## Applications (collaboration) (`applications-collab`) — 4 modules
- 🟡 **hyper-p2p-collab-room**`collab-room/v1` (scaffold) - 🟢 **hyper-p2p-collab-room**`collab-room/v1` (production)
- 🟡 **hyper-p2p-cursor-presence**`cursor-presence/v1` (scaffold) - 🟢 **hyper-p2p-cursor-presence**`cursor-presence/v1` (production)
- 🟡 **hyper-p2p-document-line-lock**`document-line-lock/v1` (scaffold) - 🟢 **hyper-p2p-document-line-lock**`document-line-lock/v1` (production)
- 🟡 **hyper-p2p-whiteboard-op**`whiteboard-op/v1` (scaffold) - 🟢 **hyper-p2p-whiteboard-op**`whiteboard-op/v1` (production)
## Applications (economy) (`applications-economy`) — 3 modules ## Applications (economy) (`applications-economy`) — 3 modules
- 🟡 **hyper-p2p-auction-gossip**`auction-gossip/v1` (scaffold) - 🟢 **hyper-p2p-auction-gossip**`auction-gossip/v1` (production)
- 🟡 **hyper-p2p-credit-ledger**`credit-ledger/v1` (scaffold) - 🟢 **hyper-p2p-credit-ledger**`credit-ledger/v1` (production)
- 🟡 **hyper-p2p-marketplace-listing**`marketplace-listing/v1` (scaffold) - 🟢 **hyper-p2p-marketplace-listing**`marketplace-listing/v1` (production)
## Consensus & coordination (`consensus-coordination`) — 5 modules ## Consensus & coordination (`consensus-coordination`) — 5 modules
- 🟢 **hyper-p2p-causal-consensus**`causal-consensus/v1` (production) - 🟢 **hyper-p2p-causal-consensus**`causal-consensus/v1` (production)
- 🟢 **hyper-p2p-distributed-lock**`distributed-lock/v1` (production) - 🟢 **hyper-p2p-distributed-lock**`distributed-lock/v1` (production)
- 🟡 **hyper-p2p-leader-lease**`leader-lease/v1` (scaffold) - 🟢 **hyper-p2p-leader-lease**`leader-lease/v1` (production)
- 🟢 **hyper-p2p-quorum-pool**`quorum-pool/v1` (production) - 🟢 **hyper-p2p-quorum-pool**`quorum-pool/v1` (production)
- 🟡 **hyper-p2p-raft-lite**`raft-lite/v1` (scaffold) - 🟢 **hyper-p2p-raft-lite**`raft-lite/v1` (production)
## Core infrastructure (`core-infrastructure`) — 5 modules ## Core infrastructure (`core-infrastructure`) — 5 modules
@@ -46,10 +46,10 @@ Source of truth: [`MODULE_REGISTRY.yaml`](MODULE_REGISTRY.yaml).
## Encoding & wire formats (`encoding-wire`) — 4 modules ## Encoding & wire formats (`encoding-wire`) — 4 modules
- 🟡 **hyper-p2p-compact-codec-bridge**`compact-codec-bridge/v1` (scaffold) - 🟢 **hyper-p2p-compact-codec-bridge**`compact-codec-bridge/v1` (production)
- 🟡 **hyper-p2p-message-envelope**`message-envelope/v1` (scaffold) - 🟢 **hyper-p2p-message-envelope**`message-envelope/v1` (production)
- 🟡 **hyper-p2p-schema-validator**`schema-validator/v1` (scaffold) - 🟢 **hyper-p2p-schema-validator**`schema-validator/v1` (production)
- 🟡 **hyper-p2p-wire-registry**`wire-registry/v1` (scaffold) - 🟢 **hyper-p2p-wire-registry**`wire-registry/v1` (production)
## Experimental (Wave 4) (`experimental`) — 10 modules ## Experimental (Wave 4) (`experimental`) — 10 modules
@@ -66,30 +66,30 @@ Source of truth: [`MODULE_REGISTRY.yaml`](MODULE_REGISTRY.yaml).
## Experimental (Wave 5) (`experimental-wave5`) — 6 modules ## Experimental (Wave 5) (`experimental-wave5`) — 6 modules
- 🟡 **hyper-p2p-entropy-spiral**`entropy-spiral/v1` (scaffold) - 🟢 **hyper-p2p-entropy-spiral**`entropy-spiral/v1` (production)
- 🟡 **hyper-p2p-memetic-spread**`memetic-spread/v1` (scaffold) - 🟢 **hyper-p2p-memetic-spread**`memetic-spread/v1` (production)
- 🟡 **hyper-p2p-paradox-merge**`paradox-merge/v1` (scaffold) - 🟢 **hyper-p2p-paradox-merge**`paradox-merge/v1` (production)
- 🟡 **hyper-p2p-phase-shift-clock**`phase-shift-clock/v1` (scaffold) - 🟢 **hyper-p2p-phase-shift-clock**`phase-shift-clock/v1` (production)
- 🟡 **hyper-p2p-tension-field**`tension-field/v1` (scaffold) - 🟢 **hyper-p2p-tension-field**`tension-field/v1` (production)
- 🟡 **hyper-p2p-void-channel**`void-channel/v1` (scaffold) - 🟢 **hyper-p2p-void-channel**`void-channel/v1` (production)
## Indexes & search (`indexes-search`) — 8 modules ## Indexes & search (`indexes-search`) — 8 modules
- 🟡 **hyper-p2p-bloom-gossip**`bloom-gossip/v1` (scaffold) - 🟢 **hyper-p2p-bloom-gossip**`bloom-gossip/v1` (production)
- 🟡 **hyper-p2p-fulltext-lite**`fulltext-lite/v1` (scaffold) - 🟢 **hyper-p2p-fulltext-lite**`fulltext-lite/v1` (production)
- 🟡 **hyper-p2p-graph-index**`graph-index/v1` (scaffold) - 🟢 **hyper-p2p-graph-index**`graph-index/v1` (production)
- 🟡 **hyper-p2p-inverted-index**`inverted-index/v1` (scaffold) - 🟢 **hyper-p2p-inverted-index**`inverted-index/v1` (production)
- 🟢 **hyper-p2p-semantic-vector-index**`semantic-vector-index/v1` (production) - 🟢 **hyper-p2p-semantic-vector-index**`semantic-vector-index/v1` (production)
- 🟡 **hyper-p2p-similarity-lsh**`similarity-lsh/v1` (scaffold) - 🟢 **hyper-p2p-similarity-lsh**`similarity-lsh/v1` (production)
- 🟡 **hyper-p2p-trie-prefix**`trie-prefix/v1` (scaffold) - 🟢 **hyper-p2p-trie-prefix**`trie-prefix/v1` (production)
- 🟢 **hyper-spatial-index**`spatial-index/v1` (production) - 🟢 **hyper-spatial-index**`spatial-index/v1` (production)
## Measurement & rate control (`measurement-rate-control`) — 4 modules ## Measurement & rate control (`measurement-rate-control`) — 4 modules
- 🟢 **hyper-p2p-bucket-rate-limit**`bucket-rate-limit/v1` (production) - 🟢 **hyper-p2p-bucket-rate-limit**`bucket-rate-limit/v1` (production)
- 🟡 **hyper-p2p-histogram-gossip**`histogram-gossip/v1` (scaffold) - 🟢 **hyper-p2p-histogram-gossip**`histogram-gossip/v1` (production)
- 🟡 **hyper-p2p-percentile-sketch**`percentile-sketch/v1` (scaffold) - 🟢 **hyper-p2p-percentile-sketch**`percentile-sketch/v1` (production)
- 🟡 **hyper-p2p-sla-budget**`sla-budget/v1` (scaffold) - 🟢 **hyper-p2p-sla-budget**`sla-budget/v1` (production)
## Messaging & gossip (`messaging-gossip`) — 3 modules ## Messaging & gossip (`messaging-gossip`) — 3 modules
@@ -99,27 +99,27 @@ Source of truth: [`MODULE_REGISTRY.yaml`](MODULE_REGISTRY.yaml).
## Messaging pub/sub (`messaging-pubsub`) — 4 modules ## Messaging pub/sub (`messaging-pubsub`) — 4 modules
- 🟡 **hyper-p2p-qos-topic**`qos-topic/v1` (scaffold) - 🟢 **hyper-p2p-qos-topic**`qos-topic/v1` (production)
- 🟡 **hyper-p2p-retained-messages**`retained-messages/v1` (scaffold) - 🟢 **hyper-p2p-retained-messages**`retained-messages/v1` (production)
- 🟡 **hyper-p2p-subscription-lease**`subscription-lease/v1` (scaffold) - 🟢 **hyper-p2p-subscription-lease**`subscription-lease/v1` (production)
- 🟡 **hyper-p2p-topic-channel**`topic-channel/v1` (scaffold) - 🟢 **hyper-p2p-topic-channel**`topic-channel/v1` (production)
## Messaging streams (`messaging-streams`) — 6 modules ## Messaging streams (`messaging-streams`) — 6 modules
- 🟡 **hyper-p2p-stream-backpressure**`stream-backpressure/v1` (scaffold) - 🟢 **hyper-p2p-stream-backpressure**`stream-backpressure/v1` (production)
- 🟡 **hyper-p2p-stream-chunker**`stream-chunker/v1` (scaffold) - 🟢 **hyper-p2p-stream-chunker**`stream-chunker/v1` (production)
- 🟡 **hyper-p2p-stream-multiplex**`stream-multiplex/v1` (scaffold) - 🟢 **hyper-p2p-stream-multiplex**`stream-multiplex/v1` (production)
- 🟡 **hyper-p2p-stream-resume-token**`stream-resume-token/v1` (scaffold) - 🟢 **hyper-p2p-stream-resume-token**`stream-resume-token/v1` (production)
- 🟡 **hyper-p2p-stream-tee**`stream-tee/v1` (scaffold) - 🟢 **hyper-p2p-stream-tee**`stream-tee/v1` (production)
- 🟡 **hyper-p2p-stream-transform**`stream-transform/v1` (scaffold) - 🟢 **hyper-p2p-stream-transform**`stream-transform/v1` (production)
## Network discovery (`network-discovery`) — 5 modules ## Network discovery (`network-discovery`) — 5 modules
- 🟡 **hyper-p2p-capability-discovery**`capability-discovery/v1` (scaffold) - 🟢 **hyper-p2p-capability-discovery**`capability-discovery/v1` (production)
- 🟡 **hyper-p2p-discovery-health**`discovery-health/v1` (scaffold) - 🟢 **hyper-p2p-discovery-health**`discovery-health/v1` (production)
- 🟡 **hyper-p2p-peer-bootstrap-store**`peer-bootstrap-store/v1` (scaffold) - 🟢 **hyper-p2p-peer-bootstrap-store**`peer-bootstrap-store/v1` (production)
- 🟡 **hyper-p2p-seeder-registry**`seeder-registry/v1` (scaffold) - 🟢 **hyper-p2p-seeder-registry**`seeder-registry/v1` (production)
- 🟡 **hyper-p2p-topic-announcer**`topic-announcer/v1` (scaffold) - 🟢 **hyper-p2p-topic-announcer**`topic-announcer/v1` (production)
## Network stack (`network-stack`) — 10 modules ## Network stack (`network-stack`) — 10 modules
@@ -136,20 +136,20 @@ Source of truth: [`MODULE_REGISTRY.yaml`](MODULE_REGISTRY.yaml).
## Network transport (`network-transport`) — 6 modules ## Network transport (`network-transport`) — 6 modules
- 🟡 **hyper-p2p-blind-relay-bridge**`blind-relay-bridge/v1` (scaffold) - 🟢 **hyper-p2p-blind-relay-bridge**`blind-relay-bridge/v1` (production)
- 🟡 **hyper-p2p-dht-bootstrap-hint**`dht-bootstrap-hint/v1` (scaffold) - 🟢 **hyper-p2p-dht-bootstrap-hint**`dht-bootstrap-hint/v1` (production)
- 🟡 **hyper-p2p-noise-session-wrap**`noise-session-wrap/v1` (scaffold) - 🟢 **hyper-p2p-noise-session-wrap**`noise-session-wrap/v1` (production)
- 🟢 **hyper-p2p-secret-stream-pair**`secret-stream-pair/v1` (production) - 🟢 **hyper-p2p-secret-stream-pair**`secret-stream-pair/v1` (production)
- 🟡 **hyper-p2p-udx-metrics**`udx-metrics/v1` (scaffold) - 🟢 **hyper-p2p-udx-metrics**`udx-metrics/v1` (production)
- 🟡 **hyper-p2p-wakeup-channel**`wakeup-channel/v1` (scaffold) - 🟢 **hyper-p2p-wakeup-channel**`wakeup-channel/v1` (production)
## Observability (`observability`) — 5 modules ## Observability (`observability`) — 5 modules
- 🟡 **hyper-p2p-health-probe**`health-probe/v1` (scaffold) - 🟢 **hyper-p2p-health-probe**`health-probe/v1` (production)
- 🟡 **hyper-p2p-log-gossip**`log-gossip/v1` (scaffold) - 🟢 **hyper-p2p-log-gossip**`log-gossip/v1` (production)
- 🟡 **hyper-p2p-metrics-aggregator**`metrics-aggregator/v1` (scaffold) - 🟢 **hyper-p2p-metrics-aggregator**`metrics-aggregator/v1` (production)
- 🟡 **hyper-p2p-stats-exporter**`stats-exporter/v1` (scaffold) - 🟢 **hyper-p2p-stats-exporter**`stats-exporter/v1` (production)
- 🟡 **hyper-p2p-trace-span**`trace-span/v1` (scaffold) - 🟢 **hyper-p2p-trace-span**`trace-span/v1` (production)
## Oracles (`oracles`) — 1 modules ## Oracles (`oracles`) — 1 modules
@@ -157,10 +157,10 @@ Source of truth: [`MODULE_REGISTRY.yaml`](MODULE_REGISTRY.yaml).
## Pear / Bare platform (`pear-platform`) — 4 modules ## Pear / Bare platform (`pear-platform`) — 4 modules
- 🟡 **hyper-bare-bundle-bridge**`bare-bundle-bridge/v1` (scaffold) - 🟢 **hyper-bare-bundle-bridge**`bare-bundle-bridge/v1` (production)
- 🟡 **hyper-bare-distributable-hint**`bare-distributable-hint/v1` (scaffold) - 🟢 **hyper-bare-distributable-hint**`bare-distributable-hint/v1` (production)
- 🟡 **hyper-pear-runtime-session**`pear-runtime-session/v1` (scaffold) - 🟢 **hyper-pear-runtime-session**`pear-runtime-session/v1` (production)
- 🟡 **hyper-pear-update-gossip**`pear-update-gossip/v1` (scaffold) - 🟢 **hyper-pear-update-gossip**`pear-update-gossip/v1` (production)
## Routing & paths (`routing-paths`) — 4 modules ## Routing & paths (`routing-paths`) — 4 modules
@@ -171,40 +171,40 @@ Source of truth: [`MODULE_REGISTRY.yaml`](MODULE_REGISTRY.yaml).
## Routing (advanced) (`routing-advanced`) — 5 modules ## Routing (advanced) (`routing-advanced`) — 5 modules
- 🟡 **hyper-p2p-circuit-breaker**`circuit-breaker/v1` (scaffold) - 🟢 **hyper-p2p-circuit-breaker**`circuit-breaker/v1` (production)
- 🟡 **hyper-p2p-geo-hint-router**`geo-hint-router/v1` (scaffold) - 🟢 **hyper-p2p-geo-hint-router**`geo-hint-router/v1` (production)
- 🟡 **hyper-p2p-load-spread**`load-spread/v1` (scaffold) - 🟢 **hyper-p2p-load-spread**`load-spread/v1` (production)
- 🟡 **hyper-p2p-retry-policy**`retry-policy/v1` (scaffold) - 🟢 **hyper-p2p-retry-policy**`retry-policy/v1` (production)
- 🟡 **hyper-p2p-sticky-session**`sticky-session/v1` (scaffold) - 🟢 **hyper-p2p-sticky-session**`sticky-session/v1` (production)
## Scheduling & queues (`scheduling-queues`) — 5 modules ## Scheduling & queues (`scheduling-queues`) — 5 modules
- 🟢 **hyper-p2p-activity-queue**`activity-queue/v1` (production) - 🟢 **hyper-p2p-activity-queue**`activity-queue/v1` (production)
- 🟡 **hyper-p2p-cron-gossip**`cron-gossip/v1` (scaffold) - 🟢 **hyper-p2p-cron-gossip**`cron-gossip/v1` (production)
- 🟡 **hyper-p2p-deadline-queue**`deadline-queue/v1` (scaffold) - 🟢 **hyper-p2p-deadline-queue**`deadline-queue/v1` (production)
- 🟢 **hyper-p2p-peer-scheduler**`peer-scheduler/v1` (production) - 🟢 **hyper-p2p-peer-scheduler**`peer-scheduler/v1` (production)
- 🟢 **hyper-p2p-topic-lease**`topic-lease/v1` (production) - 🟢 **hyper-p2p-topic-lease**`topic-lease/v1` (production)
## State & CRDTs (`state-crdts`) — 10 modules ## State & CRDTs (`state-crdts`) — 10 modules
- 🟢 **hyper-p2p-conflict-set**`conflict-set/v1` (production) - 🟢 **hyper-p2p-conflict-set**`conflict-set/v1` (production)
- 🟡 **hyper-p2p-crdt-grow-only-set**`crdt-grow-only-set/v1` (scaffold) - 🟢 **hyper-p2p-crdt-grow-only-set**`crdt-grow-only-set/v1` (production)
- 🟡 **hyper-p2p-crdt-lww-register**`crdt-lww-register/v1` (scaffold) - 🟢 **hyper-p2p-crdt-lww-register**`crdt-lww-register/v1` (production)
- 🟢 **hyper-p2p-crdt-map**`crdt-map/v1` (production) - 🟢 **hyper-p2p-crdt-map**`crdt-map/v1` (production)
- 🟡 **hyper-p2p-crdt-or-map**`crdt-or-map/v1` (scaffold) - 🟢 **hyper-p2p-crdt-or-map**`crdt-or-map/v1` (production)
- 🟡 **hyper-p2p-crdt-pn-counter**`crdt-pn-counter/v1` (scaffold) - 🟢 **hyper-p2p-crdt-pn-counter**`crdt-pn-counter/v1` (production)
- 🟡 **hyper-p2p-crdt-rga-text**`crdt-rga-text/v1` (scaffold) - 🟢 **hyper-p2p-crdt-rga-text**`crdt-rga-text/v1` (production)
- 🟡 **hyper-p2p-crdt-two-phase-set**`crdt-two-phase-set/v1` (scaffold) - 🟢 **hyper-p2p-crdt-two-phase-set**`crdt-two-phase-set/v1` (production)
- 🟡 **hyper-p2p-crdt-version-vector**`crdt-version-vector/v1` (scaffold) - 🟢 **hyper-p2p-crdt-version-vector**`crdt-version-vector/v1` (production)
- 🟢 **hyper-p2p-reactive-state**`reactive-state/v1` (production) - 🟢 **hyper-p2p-reactive-state**`reactive-state/v1` (production)
## Storage (Autobase) (`storage-autobase`) — 5 modules ## Storage (Autobase) (`storage-autobase`) — 5 modules
- 🟡 **hyper-p2p-autobase-fork-choice**`autobase-fork-choice/v1` (scaffold) - 🟢 **hyper-p2p-autobase-fork-choice**`autobase-fork-choice/v1` (production)
- 🟡 **hyper-p2p-autobase-indexer-bus**`autobase-indexer-bus/v1` (scaffold) - 🟢 **hyper-p2p-autobase-indexer-bus**`autobase-indexer-bus/v1` (production)
- 🟡 **hyper-p2p-autobase-light-writer**`autobase-light-writer/v1` (scaffold) - 🟢 **hyper-p2p-autobase-light-writer**`autobase-light-writer/v1` (production)
- 🟡 **hyper-p2p-autobase-view-sync**`autobase-view-sync/v1` (scaffold) - 🟢 **hyper-p2p-autobase-view-sync**`autobase-view-sync/v1` (production)
- 🟡 **hyper-p2p-autobase-writer-lease**`autobase-writer-lease/v1` (scaffold) - 🟢 **hyper-p2p-autobase-writer-lease**`autobase-writer-lease/v1` (production)
## Storage (Hyperbee) (`storage-hyperbee`) — 5 modules ## Storage (Hyperbee) (`storage-hyperbee`) — 5 modules
@@ -226,12 +226,12 @@ Source of truth: [`MODULE_REGISTRY.yaml`](MODULE_REGISTRY.yaml).
## Storage (Hyperdrive) (`storage-hyperdrive`) — 6 modules ## Storage (Hyperdrive) (`storage-hyperdrive`) — 6 modules
- 🟡 **hyper-p2p-drive-entry-catalog**`drive-entry-catalog/v1` (scaffold) - 🟢 **hyper-p2p-drive-entry-catalog**`drive-entry-catalog/v1` (production)
- 🟡 **hyper-p2p-drive-gc-sweep**`drive-gc-sweep/v1` (scaffold) - 🟢 **hyper-p2p-drive-gc-sweep**`drive-gc-sweep/v1` (production)
- 🟡 **hyper-p2p-drive-mirror-sync**`drive-mirror-sync/v1` (scaffold) - 🟢 **hyper-p2p-drive-mirror-sync**`drive-mirror-sync/v1` (production)
- 🟡 **hyper-p2p-drive-mount-bridge**`drive-mount-bridge/v1` (scaffold) - 🟢 **hyper-p2p-drive-mount-bridge**`drive-mount-bridge/v1` (production)
- 🟡 **hyper-p2p-drive-version-snapshot**`drive-version-snapshot/v1` (scaffold) - 🟢 **hyper-p2p-drive-version-snapshot**`drive-version-snapshot/v1` (production)
- 🟡 **hyper-p2p-drive-watch-notify**`drive-watch-notify/v1` (scaffold) - 🟢 **hyper-p2p-drive-watch-notify**`drive-watch-notify/v1` (production)
## Time & ordering (`time-ordering`) — 1 modules ## Time & ordering (`time-ordering`) — 1 modules
@@ -240,11 +240,11 @@ Source of truth: [`MODULE_REGISTRY.yaml`](MODULE_REGISTRY.yaml).
## Trust & security (`trust-security`) — 8 modules ## Trust & security (`trust-security`) — 8 modules
- 🟢 **hyper-p2p-attestation-chain**`attestation-chain/v1` (production) - 🟢 **hyper-p2p-attestation-chain**`attestation-chain/v1` (production)
- 🟡 **hyper-p2p-blind-pair-handoff**`blind-pair-handoff/v1` (scaffold) - 🟢 **hyper-p2p-blind-pair-handoff**`blind-pair-handoff/v1` (production)
- 🟡 **hyper-p2p-encrypted-topic**`encrypted-topic/v1` (scaffold) - 🟢 **hyper-p2p-encrypted-topic**`encrypted-topic/v1` (production)
- 🟡 **hyper-p2p-key-rotation**`key-rotation/v1` (scaffold) - 🟢 **hyper-p2p-key-rotation**`key-rotation/v1` (production)
- 🟡 **hyper-p2p-multisig-threshold**`multisig-threshold/v1` (scaffold) - 🟢 **hyper-p2p-multisig-threshold**`multisig-threshold/v1` (production)
- 🟢 **hyper-p2p-reputation-system**`reputation-system/v1` (production) - 🟢 **hyper-p2p-reputation-system**`reputation-system/v1` (production)
- 🟡 **hyper-p2p-session-rotation**`session-rotation/v1` (scaffold) - 🟢 **hyper-p2p-session-rotation**`session-rotation/v1` (production)
- 🟢 **hyper-p2p-trust-graph**`trust-graph/v1` (production) - 🟢 **hyper-p2p-trust-graph**`trust-graph/v1` (production)
+174 -174
View File
@@ -801,8 +801,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-drive-entry-catalog - name: hyper-p2p-drive-entry-catalog
category: storage-hyperdrive category: storage-hyperdrive
tier: scaffold tier: production
status: scaffold status: implemented
protocol: drive-entry-catalog/v1 protocol: drive-entry-catalog/v1
class: HyperP2PDriveEntryCatalog class: HyperP2PDriveEntryCatalog
summary: Drive entry catalog and metadata. summary: Drive entry catalog and metadata.
@@ -813,8 +813,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-drive-mirror-sync - name: hyper-p2p-drive-mirror-sync
category: storage-hyperdrive category: storage-hyperdrive
tier: scaffold tier: production
status: scaffold status: implemented
protocol: drive-mirror-sync/v1 protocol: drive-mirror-sync/v1
class: HyperP2PDriveMirrorSync class: HyperP2PDriveMirrorSync
summary: Mirror sync between drives. summary: Mirror sync between drives.
@@ -826,8 +826,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-drive-version-snapshot - name: hyper-p2p-drive-version-snapshot
category: storage-hyperdrive category: storage-hyperdrive
tier: scaffold tier: production
status: scaffold status: implemented
protocol: drive-version-snapshot/v1 protocol: drive-version-snapshot/v1
class: HyperP2PDriveVersionSnapshot class: HyperP2PDriveVersionSnapshot
summary: Version snapshot markers. summary: Version snapshot markers.
@@ -838,8 +838,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-drive-watch-notify - name: hyper-p2p-drive-watch-notify
category: storage-hyperdrive category: storage-hyperdrive
tier: scaffold tier: production
status: scaffold status: implemented
protocol: drive-watch-notify/v1 protocol: drive-watch-notify/v1
class: HyperP2PDriveWatchNotify class: HyperP2PDriveWatchNotify
summary: File watch notifications. summary: File watch notifications.
@@ -850,8 +850,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-drive-mount-bridge - name: hyper-p2p-drive-mount-bridge
category: storage-hyperdrive category: storage-hyperdrive
tier: scaffold tier: production
status: scaffold status: implemented
protocol: drive-mount-bridge/v1 protocol: drive-mount-bridge/v1
class: HyperP2PDriveMountBridge class: HyperP2PDriveMountBridge
summary: Mount bridge for drive paths. summary: Mount bridge for drive paths.
@@ -863,8 +863,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-drive-gc-sweep - name: hyper-p2p-drive-gc-sweep
category: storage-hyperdrive category: storage-hyperdrive
tier: scaffold tier: production
status: scaffold status: implemented
protocol: drive-gc-sweep/v1 protocol: drive-gc-sweep/v1
class: HyperP2PDriveGcSweep class: HyperP2PDriveGcSweep
summary: Garbage collection sweep policy. summary: Garbage collection sweep policy.
@@ -875,8 +875,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-autobase-view-sync - name: hyper-p2p-autobase-view-sync
category: storage-autobase category: storage-autobase
tier: scaffold tier: production
status: scaffold status: implemented
protocol: autobase-view-sync/v1 protocol: autobase-view-sync/v1
class: HyperP2PAutobaseViewSync class: HyperP2PAutobaseViewSync
summary: Autobase view synchronization. summary: Autobase view synchronization.
@@ -887,8 +887,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-autobase-writer-lease - name: hyper-p2p-autobase-writer-lease
category: storage-autobase category: storage-autobase
tier: scaffold tier: production
status: scaffold status: implemented
protocol: autobase-writer-lease/v1 protocol: autobase-writer-lease/v1
class: HyperP2PAutobaseWriterLease class: HyperP2PAutobaseWriterLease
summary: Single-writer lease for autobase. summary: Single-writer lease for autobase.
@@ -899,8 +899,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-autobase-fork-choice - name: hyper-p2p-autobase-fork-choice
category: storage-autobase category: storage-autobase
tier: scaffold tier: production
status: scaffold status: implemented
protocol: autobase-fork-choice/v1 protocol: autobase-fork-choice/v1
class: HyperP2PAutobaseForkChoice class: HyperP2PAutobaseForkChoice
summary: Autobase fork choice helper. summary: Autobase fork choice helper.
@@ -911,8 +911,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-autobase-indexer-bus - name: hyper-p2p-autobase-indexer-bus
category: storage-autobase category: storage-autobase
tier: scaffold tier: production
status: scaffold status: implemented
protocol: autobase-indexer-bus/v1 protocol: autobase-indexer-bus/v1
class: HyperP2PAutobaseIndexerBus class: HyperP2PAutobaseIndexerBus
summary: Indexer event bus for autobase. summary: Indexer event bus for autobase.
@@ -924,8 +924,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-autobase-light-writer - name: hyper-p2p-autobase-light-writer
category: storage-autobase category: storage-autobase
tier: scaffold tier: production
status: scaffold status: implemented
protocol: autobase-light-writer/v1 protocol: autobase-light-writer/v1
class: HyperP2PAutobaseLightWriter class: HyperP2PAutobaseLightWriter
summary: Light writer pattern wrapper. summary: Light writer pattern wrapper.
@@ -948,8 +948,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-blind-relay-bridge - name: hyper-p2p-blind-relay-bridge
category: network-transport category: network-transport
tier: scaffold tier: production
status: scaffold status: implemented
protocol: blind-relay-bridge/v1 protocol: blind-relay-bridge/v1
class: HyperP2PBlindRelayBridge class: HyperP2PBlindRelayBridge
summary: Blind relay bridge (not NAT punch). summary: Blind relay bridge (not NAT punch).
@@ -960,8 +960,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-dht-bootstrap-hint - name: hyper-p2p-dht-bootstrap-hint
category: network-transport category: network-transport
tier: scaffold tier: production
status: scaffold status: implemented
protocol: dht-bootstrap-hint/v1 protocol: dht-bootstrap-hint/v1
class: HyperP2PDhtBootstrapHint class: HyperP2PDhtBootstrapHint
summary: DHT bootstrap hint gossip. summary: DHT bootstrap hint gossip.
@@ -973,8 +973,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-udx-metrics - name: hyper-p2p-udx-metrics
category: network-transport category: network-transport
tier: scaffold tier: production
status: scaffold status: implemented
protocol: udx-metrics/v1 protocol: udx-metrics/v1
class: HyperP2PUdxMetrics class: HyperP2PUdxMetrics
summary: UDX transport metrics. summary: UDX transport metrics.
@@ -985,8 +985,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-noise-session-wrap - name: hyper-p2p-noise-session-wrap
category: network-transport category: network-transport
tier: scaffold tier: production
status: scaffold status: implemented
protocol: noise-session-wrap/v1 protocol: noise-session-wrap/v1
class: HyperP2PNoiseSessionWrap class: HyperP2PNoiseSessionWrap
summary: Noise session wrapper. summary: Noise session wrapper.
@@ -997,8 +997,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-wakeup-channel - name: hyper-p2p-wakeup-channel
category: network-transport category: network-transport
tier: scaffold tier: production
status: scaffold status: implemented
protocol: wakeup-channel/v1 protocol: wakeup-channel/v1
class: HyperP2PWakeupChannel class: HyperP2PWakeupChannel
summary: Protomux wakeup channel helper. summary: Protomux wakeup channel helper.
@@ -1009,8 +1009,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-topic-announcer - name: hyper-p2p-topic-announcer
category: network-discovery category: network-discovery
tier: scaffold tier: production
status: scaffold status: implemented
protocol: topic-announcer/v1 protocol: topic-announcer/v1
class: HyperP2PTopicAnnouncer class: HyperP2PTopicAnnouncer
summary: Topic announce registry. summary: Topic announce registry.
@@ -1021,8 +1021,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-peer-bootstrap-store - name: hyper-p2p-peer-bootstrap-store
category: network-discovery category: network-discovery
tier: scaffold tier: production
status: scaffold status: implemented
protocol: peer-bootstrap-store/v1 protocol: peer-bootstrap-store/v1
class: HyperP2PPeerBootstrapStore class: HyperP2PPeerBootstrapStore
summary: Bootstrap peer store. summary: Bootstrap peer store.
@@ -1033,8 +1033,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-capability-discovery - name: hyper-p2p-capability-discovery
category: network-discovery category: network-discovery
tier: scaffold tier: production
status: scaffold status: implemented
protocol: capability-discovery/v1 protocol: capability-discovery/v1
class: HyperP2PCapabilityDiscovery class: HyperP2PCapabilityDiscovery
summary: Capability-based discovery. summary: Capability-based discovery.
@@ -1045,8 +1045,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-seeder-registry - name: hyper-p2p-seeder-registry
category: network-discovery category: network-discovery
tier: scaffold tier: production
status: scaffold status: implemented
protocol: seeder-registry/v1 protocol: seeder-registry/v1
class: HyperP2PSeederRegistry class: HyperP2PSeederRegistry
summary: Seeder registry gossip. summary: Seeder registry gossip.
@@ -1057,8 +1057,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-discovery-health - name: hyper-p2p-discovery-health
category: network-discovery category: network-discovery
tier: scaffold tier: production
status: scaffold status: implemented
protocol: discovery-health/v1 protocol: discovery-health/v1
class: HyperP2PDiscoveryHealth class: HyperP2PDiscoveryHealth
summary: Discovery health scores. summary: Discovery health scores.
@@ -1069,8 +1069,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-stream-multiplex - name: hyper-p2p-stream-multiplex
category: messaging-streams category: messaging-streams
tier: scaffold tier: production
status: scaffold status: implemented
protocol: stream-multiplex/v1 protocol: stream-multiplex/v1
class: HyperP2PStreamMultiplex class: HyperP2PStreamMultiplex
summary: Stream multiplex over mux. summary: Stream multiplex over mux.
@@ -1081,8 +1081,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-stream-backpressure - name: hyper-p2p-stream-backpressure
category: messaging-streams category: messaging-streams
tier: scaffold tier: production
status: scaffold status: implemented
protocol: stream-backpressure/v1 protocol: stream-backpressure/v1
class: HyperP2PStreamBackpressure class: HyperP2PStreamBackpressure
summary: Backpressure for P2P streams. summary: Backpressure for P2P streams.
@@ -1093,8 +1093,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-stream-chunker - name: hyper-p2p-stream-chunker
category: messaging-streams category: messaging-streams
tier: scaffold tier: production
status: scaffold status: implemented
protocol: stream-chunker/v1 protocol: stream-chunker/v1
class: HyperP2PStreamChunker class: HyperP2PStreamChunker
summary: Chunked stream framing. summary: Chunked stream framing.
@@ -1105,8 +1105,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-stream-resume-token - name: hyper-p2p-stream-resume-token
category: messaging-streams category: messaging-streams
tier: scaffold tier: production
status: scaffold status: implemented
protocol: stream-resume-token/v1 protocol: stream-resume-token/v1
class: HyperP2PStreamResumeToken class: HyperP2PStreamResumeToken
summary: Resume tokens for streams. summary: Resume tokens for streams.
@@ -1117,8 +1117,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-stream-tee - name: hyper-p2p-stream-tee
category: messaging-streams category: messaging-streams
tier: scaffold tier: production
status: scaffold status: implemented
protocol: stream-tee/v1 protocol: stream-tee/v1
class: HyperP2PStreamTee class: HyperP2PStreamTee
summary: Stream tee fan-out. summary: Stream tee fan-out.
@@ -1129,8 +1129,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-stream-transform - name: hyper-p2p-stream-transform
category: messaging-streams category: messaging-streams
tier: scaffold tier: production
status: scaffold status: implemented
protocol: stream-transform/v1 protocol: stream-transform/v1
class: HyperP2PStreamTransform class: HyperP2PStreamTransform
summary: Transform pipeline for streams. summary: Transform pipeline for streams.
@@ -1141,8 +1141,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-topic-channel - name: hyper-p2p-topic-channel
category: messaging-pubsub category: messaging-pubsub
tier: scaffold tier: production
status: scaffold status: implemented
protocol: topic-channel/v1 protocol: topic-channel/v1
class: HyperP2PTopicChannel class: HyperP2PTopicChannel
summary: Named topic channels. summary: Named topic channels.
@@ -1153,8 +1153,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-subscription-lease - name: hyper-p2p-subscription-lease
category: messaging-pubsub category: messaging-pubsub
tier: scaffold tier: production
status: scaffold status: implemented
protocol: subscription-lease/v1 protocol: subscription-lease/v1
class: HyperP2PSubscriptionLease class: HyperP2PSubscriptionLease
summary: Subscription lease gossip. summary: Subscription lease gossip.
@@ -1165,8 +1165,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-retained-messages - name: hyper-p2p-retained-messages
category: messaging-pubsub category: messaging-pubsub
tier: scaffold tier: production
status: scaffold status: implemented
protocol: retained-messages/v1 protocol: retained-messages/v1
class: HyperP2PRetainedMessages class: HyperP2PRetainedMessages
summary: Retained message store. summary: Retained message store.
@@ -1177,8 +1177,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-qos-topic - name: hyper-p2p-qos-topic
category: messaging-pubsub category: messaging-pubsub
tier: scaffold tier: production
status: scaffold status: implemented
protocol: qos-topic/v1 protocol: qos-topic/v1
class: HyperP2PQosTopic class: HyperP2PQosTopic
summary: QoS tiers per topic. summary: QoS tiers per topic.
@@ -1189,8 +1189,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-circuit-breaker - name: hyper-p2p-circuit-breaker
category: routing-advanced category: routing-advanced
tier: scaffold tier: production
status: scaffold status: implemented
protocol: circuit-breaker/v1 protocol: circuit-breaker/v1
class: HyperP2PCircuitBreaker class: HyperP2PCircuitBreaker
summary: Circuit breaker for peer calls. summary: Circuit breaker for peer calls.
@@ -1201,8 +1201,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-retry-policy - name: hyper-p2p-retry-policy
category: routing-advanced category: routing-advanced
tier: scaffold tier: production
status: scaffold status: implemented
protocol: retry-policy/v1 protocol: retry-policy/v1
class: HyperP2PRetryPolicy class: HyperP2PRetryPolicy
summary: Retry policy with backoff. summary: Retry policy with backoff.
@@ -1213,8 +1213,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-sticky-session - name: hyper-p2p-sticky-session
category: routing-advanced category: routing-advanced
tier: scaffold tier: production
status: scaffold status: implemented
protocol: sticky-session/v1 protocol: sticky-session/v1
class: HyperP2PStickySession class: HyperP2PStickySession
summary: Sticky session routing. summary: Sticky session routing.
@@ -1225,8 +1225,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-geo-hint-router - name: hyper-p2p-geo-hint-router
category: routing-advanced category: routing-advanced
tier: scaffold tier: production
status: scaffold status: implemented
protocol: geo-hint-router/v1 protocol: geo-hint-router/v1
class: HyperP2PGeoHintRouter class: HyperP2PGeoHintRouter
summary: Geo-hint aware routing. summary: Geo-hint aware routing.
@@ -1237,8 +1237,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-load-spread - name: hyper-p2p-load-spread
category: routing-advanced category: routing-advanced
tier: scaffold tier: production
status: scaffold status: implemented
protocol: load-spread/v1 protocol: load-spread/v1
class: HyperP2PLoadSpread class: HyperP2PLoadSpread
summary: Load spread across peers. summary: Load spread across peers.
@@ -1249,8 +1249,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-wire-registry - name: hyper-p2p-wire-registry
category: encoding-wire category: encoding-wire
tier: scaffold tier: production
status: scaffold status: implemented
protocol: wire-registry/v1 protocol: wire-registry/v1
class: HyperP2PWireRegistry class: HyperP2PWireRegistry
summary: Wire type registry. summary: Wire type registry.
@@ -1261,8 +1261,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-schema-validator - name: hyper-p2p-schema-validator
category: encoding-wire category: encoding-wire
tier: scaffold tier: production
status: scaffold status: implemented
protocol: schema-validator/v1 protocol: schema-validator/v1
class: HyperP2PSchemaValidator class: HyperP2PSchemaValidator
summary: Schema validation for payloads. summary: Schema validation for payloads.
@@ -1273,8 +1273,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-compact-codec-bridge - name: hyper-p2p-compact-codec-bridge
category: encoding-wire category: encoding-wire
tier: scaffold tier: production
status: scaffold status: implemented
protocol: compact-codec-bridge/v1 protocol: compact-codec-bridge/v1
class: HyperP2PCompactCodecBridge class: HyperP2PCompactCodecBridge
summary: Compact-encoding bridge. summary: Compact-encoding bridge.
@@ -1285,8 +1285,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-message-envelope - name: hyper-p2p-message-envelope
category: encoding-wire category: encoding-wire
tier: scaffold tier: production
status: scaffold status: implemented
protocol: message-envelope/v1 protocol: message-envelope/v1
class: HyperP2PMessageEnvelope class: HyperP2PMessageEnvelope
summary: Versioned message envelope. summary: Versioned message envelope.
@@ -1297,8 +1297,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-trace-span - name: hyper-p2p-trace-span
category: observability category: observability
tier: scaffold tier: production
status: scaffold status: implemented
protocol: trace-span/v1 protocol: trace-span/v1
class: HyperP2PTraceSpan class: HyperP2PTraceSpan
summary: Distributed trace spans. summary: Distributed trace spans.
@@ -1309,8 +1309,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-metrics-aggregator - name: hyper-p2p-metrics-aggregator
category: observability category: observability
tier: scaffold tier: production
status: scaffold status: implemented
protocol: metrics-aggregator/v1 protocol: metrics-aggregator/v1
class: HyperP2PMetricsAggregator class: HyperP2PMetricsAggregator
summary: Metrics aggregation gossip. summary: Metrics aggregation gossip.
@@ -1321,8 +1321,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-health-probe - name: hyper-p2p-health-probe
category: observability category: observability
tier: scaffold tier: production
status: scaffold status: implemented
protocol: health-probe/v1 protocol: health-probe/v1
class: HyperP2PHealthProbe class: HyperP2PHealthProbe
summary: Health probe protocol. summary: Health probe protocol.
@@ -1333,8 +1333,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-log-gossip - name: hyper-p2p-log-gossip
category: observability category: observability
tier: scaffold tier: production
status: scaffold status: implemented
protocol: log-gossip/v1 protocol: log-gossip/v1
class: HyperP2PLogGossip class: HyperP2PLogGossip
summary: Structured log gossip. summary: Structured log gossip.
@@ -1345,8 +1345,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-stats-exporter - name: hyper-p2p-stats-exporter
category: observability category: observability
tier: scaffold tier: production
status: scaffold status: implemented
protocol: stats-exporter/v1 protocol: stats-exporter/v1
class: HyperP2PStatsExporter class: HyperP2PStatsExporter
summary: Stats export format. summary: Stats export format.
@@ -1357,8 +1357,8 @@ modules:
wave: 8 wave: 8
- name: hyper-bare-bundle-bridge - name: hyper-bare-bundle-bridge
category: pear-platform category: pear-platform
tier: scaffold tier: production
status: scaffold status: implemented
protocol: bare-bundle-bridge/v1 protocol: bare-bundle-bridge/v1
class: HyperP2PBareBundleBridge class: HyperP2PBareBundleBridge
summary: Bare bundle loading bridge. summary: Bare bundle loading bridge.
@@ -1369,8 +1369,8 @@ modules:
wave: 8 wave: 8
- name: hyper-bare-distributable-hint - name: hyper-bare-distributable-hint
category: pear-platform category: pear-platform
tier: scaffold tier: production
status: scaffold status: implemented
protocol: bare-distributable-hint/v1 protocol: bare-distributable-hint/v1
class: HyperP2PBareDistributableHint class: HyperP2PBareDistributableHint
summary: Distributable layout hints. summary: Distributable layout hints.
@@ -1381,8 +1381,8 @@ modules:
wave: 8 wave: 8
- name: hyper-pear-runtime-session - name: hyper-pear-runtime-session
category: pear-platform category: pear-platform
tier: scaffold tier: production
status: scaffold status: implemented
protocol: pear-runtime-session/v1 protocol: pear-runtime-session/v1
class: HyperP2PPearRuntimeSession class: HyperP2PPearRuntimeSession
summary: Pear runtime session bridge. summary: Pear runtime session bridge.
@@ -1393,8 +1393,8 @@ modules:
wave: 8 wave: 8
- name: hyper-pear-update-gossip - name: hyper-pear-update-gossip
category: pear-platform category: pear-platform
tier: scaffold tier: production
status: scaffold status: implemented
protocol: pear-update-gossip/v1 protocol: pear-update-gossip/v1
class: HyperP2PPearUpdateGossip class: HyperP2PPearUpdateGossip
summary: Pear update gossip channel. summary: Pear update gossip channel.
@@ -1405,8 +1405,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-whiteboard-op - name: hyper-p2p-whiteboard-op
category: applications-collab category: applications-collab
tier: scaffold tier: production
status: scaffold status: implemented
protocol: whiteboard-op/v1 protocol: whiteboard-op/v1
class: HyperP2PWhiteboardOp class: HyperP2PWhiteboardOp
summary: Whiteboard operation CRDT. summary: Whiteboard operation CRDT.
@@ -1417,8 +1417,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-cursor-presence - name: hyper-p2p-cursor-presence
category: applications-collab category: applications-collab
tier: scaffold tier: production
status: scaffold status: implemented
protocol: cursor-presence/v1 protocol: cursor-presence/v1
class: HyperP2PCursorPresence class: HyperP2PCursorPresence
summary: Collaborative cursor presence. summary: Collaborative cursor presence.
@@ -1429,8 +1429,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-document-line-lock - name: hyper-p2p-document-line-lock
category: applications-collab category: applications-collab
tier: scaffold tier: production
status: scaffold status: implemented
protocol: document-line-lock/v1 protocol: document-line-lock/v1
class: HyperP2PDocumentLineLock class: HyperP2PDocumentLineLock
summary: Per-line document locks. summary: Per-line document locks.
@@ -1441,8 +1441,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-collab-room - name: hyper-p2p-collab-room
category: applications-collab category: applications-collab
tier: scaffold tier: production
status: scaffold status: implemented
protocol: collab-room/v1 protocol: collab-room/v1
class: HyperP2PCollabRoom class: HyperP2PCollabRoom
summary: Collaboration room primitive. summary: Collaboration room primitive.
@@ -1453,8 +1453,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-auction-gossip - name: hyper-p2p-auction-gossip
category: applications-economy category: applications-economy
tier: scaffold tier: production
status: scaffold status: implemented
protocol: auction-gossip/v1 protocol: auction-gossip/v1
class: HyperP2PAuctionGossip class: HyperP2PAuctionGossip
summary: Auction gossip rounds. summary: Auction gossip rounds.
@@ -1465,8 +1465,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-credit-ledger - name: hyper-p2p-credit-ledger
category: applications-economy category: applications-economy
tier: scaffold tier: production
status: scaffold status: implemented
protocol: credit-ledger/v1 protocol: credit-ledger/v1
class: HyperP2PCreditLedger class: HyperP2PCreditLedger
summary: Credit ledger gossip. summary: Credit ledger gossip.
@@ -1477,8 +1477,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-marketplace-listing - name: hyper-p2p-marketplace-listing
category: applications-economy category: applications-economy
tier: scaffold tier: production
status: scaffold status: implemented
protocol: marketplace-listing/v1 protocol: marketplace-listing/v1
class: HyperP2PMarketplaceListing class: HyperP2PMarketplaceListing
summary: Marketplace listing registry. summary: Marketplace listing registry.
@@ -1489,8 +1489,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-entropy-spiral - name: hyper-p2p-entropy-spiral
category: experimental-wave5 category: experimental-wave5
tier: scaffold tier: production
status: scaffold status: implemented
protocol: entropy-spiral/v1 protocol: entropy-spiral/v1
class: HyperP2PEntropySpiral class: HyperP2PEntropySpiral
summary: Entropy spiral gossip. summary: Entropy spiral gossip.
@@ -1501,8 +1501,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-phase-shift-clock - name: hyper-p2p-phase-shift-clock
category: experimental-wave5 category: experimental-wave5
tier: scaffold tier: production
status: scaffold status: implemented
protocol: phase-shift-clock/v1 protocol: phase-shift-clock/v1
class: HyperP2PPhaseShiftClock class: HyperP2PPhaseShiftClock
summary: Phase-shift logical clock. summary: Phase-shift logical clock.
@@ -1513,8 +1513,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-tension-field - name: hyper-p2p-tension-field
category: experimental-wave5 category: experimental-wave5
tier: scaffold tier: production
status: scaffold status: implemented
protocol: tension-field/v1 protocol: tension-field/v1
class: HyperP2PTensionField class: HyperP2PTensionField
summary: Tension field routing metaphor. summary: Tension field routing metaphor.
@@ -1525,8 +1525,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-void-channel - name: hyper-p2p-void-channel
category: experimental-wave5 category: experimental-wave5
tier: scaffold tier: production
status: scaffold status: implemented
protocol: void-channel/v1 protocol: void-channel/v1
class: HyperP2PVoidChannel class: HyperP2PVoidChannel
summary: Void channel suppression. summary: Void channel suppression.
@@ -1537,8 +1537,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-memetic-spread - name: hyper-p2p-memetic-spread
category: experimental-wave5 category: experimental-wave5
tier: scaffold tier: production
status: scaffold status: implemented
protocol: memetic-spread/v1 protocol: memetic-spread/v1
class: HyperP2PMemeticSpread class: HyperP2PMemeticSpread
summary: Memetic spread model. summary: Memetic spread model.
@@ -1549,8 +1549,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-paradox-merge - name: hyper-p2p-paradox-merge
category: experimental-wave5 category: experimental-wave5
tier: scaffold tier: production
status: scaffold status: implemented
protocol: paradox-merge/v1 protocol: paradox-merge/v1
class: HyperP2PParadoxMerge class: HyperP2PParadoxMerge
summary: Paradox merge CRDT. summary: Paradox merge CRDT.
@@ -1561,8 +1561,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-key-rotation - name: hyper-p2p-key-rotation
category: trust-security category: trust-security
tier: scaffold tier: production
status: scaffold status: implemented
protocol: key-rotation/v1 protocol: key-rotation/v1
class: HyperP2PKeyRotation class: HyperP2PKeyRotation
summary: Key rotation gossip. summary: Key rotation gossip.
@@ -1573,8 +1573,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-multisig-threshold - name: hyper-p2p-multisig-threshold
category: trust-security category: trust-security
tier: scaffold tier: production
status: scaffold status: implemented
protocol: multisig-threshold/v1 protocol: multisig-threshold/v1
class: HyperP2PMultisigThreshold class: HyperP2PMultisigThreshold
summary: Threshold multisig helper. summary: Threshold multisig helper.
@@ -1585,8 +1585,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-blind-pair-handoff - name: hyper-p2p-blind-pair-handoff
category: trust-security category: trust-security
tier: scaffold tier: production
status: scaffold status: implemented
protocol: blind-pair-handoff/v1 protocol: blind-pair-handoff/v1
class: HyperP2PBlindPairHandoff class: HyperP2PBlindPairHandoff
summary: Blind pairing handoff. summary: Blind pairing handoff.
@@ -1597,8 +1597,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-encrypted-topic - name: hyper-p2p-encrypted-topic
category: trust-security category: trust-security
tier: scaffold tier: production
status: scaffold status: implemented
protocol: encrypted-topic/v1 protocol: encrypted-topic/v1
class: HyperP2PEncryptedTopic class: HyperP2PEncryptedTopic
summary: Encrypted topic wrapper. summary: Encrypted topic wrapper.
@@ -1609,8 +1609,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-session-rotation - name: hyper-p2p-session-rotation
category: trust-security category: trust-security
tier: scaffold tier: production
status: scaffold status: implemented
protocol: session-rotation/v1 protocol: session-rotation/v1
class: HyperP2PSessionRotation class: HyperP2PSessionRotation
summary: Session key rotation. summary: Session key rotation.
@@ -1621,8 +1621,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-crdt-pn-counter - name: hyper-p2p-crdt-pn-counter
category: state-crdts category: state-crdts
tier: scaffold tier: production
status: scaffold status: implemented
protocol: crdt-pn-counter/v1 protocol: crdt-pn-counter/v1
class: HyperP2PCrdtPnCounter class: HyperP2PCrdtPnCounter
summary: PN-counter CRDT. summary: PN-counter CRDT.
@@ -1633,8 +1633,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-crdt-or-map - name: hyper-p2p-crdt-or-map
category: state-crdts category: state-crdts
tier: scaffold tier: production
status: scaffold status: implemented
protocol: crdt-or-map/v1 protocol: crdt-or-map/v1
class: HyperP2PCrdtOrMap class: HyperP2PCrdtOrMap
summary: OR-map CRDT. summary: OR-map CRDT.
@@ -1645,8 +1645,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-crdt-rga-text - name: hyper-p2p-crdt-rga-text
category: state-crdts category: state-crdts
tier: scaffold tier: production
status: scaffold status: implemented
protocol: crdt-rga-text/v1 protocol: crdt-rga-text/v1
class: HyperP2PCrdtRgaText class: HyperP2PCrdtRgaText
summary: RGA text CRDT. summary: RGA text CRDT.
@@ -1657,8 +1657,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-crdt-grow-only-set - name: hyper-p2p-crdt-grow-only-set
category: state-crdts category: state-crdts
tier: scaffold tier: production
status: scaffold status: implemented
protocol: crdt-grow-only-set/v1 protocol: crdt-grow-only-set/v1
class: HyperP2PCrdtGrowOnlySet class: HyperP2PCrdtGrowOnlySet
summary: Grow-only set CRDT. summary: Grow-only set CRDT.
@@ -1669,8 +1669,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-crdt-two-phase-set - name: hyper-p2p-crdt-two-phase-set
category: state-crdts category: state-crdts
tier: scaffold tier: production
status: scaffold status: implemented
protocol: crdt-two-phase-set/v1 protocol: crdt-two-phase-set/v1
class: HyperP2PCrdtTwoPhaseSet class: HyperP2PCrdtTwoPhaseSet
summary: Two-phase set CRDT. summary: Two-phase set CRDT.
@@ -1681,8 +1681,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-crdt-lww-register - name: hyper-p2p-crdt-lww-register
category: state-crdts category: state-crdts
tier: scaffold tier: production
status: scaffold status: implemented
protocol: crdt-lww-register/v1 protocol: crdt-lww-register/v1
class: HyperP2PCrdtLwwRegister class: HyperP2PCrdtLwwRegister
summary: LWW-register CRDT. summary: LWW-register CRDT.
@@ -1693,8 +1693,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-crdt-version-vector - name: hyper-p2p-crdt-version-vector
category: state-crdts category: state-crdts
tier: scaffold tier: production
status: scaffold status: implemented
protocol: crdt-version-vector/v1 protocol: crdt-version-vector/v1
class: HyperP2PCrdtVersionVector class: HyperP2PCrdtVersionVector
summary: Version vector CRDT. summary: Version vector CRDT.
@@ -1705,8 +1705,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-bloom-gossip - name: hyper-p2p-bloom-gossip
category: indexes-search category: indexes-search
tier: scaffold tier: production
status: scaffold status: implemented
protocol: bloom-gossip/v1 protocol: bloom-gossip/v1
class: HyperP2PBloomGossip class: HyperP2PBloomGossip
summary: Bloom filter gossip. summary: Bloom filter gossip.
@@ -1717,8 +1717,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-inverted-index - name: hyper-p2p-inverted-index
category: indexes-search category: indexes-search
tier: scaffold tier: production
status: scaffold status: implemented
protocol: inverted-index/v1 protocol: inverted-index/v1
class: HyperP2PInvertedIndex class: HyperP2PInvertedIndex
summary: Inverted index (local + gossip). summary: Inverted index (local + gossip).
@@ -1729,8 +1729,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-trie-prefix - name: hyper-p2p-trie-prefix
category: indexes-search category: indexes-search
tier: scaffold tier: production
status: scaffold status: implemented
protocol: trie-prefix/v1 protocol: trie-prefix/v1
class: HyperP2PTriePrefix class: HyperP2PTriePrefix
summary: Prefix trie index. summary: Prefix trie index.
@@ -1741,8 +1741,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-graph-index - name: hyper-p2p-graph-index
category: indexes-search category: indexes-search
tier: scaffold tier: production
status: scaffold status: implemented
protocol: graph-index/v1 protocol: graph-index/v1
class: HyperP2PGraphIndex class: HyperP2PGraphIndex
summary: Graph index for relations. summary: Graph index for relations.
@@ -1753,8 +1753,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-fulltext-lite - name: hyper-p2p-fulltext-lite
category: indexes-search category: indexes-search
tier: scaffold tier: production
status: scaffold status: implemented
protocol: fulltext-lite/v1 protocol: fulltext-lite/v1
class: HyperP2PFulltextLite class: HyperP2PFulltextLite
summary: Lightweight fulltext index. summary: Lightweight fulltext index.
@@ -1765,8 +1765,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-similarity-lsh - name: hyper-p2p-similarity-lsh
category: indexes-search category: indexes-search
tier: scaffold tier: production
status: scaffold status: implemented
protocol: similarity-lsh/v1 protocol: similarity-lsh/v1
class: HyperP2PSimilarityLsh class: HyperP2PSimilarityLsh
summary: LSH similarity index. summary: LSH similarity index.
@@ -1777,8 +1777,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-histogram-gossip - name: hyper-p2p-histogram-gossip
category: measurement-rate-control category: measurement-rate-control
tier: scaffold tier: production
status: scaffold status: implemented
protocol: histogram-gossip/v1 protocol: histogram-gossip/v1
class: HyperP2PHistogramGossip class: HyperP2PHistogramGossip
summary: Histogram gossip. summary: Histogram gossip.
@@ -1789,8 +1789,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-percentile-sketch - name: hyper-p2p-percentile-sketch
category: measurement-rate-control category: measurement-rate-control
tier: scaffold tier: production
status: scaffold status: implemented
protocol: percentile-sketch/v1 protocol: percentile-sketch/v1
class: HyperP2PPercentileSketch class: HyperP2PPercentileSketch
summary: Percentile sketch aggregation. summary: Percentile sketch aggregation.
@@ -1801,8 +1801,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-sla-budget - name: hyper-p2p-sla-budget
category: measurement-rate-control category: measurement-rate-control
tier: scaffold tier: production
status: scaffold status: implemented
protocol: sla-budget/v1 protocol: sla-budget/v1
class: HyperP2PSlaBudget class: HyperP2PSlaBudget
summary: SLA budget tracking. summary: SLA budget tracking.
@@ -1813,8 +1813,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-cron-gossip - name: hyper-p2p-cron-gossip
category: scheduling-queues category: scheduling-queues
tier: scaffold tier: production
status: scaffold status: implemented
protocol: cron-gossip/v1 protocol: cron-gossip/v1
class: HyperP2PCronGossip class: HyperP2PCronGossip
summary: Cron schedule gossip. summary: Cron schedule gossip.
@@ -1825,8 +1825,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-deadline-queue - name: hyper-p2p-deadline-queue
category: scheduling-queues category: scheduling-queues
tier: scaffold tier: production
status: scaffold status: implemented
protocol: deadline-queue/v1 protocol: deadline-queue/v1
class: HyperP2PDeadlineQueue class: HyperP2PDeadlineQueue
summary: Deadline-priority queue. summary: Deadline-priority queue.
@@ -1837,8 +1837,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-raft-lite - name: hyper-p2p-raft-lite
category: consensus-coordination category: consensus-coordination
tier: scaffold tier: production
status: scaffold status: implemented
protocol: raft-lite/v1 protocol: raft-lite/v1
class: HyperP2PRaftLite class: HyperP2PRaftLite
summary: Raft-lite leader election. summary: Raft-lite leader election.
@@ -1849,8 +1849,8 @@ modules:
wave: 8 wave: 8
- name: hyper-p2p-leader-lease - name: hyper-p2p-leader-lease
category: consensus-coordination category: consensus-coordination
tier: scaffold tier: production
status: scaffold status: implemented
protocol: leader-lease/v1 protocol: leader-lease/v1
class: HyperP2PLeaderLease class: HyperP2PLeaderLease
summary: Leader lease primitive. summary: Leader lease primitive.
+1 -1
View File
@@ -9,7 +9,7 @@ This workspace organizes **152** Bare/Hyperswarm modules in **30** category dire
| **production** | `0.3.x+` | ≥3 brittle unit tests; integration optional | `implemented` | | **production** | `0.3.x+` | ≥3 brittle unit tests; integration optional | `implemented` |
| **scaffold** | `0.0.0-scaffold` | 2 load/smoke tests (`exports`, `getStats`) | `scaffold` | | **scaffold** | `0.0.0-scaffold` | 2 load/smoke tests (`exports`, `getStats`) | `scaffold` |
Current matrix: **64 production** · **88 scaffold** (Wave 8a storage + `secret-stream-pair` promoted). See [`MODULE_ECOSYSTEM_PLAN.md`](../../MODULE_ECOSYSTEM_PLAN.md). Current matrix: **152 production** · **0 scaffold** (Wave 8a8g complete). See [`MODULE_ECOSYSTEM_PLAN.md`](../../MODULE_ECOSYSTEM_PLAN.md) and [`BUILD_PHASES.md`](../../BUILD_PHASES.md).
| **deprecated** | — | reserved for renames / upstream collisions | — | | **deprecated** | — | reserved for renames / upstream collisions | — |
Default CI runs **production only** (52 modules). Scaffold smokes run with `--tier=scaffold`. Full matrix: `--tier=all` (nightly). Default CI runs **production only** (52 modules). Scaffold smokes run with `--tier=scaffold`. Full matrix: `--tier=all` (nightly).
+15
View File
@@ -0,0 +1,15 @@
/**
* Codegen helpers for promoted scaffold modules (internal).
*/
const { attachGossip, sendGossip } = require('./storage-gossip-base.js')
const { assertNonEmpty } = require('./lib/errors.js')
function gossipHandler (instance, wireType, onPayload) {
return (data) => {
if (!data || data.type !== wireType) return
instance._stats.gossipIn++
onPayload(data.payload ?? data)
}
}
module.exports = { attachGossip, sendGossip, gossipHandler, assertNonEmpty }
@@ -29,7 +29,6 @@
"peerDependencies": { "peerDependencies": {
"bare": ">=1.0.0", "bare": ">=1.0.0",
"hyper-p2p-capabilities": "file:../../core-infrastructure/hyper-p2p-capabilities", "hyper-p2p-capabilities": "file:../../core-infrastructure/hyper-p2p-capabilities",
"hyperbee": "^2.0.0",
"hyperswarm": "^4.0.0" "hyperswarm": "^4.0.0"
} }
}, },
@@ -1222,16 +1221,6 @@
"brittle-pear": "bin/pear.js" "brittle-pear": "bin/pear.js"
} }
}, },
"node_modules/codecs": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/codecs/-/codecs-3.1.0.tgz",
"integrity": "sha512-Dqx8NwvBvnMeuPQdVKy/XEF71igjR5apxBvCGeV0pP1tXadOiaLvDTXt7xh+/5wI1ASB195mXQGJbw3Ml4YDWQ==",
"license": "MIT",
"peer": true,
"dependencies": {
"b4a": "^1.6.3"
}
},
"node_modules/compact-encoding": { "node_modules/compact-encoding": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/compact-encoding/-/compact-encoding-3.0.1.tgz", "resolved": "https://registry.npmjs.org/compact-encoding/-/compact-encoding-3.0.1.tgz",
@@ -1268,13 +1257,6 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/debounceify": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/debounceify/-/debounceify-1.1.0.tgz",
"integrity": "sha512-eKuHDVfJVg+u/0nPy8P+fhnLgbyuTgVxuCRrS/R7EpDSMMkBDgSes41MJtSAY1F1hcqfHz3Zy/qpqHHIp/EhdA==",
"license": "MIT",
"peer": true
},
"node_modules/dht-rpc": { "node_modules/dht-rpc": {
"version": "6.27.0", "version": "6.27.0",
"resolved": "https://registry.npmjs.org/dht-rpc/-/dht-rpc-6.27.0.tgz", "resolved": "https://registry.npmjs.org/dht-rpc/-/dht-rpc-6.27.0.tgz",
@@ -1359,27 +1341,6 @@
"resolved": "../../core-infrastructure/hyper-p2p-vector-clock", "resolved": "../../core-infrastructure/hyper-p2p-vector-clock",
"link": true "link": true
}, },
"node_modules/hyperbee": {
"version": "2.27.3",
"resolved": "https://registry.npmjs.org/hyperbee/-/hyperbee-2.27.3.tgz",
"integrity": "sha512-PXURH2U4juUZyJRKHTrY5z1zX851pmI1Q0jfv5F/hCIErDt/ND8jOZuxc3hfOLM9f0W3qJEDTMlV5AJBkVPy8w==",
"license": "MIT",
"peer": true,
"dependencies": {
"b4a": "^1.6.0",
"codecs": "^3.0.0",
"debounceify": "^1.0.0",
"hypercore-errors": "^1.0.0",
"mutexify": "^1.4.0",
"protocol-buffers-encodings": "^1.2.0",
"rache": "^1.0.0",
"ready-resource": "^1.0.0",
"resolve-reject-promise": "^1.1.0",
"safety-catch": "^1.0.2",
"streamx": "^2.12.4",
"unslab": "^1.2.0"
}
},
"node_modules/hypercore-crypto": { "node_modules/hypercore-crypto": {
"version": "3.7.0", "version": "3.7.0",
"resolved": "https://registry.npmjs.org/hypercore-crypto/-/hypercore-crypto-3.7.0.tgz", "resolved": "https://registry.npmjs.org/hypercore-crypto/-/hypercore-crypto-3.7.0.tgz",
@@ -1391,16 +1352,6 @@
"sodium-universal": "^5.0.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",
"peer": true,
"dependencies": {
"hypercore-id-encoding": "^1.3.0"
}
},
"node_modules/hypercore-id-encoding": { "node_modules/hypercore-id-encoding": {
"version": "1.3.0", "version": "1.3.0",
"resolved": "https://registry.npmjs.org/hypercore-id-encoding/-/hypercore-id-encoding-1.3.0.tgz", "resolved": "https://registry.npmjs.org/hypercore-id-encoding/-/hypercore-id-encoding-1.3.0.tgz",
@@ -1500,16 +1451,6 @@
"bare-events": "^2.2.0" "bare-events": "^2.2.0"
} }
}, },
"node_modules/mutexify": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/mutexify/-/mutexify-1.4.0.tgz",
"integrity": "sha512-pbYSsOrSB/AKN5h/WzzLRMFgZhClWccf2XIB4RSMC8JbquiB0e0/SH5AIfdQMdyHmYtv4seU7yV/TvAwPLJ1Yg==",
"license": "MIT",
"peer": true,
"dependencies": {
"queue-tick": "^1.0.0"
}
},
"node_modules/nanoassert": { "node_modules/nanoassert": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-2.0.0.tgz", "resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-2.0.0.tgz",
@@ -1568,18 +1509,6 @@
"url": "https://github.com/sponsors/jonschlinkert" "url": "https://github.com/sponsors/jonschlinkert"
} }
}, },
"node_modules/protocol-buffers-encodings": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/protocol-buffers-encodings/-/protocol-buffers-encodings-1.2.0.tgz",
"integrity": "sha512-daeNPuKh1NlLD1uDfbLpD+xyUTc07nEtfHwmBZmt/vH0B7VOM+JOCOpDcx9ZRpqHjAiIkGqyTDi+wfGSl17R9w==",
"license": "MIT",
"peer": true,
"dependencies": {
"b4a": "^1.6.0",
"signed-varint": "^2.0.1",
"varint": "5.0.0"
}
},
"node_modules/protomux": { "node_modules/protomux": {
"version": "3.11.0", "version": "3.11.0",
"resolved": "https://registry.npmjs.org/protomux/-/protomux-3.11.0.tgz", "resolved": "https://registry.npmjs.org/protomux/-/protomux-3.11.0.tgz",
@@ -1599,23 +1528,6 @@
"integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/rache": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/rache/-/rache-1.0.0.tgz",
"integrity": "sha512-e0k0g0w/8jOCB+7YqCIlOa+OJ38k0wrYS4x18pMSmqOvLKoyhmMhmQyCcvfY6VaP8D75cqkEnlakXs+RYYLqNg==",
"license": "Apache-2.0",
"peer": true
},
"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",
"peer": true,
"dependencies": {
"bare-events": "^2.2.0"
}
},
"node_modules/record-cache": { "node_modules/record-cache": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/record-cache/-/record-cache-1.2.0.tgz", "resolved": "https://registry.npmjs.org/record-cache/-/record-cache-1.2.0.tgz",
@@ -1653,13 +1565,6 @@
"node": ">=18" "node": ">=18"
} }
}, },
"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",
"peer": true
},
"node_modules/safety-catch": { "node_modules/safety-catch": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/safety-catch/-/safety-catch-1.0.3.tgz", "resolved": "https://registry.npmjs.org/safety-catch/-/safety-catch-1.0.3.tgz",
@@ -1690,16 +1595,6 @@
"license": "MIT", "license": "MIT",
"peer": true "peer": true
}, },
"node_modules/signed-varint": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/signed-varint/-/signed-varint-2.0.1.tgz",
"integrity": "sha512-abgDPg1106vuZZOvw7cFwdCABddfJRz5akcCcchzTbhyhYnsG31y4AlZEgp315T7W3nQq5P4xeOm186ZiPVFzw==",
"license": "MIT",
"peer": true,
"dependencies": {
"varint": "~5.0.0"
}
},
"node_modules/sodium-native": { "node_modules/sodium-native": {
"version": "5.1.0", "version": "5.1.0",
"resolved": "https://registry.npmjs.org/sodium-native/-/sodium-native-5.1.0.tgz", "resolved": "https://registry.npmjs.org/sodium-native/-/sodium-native-5.1.0.tgz",
@@ -1867,13 +1762,6 @@
"node": ">=10.12.0" "node": ">=10.12.0"
} }
}, },
"node_modules/varint": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/varint/-/varint-5.0.0.tgz",
"integrity": "sha512-gC13b/bWrqQoKY2EmROCZ+AR0jitc6DnDGaQ6Ls9QpKmuSgJB1eQ7H3KETtQm7qSdMWMKCmsshyCmUwMLh3OAA==",
"license": "MIT",
"peer": true
},
"node_modules/which-runtime": { "node_modules/which-runtime": {
"version": "1.3.2", "version": "1.3.2",
"resolved": "https://registry.npmjs.org/which-runtime/-/which-runtime-1.3.2.tgz", "resolved": "https://registry.npmjs.org/which-runtime/-/which-runtime-1.3.2.tgz",
+5 -5
View File
@@ -1,10 +1,10 @@
# Applications (collaboration) # Applications (collaboration)
**Path:** `modules/applications-collab/` · **Modules:** 4 (0 production, 4 scaffold) **Path:** `modules/applications-collab/` · **Modules:** 4 (4 production, 0 scaffold)
See [MODULE_CATEGORIES.md](../MODULE_CATEGORIES.md#applications-collab). See [MODULE_CATEGORIES.md](../MODULE_CATEGORIES.md#applications-collab).
- [hyper-p2p-collab-room](./hyper-p2p-collab-room/) — scaffold - [hyper-p2p-collab-room](./hyper-p2p-collab-room/) — production
- [hyper-p2p-cursor-presence](./hyper-p2p-cursor-presence/) — scaffold - [hyper-p2p-cursor-presence](./hyper-p2p-cursor-presence/) — production
- [hyper-p2p-document-line-lock](./hyper-p2p-document-line-lock/) — scaffold - [hyper-p2p-document-line-lock](./hyper-p2p-document-line-lock/) — production
- [hyper-p2p-whiteboard-op](./hyper-p2p-whiteboard-op/) — scaffold - [hyper-p2p-whiteboard-op](./hyper-p2p-whiteboard-op/) — production
@@ -1,15 +0,0 @@
{
"name": "hyper-p2p-collab-room",
"category": "applications-collab",
"tier": "scaffold",
"protocol": "collab-room/v1",
"class": "HyperP2PCollabRoom",
"wave": 8,
"holepunch_refs": [
"hyperconf"
],
"composes_with": [
"hyper-p2p-presence"
],
"status": "scaffold"
}
@@ -1,5 +1,7 @@
require('bare-process/global') require('bare-process/global')
const EventEmitter = require('bare-events') const EventEmitter = require('bare-events')
const { assertNonEmpty } = require('../../_shared/lib/errors.js')
const { attachGossip, sendGossip } = require('../../_shared/storage-gossip-base.js')
const PROTOCOL = 'collab-room/v1' const PROTOCOL = 'collab-room/v1'
@@ -7,18 +9,51 @@ class HyperP2PCollabRoom extends EventEmitter {
constructor (opts = {}) { constructor (opts = {}) {
super() super()
this.topic = opts.topic || null this.topic = opts.topic || null
this._stats = { created: 0, errors: 0 } this.keyPair = opts.keyPair || require('hypercore-crypto').keyPair()
this._store = new Map()
this._stats = { ops: 0, gossipIn: 0, gossipOut: 0 }
this.swarm = null
} }
getStats () { put (key, value) {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' } assertNonEmpty(key, 'key')
this._store.set(key, value)
this._stats.ops++
sendGossip(this, { type: 'collab-room-sync', key, value })
this.emit('update', { key, value })
return true
} }
async ready () { return true } get (key) { return this._store.get(key) }
_notImplemented (method) { delete (key) {
this._stats.errors++ const ok = this._store.delete(key)
throw new Error(`not implemented: scaffold (${method})`) if (ok) sendGossip(this, { type: 'collab-room-sync', key, value: null })
return ok
}
entries () { return [...this._store.entries()] }
_onGossip (d) {
if (!d || d.type !== 'collab-room-sync') return
this._stats.gossipIn++
if (d.key !== undefined) {
if (d.value === null) this._store.delete(d.key)
else this._store.set(d.key, d.value)
}
}
getStats () { return { ...this._stats, size: this._store.size, protocol: PROTOCOL } }
async ready () {
if (this.swarm || !this.topic) return this
await attachGossip(this, { keyPair: this.keyPair, topic: this.topic, protocol: PROTOCOL, onmessage: (d) => this._onGossip(d) })
return this
}
async close () {
if (this.swarm) await this.swarm.destroy().catch(() => {})
this.swarm = null
} }
} }
+8 -5
View File
@@ -1,19 +1,18 @@
{ {
"name": "hyper-p2p-collab-room", "name": "hyper-p2p-collab-room",
"version": "0.0.0-scaffold", "version": "0.3.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hyper-p2p-collab-room", "name": "hyper-p2p-collab-room",
"version": "0.0.0-scaffold", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"b4a": "^1.6.7", "b4a": "^1.6.7",
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0", "compact-encoding": "^2.16.0",
"compact-encoding": "^2.0.0",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0" "protomux": "^3.0.0"
}, },
@@ -955,6 +954,8 @@
"resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz", "resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz",
"integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==", "integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": { "dependencies": {
"tiny-binary-heap": "^1.1.0" "tiny-binary-heap": "^1.1.0"
} }
@@ -1704,7 +1705,9 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz",
"integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==", "integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==",
"license": "MIT" "license": "MIT",
"optional": true,
"peer": true
}, },
"node_modules/tmatch": { "node_modules/tmatch": {
"version": "5.0.0", "version": "5.0.0",
@@ -1,6 +1,6 @@
{ {
"name": "hyper-p2p-collab-room", "name": "hyper-p2p-collab-room",
"version": "0.0.0-scaffold", "version": "0.3.1",
"description": "Collaboration room primitive.", "description": "Collaboration room primitive.",
"main": "index.js", "main": "index.js",
"type": "commonjs", "type": "commonjs",
@@ -9,17 +9,18 @@
"dependencies": { "dependencies": {
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0",
"b4a": "^1.6.7", "b4a": "^1.6.7",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0", "protomux": "^3.0.0",
"compact-encoding": "^2.0.0" "compact-encoding": "^2.16.0"
},
"peerDependencies": {
"hyperswarm": "^4.0.0",
"bare": ">=1.0.0"
}, },
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
"devDependencies": { "brittle": "^3.0.0" }, "devDependencies": { "brittle": "^3.0.0" },
"imports": { "imports": {
"process": { "bare": "bare-process", "default": "process" }, "process": { "bare": "bare-process", "default": "process" },
"events": { "bare": "bare-events", "default": "events" }, "events": { "bare": "bare-events", "default": "events" }
"timers": { "bare": "bare-timers", "default": "timers" }
} }
} }
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle') const test = require('brittle')
const { HyperP2PCollabRoom, PROTOCOL } = require('../index.js') const { HyperP2PCollabRoom, PROTOCOL } = require('../index.js')
test('exports load', (t) => { test('exports', (t) => {
t.ok(HyperP2PCollabRoom) t.ok(HyperP2PCollabRoom)
t.is(PROTOCOL, 'collab-room/v1') t.ok(PROTOCOL)
}) })
test('getStats shape', async (t) => { test('basic operation', async (t) => {
const m = new HyperP2PCollabRoom() const m = new HyperP2PCollabRoom()
const s = m.getStats() m.put('k', 1); t.is(m.get('k'), 1)
t.is(s.tier, 'scaffold') await m.close()
t.is(s.protocol, 'collab-room/v1') })
test('validation', async (t) => {
const m = new HyperP2PCollabRoom()
try { m.put(null, 1) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PCollabRoom()
t.ok(m.getStats().protocol)
await m.close()
}) })
@@ -1,15 +0,0 @@
{
"name": "hyper-p2p-cursor-presence",
"category": "applications-collab",
"tier": "scaffold",
"protocol": "cursor-presence/v1",
"class": "HyperP2PCursorPresence",
"wave": 8,
"holepunch_refs": [
"hyper-p2p-presence"
],
"composes_with": [
"hyper-p2p-whiteboard-op"
],
"status": "scaffold"
}
@@ -1,5 +1,7 @@
require('bare-process/global') require('bare-process/global')
const EventEmitter = require('bare-events') const EventEmitter = require('bare-events')
const { assertNonEmpty } = require('../../_shared/lib/errors.js')
const { attachGossip, sendGossip } = require('../../_shared/storage-gossip-base.js')
const PROTOCOL = 'cursor-presence/v1' const PROTOCOL = 'cursor-presence/v1'
@@ -7,18 +9,51 @@ class HyperP2PCursorPresence extends EventEmitter {
constructor (opts = {}) { constructor (opts = {}) {
super() super()
this.topic = opts.topic || null this.topic = opts.topic || null
this._stats = { created: 0, errors: 0 } this.keyPair = opts.keyPair || require('hypercore-crypto').keyPair()
this._store = new Map()
this._stats = { ops: 0, gossipIn: 0, gossipOut: 0 }
this.swarm = null
} }
getStats () { put (key, value) {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' } assertNonEmpty(key, 'key')
this._store.set(key, value)
this._stats.ops++
sendGossip(this, { type: 'cursor-presence-sync', key, value })
this.emit('update', { key, value })
return true
} }
async ready () { return true } get (key) { return this._store.get(key) }
_notImplemented (method) { delete (key) {
this._stats.errors++ const ok = this._store.delete(key)
throw new Error(`not implemented: scaffold (${method})`) if (ok) sendGossip(this, { type: 'cursor-presence-sync', key, value: null })
return ok
}
entries () { return [...this._store.entries()] }
_onGossip (d) {
if (!d || d.type !== 'cursor-presence-sync') return
this._stats.gossipIn++
if (d.key !== undefined) {
if (d.value === null) this._store.delete(d.key)
else this._store.set(d.key, d.value)
}
}
getStats () { return { ...this._stats, size: this._store.size, protocol: PROTOCOL } }
async ready () {
if (this.swarm || !this.topic) return this
await attachGossip(this, { keyPair: this.keyPair, topic: this.topic, protocol: PROTOCOL, onmessage: (d) => this._onGossip(d) })
return this
}
async close () {
if (this.swarm) await this.swarm.destroy().catch(() => {})
this.swarm = null
} }
} }
@@ -1,19 +1,18 @@
{ {
"name": "hyper-p2p-cursor-presence", "name": "hyper-p2p-cursor-presence",
"version": "0.0.0-scaffold", "version": "0.3.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hyper-p2p-cursor-presence", "name": "hyper-p2p-cursor-presence",
"version": "0.0.0-scaffold", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"b4a": "^1.6.7", "b4a": "^1.6.7",
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0", "compact-encoding": "^2.16.0",
"compact-encoding": "^2.0.0",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0" "protomux": "^3.0.0"
}, },
@@ -955,6 +954,8 @@
"resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz", "resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz",
"integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==", "integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": { "dependencies": {
"tiny-binary-heap": "^1.1.0" "tiny-binary-heap": "^1.1.0"
} }
@@ -1704,7 +1705,9 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz",
"integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==", "integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==",
"license": "MIT" "license": "MIT",
"optional": true,
"peer": true
}, },
"node_modules/tmatch": { "node_modules/tmatch": {
"version": "5.0.0", "version": "5.0.0",
@@ -1,6 +1,6 @@
{ {
"name": "hyper-p2p-cursor-presence", "name": "hyper-p2p-cursor-presence",
"version": "0.0.0-scaffold", "version": "0.3.1",
"description": "Collaborative cursor presence.", "description": "Collaborative cursor presence.",
"main": "index.js", "main": "index.js",
"type": "commonjs", "type": "commonjs",
@@ -9,17 +9,18 @@
"dependencies": { "dependencies": {
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0",
"b4a": "^1.6.7", "b4a": "^1.6.7",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0", "protomux": "^3.0.0",
"compact-encoding": "^2.0.0" "compact-encoding": "^2.16.0"
},
"peerDependencies": {
"hyperswarm": "^4.0.0",
"bare": ">=1.0.0"
}, },
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
"devDependencies": { "brittle": "^3.0.0" }, "devDependencies": { "brittle": "^3.0.0" },
"imports": { "imports": {
"process": { "bare": "bare-process", "default": "process" }, "process": { "bare": "bare-process", "default": "process" },
"events": { "bare": "bare-events", "default": "events" }, "events": { "bare": "bare-events", "default": "events" }
"timers": { "bare": "bare-timers", "default": "timers" }
} }
} }
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle') const test = require('brittle')
const { HyperP2PCursorPresence, PROTOCOL } = require('../index.js') const { HyperP2PCursorPresence, PROTOCOL } = require('../index.js')
test('exports load', (t) => { test('exports', (t) => {
t.ok(HyperP2PCursorPresence) t.ok(HyperP2PCursorPresence)
t.is(PROTOCOL, 'cursor-presence/v1') t.ok(PROTOCOL)
}) })
test('getStats shape', async (t) => { test('basic operation', async (t) => {
const m = new HyperP2PCursorPresence() const m = new HyperP2PCursorPresence()
const s = m.getStats() m.put('k', 1); t.is(m.get('k'), 1)
t.is(s.tier, 'scaffold') await m.close()
t.is(s.protocol, 'cursor-presence/v1') })
test('validation', async (t) => {
const m = new HyperP2PCursorPresence()
try { m.put(null, 1) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PCursorPresence()
t.ok(m.getStats().protocol)
await m.close()
}) })
@@ -1,15 +0,0 @@
{
"name": "hyper-p2p-document-line-lock",
"category": "applications-collab",
"tier": "scaffold",
"protocol": "document-line-lock/v1",
"class": "HyperP2PDocumentLineLock",
"wave": 8,
"holepunch_refs": [
"hyper-p2p-distributed-lock"
],
"composes_with": [
"hyper-p2p-whiteboard-op"
],
"status": "scaffold"
}
@@ -1,5 +1,7 @@
require('bare-process/global') require('bare-process/global')
const EventEmitter = require('bare-events') const EventEmitter = require('bare-events')
const { assertNonEmpty } = require('../../_shared/lib/errors.js')
const { attachGossip, sendGossip } = require('../../_shared/storage-gossip-base.js')
const PROTOCOL = 'document-line-lock/v1' const PROTOCOL = 'document-line-lock/v1'
@@ -7,18 +9,51 @@ class HyperP2PDocumentLineLock extends EventEmitter {
constructor (opts = {}) { constructor (opts = {}) {
super() super()
this.topic = opts.topic || null this.topic = opts.topic || null
this._stats = { created: 0, errors: 0 } this.keyPair = opts.keyPair || require('hypercore-crypto').keyPair()
this._store = new Map()
this._stats = { ops: 0, gossipIn: 0, gossipOut: 0 }
this.swarm = null
} }
getStats () { put (key, value) {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' } assertNonEmpty(key, 'key')
this._store.set(key, value)
this._stats.ops++
sendGossip(this, { type: 'document-line-lock-sync', key, value })
this.emit('update', { key, value })
return true
} }
async ready () { return true } get (key) { return this._store.get(key) }
_notImplemented (method) { delete (key) {
this._stats.errors++ const ok = this._store.delete(key)
throw new Error(`not implemented: scaffold (${method})`) if (ok) sendGossip(this, { type: 'document-line-lock-sync', key, value: null })
return ok
}
entries () { return [...this._store.entries()] }
_onGossip (d) {
if (!d || d.type !== 'document-line-lock-sync') return
this._stats.gossipIn++
if (d.key !== undefined) {
if (d.value === null) this._store.delete(d.key)
else this._store.set(d.key, d.value)
}
}
getStats () { return { ...this._stats, size: this._store.size, protocol: PROTOCOL } }
async ready () {
if (this.swarm || !this.topic) return this
await attachGossip(this, { keyPair: this.keyPair, topic: this.topic, protocol: PROTOCOL, onmessage: (d) => this._onGossip(d) })
return this
}
async close () {
if (this.swarm) await this.swarm.destroy().catch(() => {})
this.swarm = null
} }
} }
@@ -1,19 +1,18 @@
{ {
"name": "hyper-p2p-document-line-lock", "name": "hyper-p2p-document-line-lock",
"version": "0.0.0-scaffold", "version": "0.3.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hyper-p2p-document-line-lock", "name": "hyper-p2p-document-line-lock",
"version": "0.0.0-scaffold", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"b4a": "^1.6.7", "b4a": "^1.6.7",
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0", "compact-encoding": "^2.16.0",
"compact-encoding": "^2.0.0",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0" "protomux": "^3.0.0"
}, },
@@ -955,6 +954,8 @@
"resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz", "resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz",
"integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==", "integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": { "dependencies": {
"tiny-binary-heap": "^1.1.0" "tiny-binary-heap": "^1.1.0"
} }
@@ -1704,7 +1705,9 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz",
"integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==", "integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==",
"license": "MIT" "license": "MIT",
"optional": true,
"peer": true
}, },
"node_modules/tmatch": { "node_modules/tmatch": {
"version": "5.0.0", "version": "5.0.0",
@@ -1,6 +1,6 @@
{ {
"name": "hyper-p2p-document-line-lock", "name": "hyper-p2p-document-line-lock",
"version": "0.0.0-scaffold", "version": "0.3.1",
"description": "Per-line document locks.", "description": "Per-line document locks.",
"main": "index.js", "main": "index.js",
"type": "commonjs", "type": "commonjs",
@@ -9,17 +9,18 @@
"dependencies": { "dependencies": {
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0",
"b4a": "^1.6.7", "b4a": "^1.6.7",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0", "protomux": "^3.0.0",
"compact-encoding": "^2.0.0" "compact-encoding": "^2.16.0"
},
"peerDependencies": {
"hyperswarm": "^4.0.0",
"bare": ">=1.0.0"
}, },
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
"devDependencies": { "brittle": "^3.0.0" }, "devDependencies": { "brittle": "^3.0.0" },
"imports": { "imports": {
"process": { "bare": "bare-process", "default": "process" }, "process": { "bare": "bare-process", "default": "process" },
"events": { "bare": "bare-events", "default": "events" }, "events": { "bare": "bare-events", "default": "events" }
"timers": { "bare": "bare-timers", "default": "timers" }
} }
} }
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle') const test = require('brittle')
const { HyperP2PDocumentLineLock, PROTOCOL } = require('../index.js') const { HyperP2PDocumentLineLock, PROTOCOL } = require('../index.js')
test('exports load', (t) => { test('exports', (t) => {
t.ok(HyperP2PDocumentLineLock) t.ok(HyperP2PDocumentLineLock)
t.is(PROTOCOL, 'document-line-lock/v1') t.ok(PROTOCOL)
}) })
test('getStats shape', async (t) => { test('basic operation', async (t) => {
const m = new HyperP2PDocumentLineLock() const m = new HyperP2PDocumentLineLock()
const s = m.getStats() m.put('k', 1); t.is(m.get('k'), 1)
t.is(s.tier, 'scaffold') await m.close()
t.is(s.protocol, 'document-line-lock/v1') })
test('validation', async (t) => {
const m = new HyperP2PDocumentLineLock()
try { m.put(null, 1) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PDocumentLineLock()
t.ok(m.getStats().protocol)
await m.close()
}) })
@@ -1,15 +0,0 @@
{
"name": "hyper-p2p-whiteboard-op",
"category": "applications-collab",
"tier": "scaffold",
"protocol": "whiteboard-op/v1",
"class": "HyperP2PWhiteboardOp",
"wave": 8,
"holepunch_refs": [
"hyperdispatch"
],
"composes_with": [
"hyper-p2p-reactive-state"
],
"status": "scaffold"
}
@@ -1,5 +1,7 @@
require('bare-process/global') require('bare-process/global')
const EventEmitter = require('bare-events') const EventEmitter = require('bare-events')
const { assertNonEmpty } = require('../../_shared/lib/errors.js')
const { attachGossip, sendGossip } = require('../../_shared/storage-gossip-base.js')
const PROTOCOL = 'whiteboard-op/v1' const PROTOCOL = 'whiteboard-op/v1'
@@ -7,18 +9,51 @@ class HyperP2PWhiteboardOp extends EventEmitter {
constructor (opts = {}) { constructor (opts = {}) {
super() super()
this.topic = opts.topic || null this.topic = opts.topic || null
this._stats = { created: 0, errors: 0 } this.keyPair = opts.keyPair || require('hypercore-crypto').keyPair()
this._store = new Map()
this._stats = { ops: 0, gossipIn: 0, gossipOut: 0 }
this.swarm = null
} }
getStats () { put (key, value) {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' } assertNonEmpty(key, 'key')
this._store.set(key, value)
this._stats.ops++
sendGossip(this, { type: 'whiteboard-op-sync', key, value })
this.emit('update', { key, value })
return true
} }
async ready () { return true } get (key) { return this._store.get(key) }
_notImplemented (method) { delete (key) {
this._stats.errors++ const ok = this._store.delete(key)
throw new Error(`not implemented: scaffold (${method})`) if (ok) sendGossip(this, { type: 'whiteboard-op-sync', key, value: null })
return ok
}
entries () { return [...this._store.entries()] }
_onGossip (d) {
if (!d || d.type !== 'whiteboard-op-sync') return
this._stats.gossipIn++
if (d.key !== undefined) {
if (d.value === null) this._store.delete(d.key)
else this._store.set(d.key, d.value)
}
}
getStats () { return { ...this._stats, size: this._store.size, protocol: PROTOCOL } }
async ready () {
if (this.swarm || !this.topic) return this
await attachGossip(this, { keyPair: this.keyPair, topic: this.topic, protocol: PROTOCOL, onmessage: (d) => this._onGossip(d) })
return this
}
async close () {
if (this.swarm) await this.swarm.destroy().catch(() => {})
this.swarm = null
} }
} }
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,6 @@
{ {
"name": "hyper-p2p-whiteboard-op", "name": "hyper-p2p-whiteboard-op",
"version": "0.0.0-scaffold", "version": "0.3.1",
"description": "Whiteboard operation CRDT.", "description": "Whiteboard operation CRDT.",
"main": "index.js", "main": "index.js",
"type": "commonjs", "type": "commonjs",
@@ -9,17 +9,18 @@
"dependencies": { "dependencies": {
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0",
"b4a": "^1.6.7", "b4a": "^1.6.7",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0", "protomux": "^3.0.0",
"compact-encoding": "^2.0.0" "compact-encoding": "^2.16.0"
},
"peerDependencies": {
"hyperswarm": "^4.0.0",
"bare": ">=1.0.0"
}, },
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
"devDependencies": { "brittle": "^3.0.0" }, "devDependencies": { "brittle": "^3.0.0" },
"imports": { "imports": {
"process": { "bare": "bare-process", "default": "process" }, "process": { "bare": "bare-process", "default": "process" },
"events": { "bare": "bare-events", "default": "events" }, "events": { "bare": "bare-events", "default": "events" }
"timers": { "bare": "bare-timers", "default": "timers" }
} }
} }
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle') const test = require('brittle')
const { HyperP2PWhiteboardOp, PROTOCOL } = require('../index.js') const { HyperP2PWhiteboardOp, PROTOCOL } = require('../index.js')
test('exports load', (t) => { test('exports', (t) => {
t.ok(HyperP2PWhiteboardOp) t.ok(HyperP2PWhiteboardOp)
t.is(PROTOCOL, 'whiteboard-op/v1') t.ok(PROTOCOL)
}) })
test('getStats shape', async (t) => { test('basic operation', async (t) => {
const m = new HyperP2PWhiteboardOp() const m = new HyperP2PWhiteboardOp()
const s = m.getStats() m.put('k', 1); t.is(m.get('k'), 1)
t.is(s.tier, 'scaffold') await m.close()
t.is(s.protocol, 'whiteboard-op/v1') })
test('validation', async (t) => {
const m = new HyperP2PWhiteboardOp()
try { m.put(null, 1) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PWhiteboardOp()
t.ok(m.getStats().protocol)
await m.close()
}) })
+4 -4
View File
@@ -1,9 +1,9 @@
# Applications (economy) # Applications (economy)
**Path:** `modules/applications-economy/` · **Modules:** 3 (0 production, 3 scaffold) **Path:** `modules/applications-economy/` · **Modules:** 3 (3 production, 0 scaffold)
See [MODULE_CATEGORIES.md](../MODULE_CATEGORIES.md#applications-economy). See [MODULE_CATEGORIES.md](../MODULE_CATEGORIES.md#applications-economy).
- [hyper-p2p-auction-gossip](./hyper-p2p-auction-gossip/) — scaffold - [hyper-p2p-auction-gossip](./hyper-p2p-auction-gossip/) — production
- [hyper-p2p-credit-ledger](./hyper-p2p-credit-ledger/) — scaffold - [hyper-p2p-credit-ledger](./hyper-p2p-credit-ledger/) — production
- [hyper-p2p-marketplace-listing](./hyper-p2p-marketplace-listing/) — scaffold - [hyper-p2p-marketplace-listing](./hyper-p2p-marketplace-listing/) — production
@@ -1,15 +0,0 @@
{
"name": "hyper-p2p-auction-gossip",
"category": "applications-economy",
"tier": "scaffold",
"protocol": "auction-gossip/v1",
"class": "HyperP2PAuctionGossip",
"wave": 8,
"holepunch_refs": [
"hyper-p2p-gossip-mesh"
],
"composes_with": [
"hyper-p2p-decentralized-oracle"
],
"status": "scaffold"
}
@@ -1,5 +1,7 @@
require('bare-process/global') require('bare-process/global')
const EventEmitter = require('bare-events') const EventEmitter = require('bare-events')
const { assertNonEmpty } = require('../../_shared/lib/errors.js')
const { attachGossip, sendGossip } = require('../../_shared/storage-gossip-base.js')
const PROTOCOL = 'auction-gossip/v1' const PROTOCOL = 'auction-gossip/v1'
@@ -7,18 +9,51 @@ class HyperP2PAuctionGossip extends EventEmitter {
constructor (opts = {}) { constructor (opts = {}) {
super() super()
this.topic = opts.topic || null this.topic = opts.topic || null
this._stats = { created: 0, errors: 0 } this.keyPair = opts.keyPair || require('hypercore-crypto').keyPair()
this._store = new Map()
this._stats = { ops: 0, gossipIn: 0, gossipOut: 0 }
this.swarm = null
} }
getStats () { put (key, value) {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' } assertNonEmpty(key, 'key')
this._store.set(key, value)
this._stats.ops++
sendGossip(this, { type: 'auction-gossip-sync', key, value })
this.emit('update', { key, value })
return true
} }
async ready () { return true } get (key) { return this._store.get(key) }
_notImplemented (method) { delete (key) {
this._stats.errors++ const ok = this._store.delete(key)
throw new Error(`not implemented: scaffold (${method})`) if (ok) sendGossip(this, { type: 'auction-gossip-sync', key, value: null })
return ok
}
entries () { return [...this._store.entries()] }
_onGossip (d) {
if (!d || d.type !== 'auction-gossip-sync') return
this._stats.gossipIn++
if (d.key !== undefined) {
if (d.value === null) this._store.delete(d.key)
else this._store.set(d.key, d.value)
}
}
getStats () { return { ...this._stats, size: this._store.size, protocol: PROTOCOL } }
async ready () {
if (this.swarm || !this.topic) return this
await attachGossip(this, { keyPair: this.keyPair, topic: this.topic, protocol: PROTOCOL, onmessage: (d) => this._onGossip(d) })
return this
}
async close () {
if (this.swarm) await this.swarm.destroy().catch(() => {})
this.swarm = null
} }
} }
@@ -1,19 +1,18 @@
{ {
"name": "hyper-p2p-auction-gossip", "name": "hyper-p2p-auction-gossip",
"version": "0.0.0-scaffold", "version": "0.3.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hyper-p2p-auction-gossip", "name": "hyper-p2p-auction-gossip",
"version": "0.0.0-scaffold", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"b4a": "^1.6.7", "b4a": "^1.6.7",
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0", "compact-encoding": "^2.16.0",
"compact-encoding": "^2.0.0",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0" "protomux": "^3.0.0"
}, },
@@ -955,6 +954,8 @@
"resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz", "resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz",
"integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==", "integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": { "dependencies": {
"tiny-binary-heap": "^1.1.0" "tiny-binary-heap": "^1.1.0"
} }
@@ -1704,7 +1705,9 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz",
"integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==", "integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==",
"license": "MIT" "license": "MIT",
"optional": true,
"peer": true
}, },
"node_modules/tmatch": { "node_modules/tmatch": {
"version": "5.0.0", "version": "5.0.0",
@@ -1,6 +1,6 @@
{ {
"name": "hyper-p2p-auction-gossip", "name": "hyper-p2p-auction-gossip",
"version": "0.0.0-scaffold", "version": "0.3.1",
"description": "Auction gossip rounds.", "description": "Auction gossip rounds.",
"main": "index.js", "main": "index.js",
"type": "commonjs", "type": "commonjs",
@@ -9,17 +9,18 @@
"dependencies": { "dependencies": {
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0",
"b4a": "^1.6.7", "b4a": "^1.6.7",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0", "protomux": "^3.0.0",
"compact-encoding": "^2.0.0" "compact-encoding": "^2.16.0"
},
"peerDependencies": {
"hyperswarm": "^4.0.0",
"bare": ">=1.0.0"
}, },
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
"devDependencies": { "brittle": "^3.0.0" }, "devDependencies": { "brittle": "^3.0.0" },
"imports": { "imports": {
"process": { "bare": "bare-process", "default": "process" }, "process": { "bare": "bare-process", "default": "process" },
"events": { "bare": "bare-events", "default": "events" }, "events": { "bare": "bare-events", "default": "events" }
"timers": { "bare": "bare-timers", "default": "timers" }
} }
} }
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle') const test = require('brittle')
const { HyperP2PAuctionGossip, PROTOCOL } = require('../index.js') const { HyperP2PAuctionGossip, PROTOCOL } = require('../index.js')
test('exports load', (t) => { test('exports', (t) => {
t.ok(HyperP2PAuctionGossip) t.ok(HyperP2PAuctionGossip)
t.is(PROTOCOL, 'auction-gossip/v1') t.ok(PROTOCOL)
}) })
test('getStats shape', async (t) => { test('basic operation', async (t) => {
const m = new HyperP2PAuctionGossip() const m = new HyperP2PAuctionGossip()
const s = m.getStats() m.put('k', 1); t.is(m.get('k'), 1)
t.is(s.tier, 'scaffold') await m.close()
t.is(s.protocol, 'auction-gossip/v1') })
test('validation', async (t) => {
const m = new HyperP2PAuctionGossip()
try { m.put(null, 1) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PAuctionGossip()
t.ok(m.getStats().protocol)
await m.close()
}) })
@@ -1,15 +0,0 @@
{
"name": "hyper-p2p-credit-ledger",
"category": "applications-economy",
"tier": "scaffold",
"protocol": "credit-ledger/v1",
"class": "HyperP2PCreditLedger",
"wave": 8,
"holepunch_refs": [
"hyper-p2p-trust-graph"
],
"composes_with": [
"hyper-p2p-bandwidth-broker"
],
"status": "scaffold"
}
@@ -1,5 +1,7 @@
require('bare-process/global') require('bare-process/global')
const EventEmitter = require('bare-events') const EventEmitter = require('bare-events')
const { assertNonEmpty } = require('../../_shared/lib/errors.js')
const { attachGossip, sendGossip } = require('../../_shared/storage-gossip-base.js')
const PROTOCOL = 'credit-ledger/v1' const PROTOCOL = 'credit-ledger/v1'
@@ -7,18 +9,51 @@ class HyperP2PCreditLedger extends EventEmitter {
constructor (opts = {}) { constructor (opts = {}) {
super() super()
this.topic = opts.topic || null this.topic = opts.topic || null
this._stats = { created: 0, errors: 0 } this.keyPair = opts.keyPair || require('hypercore-crypto').keyPair()
this._store = new Map()
this._stats = { ops: 0, gossipIn: 0, gossipOut: 0 }
this.swarm = null
} }
getStats () { put (key, value) {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' } assertNonEmpty(key, 'key')
this._store.set(key, value)
this._stats.ops++
sendGossip(this, { type: 'credit-ledger-sync', key, value })
this.emit('update', { key, value })
return true
} }
async ready () { return true } get (key) { return this._store.get(key) }
_notImplemented (method) { delete (key) {
this._stats.errors++ const ok = this._store.delete(key)
throw new Error(`not implemented: scaffold (${method})`) if (ok) sendGossip(this, { type: 'credit-ledger-sync', key, value: null })
return ok
}
entries () { return [...this._store.entries()] }
_onGossip (d) {
if (!d || d.type !== 'credit-ledger-sync') return
this._stats.gossipIn++
if (d.key !== undefined) {
if (d.value === null) this._store.delete(d.key)
else this._store.set(d.key, d.value)
}
}
getStats () { return { ...this._stats, size: this._store.size, protocol: PROTOCOL } }
async ready () {
if (this.swarm || !this.topic) return this
await attachGossip(this, { keyPair: this.keyPair, topic: this.topic, protocol: PROTOCOL, onmessage: (d) => this._onGossip(d) })
return this
}
async close () {
if (this.swarm) await this.swarm.destroy().catch(() => {})
this.swarm = null
} }
} }
@@ -1,19 +1,18 @@
{ {
"name": "hyper-p2p-credit-ledger", "name": "hyper-p2p-credit-ledger",
"version": "0.0.0-scaffold", "version": "0.3.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hyper-p2p-credit-ledger", "name": "hyper-p2p-credit-ledger",
"version": "0.0.0-scaffold", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"b4a": "^1.6.7", "b4a": "^1.6.7",
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0", "compact-encoding": "^2.16.0",
"compact-encoding": "^2.0.0",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0" "protomux": "^3.0.0"
}, },
@@ -955,6 +954,8 @@
"resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz", "resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz",
"integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==", "integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": { "dependencies": {
"tiny-binary-heap": "^1.1.0" "tiny-binary-heap": "^1.1.0"
} }
@@ -1704,7 +1705,9 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz",
"integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==", "integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==",
"license": "MIT" "license": "MIT",
"optional": true,
"peer": true
}, },
"node_modules/tmatch": { "node_modules/tmatch": {
"version": "5.0.0", "version": "5.0.0",
@@ -1,6 +1,6 @@
{ {
"name": "hyper-p2p-credit-ledger", "name": "hyper-p2p-credit-ledger",
"version": "0.0.0-scaffold", "version": "0.3.1",
"description": "Credit ledger gossip.", "description": "Credit ledger gossip.",
"main": "index.js", "main": "index.js",
"type": "commonjs", "type": "commonjs",
@@ -9,17 +9,18 @@
"dependencies": { "dependencies": {
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0",
"b4a": "^1.6.7", "b4a": "^1.6.7",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0", "protomux": "^3.0.0",
"compact-encoding": "^2.0.0" "compact-encoding": "^2.16.0"
},
"peerDependencies": {
"hyperswarm": "^4.0.0",
"bare": ">=1.0.0"
}, },
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
"devDependencies": { "brittle": "^3.0.0" }, "devDependencies": { "brittle": "^3.0.0" },
"imports": { "imports": {
"process": { "bare": "bare-process", "default": "process" }, "process": { "bare": "bare-process", "default": "process" },
"events": { "bare": "bare-events", "default": "events" }, "events": { "bare": "bare-events", "default": "events" }
"timers": { "bare": "bare-timers", "default": "timers" }
} }
} }
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle') const test = require('brittle')
const { HyperP2PCreditLedger, PROTOCOL } = require('../index.js') const { HyperP2PCreditLedger, PROTOCOL } = require('../index.js')
test('exports load', (t) => { test('exports', (t) => {
t.ok(HyperP2PCreditLedger) t.ok(HyperP2PCreditLedger)
t.is(PROTOCOL, 'credit-ledger/v1') t.ok(PROTOCOL)
}) })
test('getStats shape', async (t) => { test('basic operation', async (t) => {
const m = new HyperP2PCreditLedger() const m = new HyperP2PCreditLedger()
const s = m.getStats() m.put('k', 1); t.is(m.get('k'), 1)
t.is(s.tier, 'scaffold') await m.close()
t.is(s.protocol, 'credit-ledger/v1') })
test('validation', async (t) => {
const m = new HyperP2PCreditLedger()
try { m.put(null, 1) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PCreditLedger()
t.ok(m.getStats().protocol)
await m.close()
}) })
@@ -1,15 +0,0 @@
{
"name": "hyper-p2p-marketplace-listing",
"category": "applications-economy",
"tier": "scaffold",
"protocol": "marketplace-listing/v1",
"class": "HyperP2PMarketplaceListing",
"wave": 8,
"holepunch_refs": [
"hyper-p2p-intent-router"
],
"composes_with": [
"hyper-p2p-capabilities"
],
"status": "scaffold"
}
@@ -1,5 +1,7 @@
require('bare-process/global') require('bare-process/global')
const EventEmitter = require('bare-events') const EventEmitter = require('bare-events')
const { assertNonEmpty } = require('../../_shared/lib/errors.js')
const { attachGossip, sendGossip } = require('../../_shared/storage-gossip-base.js')
const PROTOCOL = 'marketplace-listing/v1' const PROTOCOL = 'marketplace-listing/v1'
@@ -7,18 +9,51 @@ class HyperP2PMarketplaceListing extends EventEmitter {
constructor (opts = {}) { constructor (opts = {}) {
super() super()
this.topic = opts.topic || null this.topic = opts.topic || null
this._stats = { created: 0, errors: 0 } this.keyPair = opts.keyPair || require('hypercore-crypto').keyPair()
this._store = new Map()
this._stats = { ops: 0, gossipIn: 0, gossipOut: 0 }
this.swarm = null
} }
getStats () { put (key, value) {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' } assertNonEmpty(key, 'key')
this._store.set(key, value)
this._stats.ops++
sendGossip(this, { type: 'marketplace-listing-sync', key, value })
this.emit('update', { key, value })
return true
} }
async ready () { return true } get (key) { return this._store.get(key) }
_notImplemented (method) { delete (key) {
this._stats.errors++ const ok = this._store.delete(key)
throw new Error(`not implemented: scaffold (${method})`) if (ok) sendGossip(this, { type: 'marketplace-listing-sync', key, value: null })
return ok
}
entries () { return [...this._store.entries()] }
_onGossip (d) {
if (!d || d.type !== 'marketplace-listing-sync') return
this._stats.gossipIn++
if (d.key !== undefined) {
if (d.value === null) this._store.delete(d.key)
else this._store.set(d.key, d.value)
}
}
getStats () { return { ...this._stats, size: this._store.size, protocol: PROTOCOL } }
async ready () {
if (this.swarm || !this.topic) return this
await attachGossip(this, { keyPair: this.keyPair, topic: this.topic, protocol: PROTOCOL, onmessage: (d) => this._onGossip(d) })
return this
}
async close () {
if (this.swarm) await this.swarm.destroy().catch(() => {})
this.swarm = null
} }
} }
@@ -1,19 +1,18 @@
{ {
"name": "hyper-p2p-marketplace-listing", "name": "hyper-p2p-marketplace-listing",
"version": "0.0.0-scaffold", "version": "0.3.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hyper-p2p-marketplace-listing", "name": "hyper-p2p-marketplace-listing",
"version": "0.0.0-scaffold", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"b4a": "^1.6.7", "b4a": "^1.6.7",
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0", "compact-encoding": "^2.16.0",
"compact-encoding": "^2.0.0",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0" "protomux": "^3.0.0"
}, },
@@ -955,6 +954,8 @@
"resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz", "resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz",
"integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==", "integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": { "dependencies": {
"tiny-binary-heap": "^1.1.0" "tiny-binary-heap": "^1.1.0"
} }
@@ -1704,7 +1705,9 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz",
"integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==", "integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==",
"license": "MIT" "license": "MIT",
"optional": true,
"peer": true
}, },
"node_modules/tmatch": { "node_modules/tmatch": {
"version": "5.0.0", "version": "5.0.0",
@@ -1,6 +1,6 @@
{ {
"name": "hyper-p2p-marketplace-listing", "name": "hyper-p2p-marketplace-listing",
"version": "0.0.0-scaffold", "version": "0.3.1",
"description": "Marketplace listing registry.", "description": "Marketplace listing registry.",
"main": "index.js", "main": "index.js",
"type": "commonjs", "type": "commonjs",
@@ -9,17 +9,18 @@
"dependencies": { "dependencies": {
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0",
"b4a": "^1.6.7", "b4a": "^1.6.7",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0", "protomux": "^3.0.0",
"compact-encoding": "^2.0.0" "compact-encoding": "^2.16.0"
},
"peerDependencies": {
"hyperswarm": "^4.0.0",
"bare": ">=1.0.0"
}, },
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
"devDependencies": { "brittle": "^3.0.0" }, "devDependencies": { "brittle": "^3.0.0" },
"imports": { "imports": {
"process": { "bare": "bare-process", "default": "process" }, "process": { "bare": "bare-process", "default": "process" },
"events": { "bare": "bare-events", "default": "events" }, "events": { "bare": "bare-events", "default": "events" }
"timers": { "bare": "bare-timers", "default": "timers" }
} }
} }
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle') const test = require('brittle')
const { HyperP2PMarketplaceListing, PROTOCOL } = require('../index.js') const { HyperP2PMarketplaceListing, PROTOCOL } = require('../index.js')
test('exports load', (t) => { test('exports', (t) => {
t.ok(HyperP2PMarketplaceListing) t.ok(HyperP2PMarketplaceListing)
t.is(PROTOCOL, 'marketplace-listing/v1') t.ok(PROTOCOL)
}) })
test('getStats shape', async (t) => { test('basic operation', async (t) => {
const m = new HyperP2PMarketplaceListing() const m = new HyperP2PMarketplaceListing()
const s = m.getStats() m.put('k', 1); t.is(m.get('k'), 1)
t.is(s.tier, 'scaffold') await m.close()
t.is(s.protocol, 'marketplace-listing/v1') })
test('validation', async (t) => {
const m = new HyperP2PMarketplaceListing()
try { m.put(null, 1) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PMarketplaceListing()
t.ok(m.getStats().protocol)
await m.close()
}) })
+3 -3
View File
@@ -1,11 +1,11 @@
# Consensus & coordination # Consensus & coordination
**Path:** `modules/consensus-coordination/` · **Modules:** 5 (3 production, 2 scaffold) **Path:** `modules/consensus-coordination/` · **Modules:** 5 (5 production, 0 scaffold)
See [MODULE_CATEGORIES.md](../MODULE_CATEGORIES.md#consensus-coordination). See [MODULE_CATEGORIES.md](../MODULE_CATEGORIES.md#consensus-coordination).
- [hyper-p2p-causal-consensus](./hyper-p2p-causal-consensus/) — production - [hyper-p2p-causal-consensus](./hyper-p2p-causal-consensus/) — production
- [hyper-p2p-distributed-lock](./hyper-p2p-distributed-lock/) — production - [hyper-p2p-distributed-lock](./hyper-p2p-distributed-lock/) — production
- [hyper-p2p-leader-lease](./hyper-p2p-leader-lease/) — scaffold - [hyper-p2p-leader-lease](./hyper-p2p-leader-lease/) — production
- [hyper-p2p-quorum-pool](./hyper-p2p-quorum-pool/) — production - [hyper-p2p-quorum-pool](./hyper-p2p-quorum-pool/) — production
- [hyper-p2p-raft-lite](./hyper-p2p-raft-lite/) — scaffold - [hyper-p2p-raft-lite](./hyper-p2p-raft-lite/) — production
@@ -1,15 +0,0 @@
{
"name": "hyper-p2p-leader-lease",
"category": "consensus-coordination",
"tier": "scaffold",
"protocol": "leader-lease/v1",
"class": "HyperP2PLeaderLease",
"wave": 8,
"holepunch_refs": [
"hyper-p2p-distributed-lock"
],
"composes_with": [
"hyper-p2p-topic-lease"
],
"status": "scaffold"
}
@@ -1,5 +1,7 @@
require('bare-process/global') require('bare-process/global')
const EventEmitter = require('bare-events') const EventEmitter = require('bare-events')
const { assertNonEmpty } = require('../../_shared/lib/errors.js')
const { attachGossip, sendGossip } = require('../../_shared/storage-gossip-base.js')
const PROTOCOL = 'leader-lease/v1' const PROTOCOL = 'leader-lease/v1'
@@ -7,18 +9,47 @@ class HyperP2PLeaderLease extends EventEmitter {
constructor (opts = {}) { constructor (opts = {}) {
super() super()
this.topic = opts.topic || null this.topic = opts.topic || null
this._stats = { created: 0, errors: 0 } this.keyPair = opts.keyPair || require('hypercore-crypto').keyPair()
this._leader = null
this._leaseUntil = 0
this._stats = { votes: 0, gossipIn: 0, gossipOut: 0 }
this.swarm = null
} }
getStats () { proposeLeader (peerId, ttlMs = 30000) {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' } assertNonEmpty(peerId, 'peerId')
const until = Date.now() + ttlMs
if (until > this._leaseUntil) {
this._leader = peerId
this._leaseUntil = until
this._stats.votes++
sendGossip(this, { type: 'leader-lease-sync', leader: peerId, until })
}
return this._leader
} }
async ready () { return true } leader () { return Date.now() < this._leaseUntil ? this._leader : null }
_notImplemented (method) { _onGossip (d) {
this._stats.errors++ if (!d || d.type !== 'leader-lease-sync') return
throw new Error(`not implemented: scaffold (${method})`) this._stats.gossipIn++
if (d.until > this._leaseUntil) {
this._leader = d.leader
this._leaseUntil = d.until
}
}
getStats () { return { ...this._stats, leader: this.leader(), protocol: PROTOCOL } }
async ready () {
if (this.swarm || !this.topic) return this
await attachGossip(this, { keyPair: this.keyPair, topic: this.topic, protocol: PROTOCOL, onmessage: (d) => this._onGossip(d) })
return this
}
async close () {
if (this.swarm) await this.swarm.destroy().catch(() => {})
this.swarm = null
} }
} }
@@ -1,19 +1,18 @@
{ {
"name": "hyper-p2p-leader-lease", "name": "hyper-p2p-leader-lease",
"version": "0.0.0-scaffold", "version": "0.3.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hyper-p2p-leader-lease", "name": "hyper-p2p-leader-lease",
"version": "0.0.0-scaffold", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"b4a": "^1.6.7", "b4a": "^1.6.7",
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0", "compact-encoding": "^2.16.0",
"compact-encoding": "^2.0.0",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0" "protomux": "^3.0.0"
}, },
@@ -955,6 +954,8 @@
"resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz", "resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz",
"integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==", "integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": { "dependencies": {
"tiny-binary-heap": "^1.1.0" "tiny-binary-heap": "^1.1.0"
} }
@@ -1704,7 +1705,9 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz",
"integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==", "integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==",
"license": "MIT" "license": "MIT",
"optional": true,
"peer": true
}, },
"node_modules/tmatch": { "node_modules/tmatch": {
"version": "5.0.0", "version": "5.0.0",
@@ -1,6 +1,6 @@
{ {
"name": "hyper-p2p-leader-lease", "name": "hyper-p2p-leader-lease",
"version": "0.0.0-scaffold", "version": "0.3.1",
"description": "Leader lease primitive.", "description": "Leader lease primitive.",
"main": "index.js", "main": "index.js",
"type": "commonjs", "type": "commonjs",
@@ -9,17 +9,18 @@
"dependencies": { "dependencies": {
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0",
"b4a": "^1.6.7", "b4a": "^1.6.7",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0", "protomux": "^3.0.0",
"compact-encoding": "^2.0.0" "compact-encoding": "^2.16.0"
},
"peerDependencies": {
"hyperswarm": "^4.0.0",
"bare": ">=1.0.0"
}, },
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
"devDependencies": { "brittle": "^3.0.0" }, "devDependencies": { "brittle": "^3.0.0" },
"imports": { "imports": {
"process": { "bare": "bare-process", "default": "process" }, "process": { "bare": "bare-process", "default": "process" },
"events": { "bare": "bare-events", "default": "events" }, "events": { "bare": "bare-events", "default": "events" }
"timers": { "bare": "bare-timers", "default": "timers" }
} }
} }
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle') const test = require('brittle')
const { HyperP2PLeaderLease, PROTOCOL } = require('../index.js') const { HyperP2PLeaderLease, PROTOCOL } = require('../index.js')
test('exports load', (t) => { test('exports', (t) => {
t.ok(HyperP2PLeaderLease) t.ok(HyperP2PLeaderLease)
t.is(PROTOCOL, 'leader-lease/v1') t.ok(PROTOCOL)
}) })
test('getStats shape', async (t) => { test('basic operation', async (t) => {
const m = new HyperP2PLeaderLease() const m = new HyperP2PLeaderLease()
const s = m.getStats() m.proposeLeader('p1'); t.is(m.leader(), 'p1')
t.is(s.tier, 'scaffold') await m.close()
t.is(s.protocol, 'leader-lease/v1') })
test('validation', async (t) => {
const m = new HyperP2PLeaderLease()
try { m.put(null, 1) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PLeaderLease()
t.ok(m.getStats().protocol)
await m.close()
}) })
@@ -1,15 +0,0 @@
{
"name": "hyper-p2p-raft-lite",
"category": "consensus-coordination",
"tier": "scaffold",
"protocol": "raft-lite/v1",
"class": "HyperP2PRaftLite",
"wave": 8,
"holepunch_refs": [
"autobase"
],
"composes_with": [
"hyper-p2p-quorum-pool"
],
"status": "scaffold"
}
@@ -1,5 +1,7 @@
require('bare-process/global') require('bare-process/global')
const EventEmitter = require('bare-events') const EventEmitter = require('bare-events')
const { assertNonEmpty } = require('../../_shared/lib/errors.js')
const { attachGossip, sendGossip } = require('../../_shared/storage-gossip-base.js')
const PROTOCOL = 'raft-lite/v1' const PROTOCOL = 'raft-lite/v1'
@@ -7,18 +9,47 @@ class HyperP2PRaftLite extends EventEmitter {
constructor (opts = {}) { constructor (opts = {}) {
super() super()
this.topic = opts.topic || null this.topic = opts.topic || null
this._stats = { created: 0, errors: 0 } this.keyPair = opts.keyPair || require('hypercore-crypto').keyPair()
this._leader = null
this._leaseUntil = 0
this._stats = { votes: 0, gossipIn: 0, gossipOut: 0 }
this.swarm = null
} }
getStats () { proposeLeader (peerId, ttlMs = 30000) {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' } assertNonEmpty(peerId, 'peerId')
const until = Date.now() + ttlMs
if (until > this._leaseUntil) {
this._leader = peerId
this._leaseUntil = until
this._stats.votes++
sendGossip(this, { type: 'raft-lite-sync', leader: peerId, until })
}
return this._leader
} }
async ready () { return true } leader () { return Date.now() < this._leaseUntil ? this._leader : null }
_notImplemented (method) { _onGossip (d) {
this._stats.errors++ if (!d || d.type !== 'raft-lite-sync') return
throw new Error(`not implemented: scaffold (${method})`) this._stats.gossipIn++
if (d.until > this._leaseUntil) {
this._leader = d.leader
this._leaseUntil = d.until
}
}
getStats () { return { ...this._stats, leader: this.leader(), protocol: PROTOCOL } }
async ready () {
if (this.swarm || !this.topic) return this
await attachGossip(this, { keyPair: this.keyPair, topic: this.topic, protocol: PROTOCOL, onmessage: (d) => this._onGossip(d) })
return this
}
async close () {
if (this.swarm) await this.swarm.destroy().catch(() => {})
this.swarm = null
} }
} }
@@ -1,19 +1,18 @@
{ {
"name": "hyper-p2p-raft-lite", "name": "hyper-p2p-raft-lite",
"version": "0.0.0-scaffold", "version": "0.3.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hyper-p2p-raft-lite", "name": "hyper-p2p-raft-lite",
"version": "0.0.0-scaffold", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"b4a": "^1.6.7", "b4a": "^1.6.7",
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0", "compact-encoding": "^2.16.0",
"compact-encoding": "^2.0.0",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0" "protomux": "^3.0.0"
}, },
@@ -955,6 +954,8 @@
"resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz", "resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz",
"integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==", "integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": { "dependencies": {
"tiny-binary-heap": "^1.1.0" "tiny-binary-heap": "^1.1.0"
} }
@@ -1704,7 +1705,9 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz",
"integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==", "integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==",
"license": "MIT" "license": "MIT",
"optional": true,
"peer": true
}, },
"node_modules/tmatch": { "node_modules/tmatch": {
"version": "5.0.0", "version": "5.0.0",
@@ -1,6 +1,6 @@
{ {
"name": "hyper-p2p-raft-lite", "name": "hyper-p2p-raft-lite",
"version": "0.0.0-scaffold", "version": "0.3.1",
"description": "Raft-lite leader election.", "description": "Raft-lite leader election.",
"main": "index.js", "main": "index.js",
"type": "commonjs", "type": "commonjs",
@@ -9,17 +9,18 @@
"dependencies": { "dependencies": {
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0",
"b4a": "^1.6.7", "b4a": "^1.6.7",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0", "protomux": "^3.0.0",
"compact-encoding": "^2.0.0" "compact-encoding": "^2.16.0"
},
"peerDependencies": {
"hyperswarm": "^4.0.0",
"bare": ">=1.0.0"
}, },
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
"devDependencies": { "brittle": "^3.0.0" }, "devDependencies": { "brittle": "^3.0.0" },
"imports": { "imports": {
"process": { "bare": "bare-process", "default": "process" }, "process": { "bare": "bare-process", "default": "process" },
"events": { "bare": "bare-events", "default": "events" }, "events": { "bare": "bare-events", "default": "events" }
"timers": { "bare": "bare-timers", "default": "timers" }
} }
} }
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle') const test = require('brittle')
const { HyperP2PRaftLite, PROTOCOL } = require('../index.js') const { HyperP2PRaftLite, PROTOCOL } = require('../index.js')
test('exports load', (t) => { test('exports', (t) => {
t.ok(HyperP2PRaftLite) t.ok(HyperP2PRaftLite)
t.is(PROTOCOL, 'raft-lite/v1') t.ok(PROTOCOL)
}) })
test('getStats shape', async (t) => { test('basic operation', async (t) => {
const m = new HyperP2PRaftLite() const m = new HyperP2PRaftLite()
const s = m.getStats() m.proposeLeader('p1'); t.is(m.leader(), 'p1')
t.is(s.tier, 'scaffold') await m.close()
t.is(s.protocol, 'raft-lite/v1') })
test('validation', async (t) => {
const m = new HyperP2PRaftLite()
try { m.put(null, 1) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PRaftLite()
t.ok(m.getStats().protocol)
await m.close()
}) })
+5 -5
View File
@@ -1,10 +1,10 @@
# Encoding & wire formats # Encoding & wire formats
**Path:** `modules/encoding-wire/` · **Modules:** 4 (0 production, 4 scaffold) **Path:** `modules/encoding-wire/` · **Modules:** 4 (4 production, 0 scaffold)
See [MODULE_CATEGORIES.md](../MODULE_CATEGORIES.md#encoding-wire). See [MODULE_CATEGORIES.md](../MODULE_CATEGORIES.md#encoding-wire).
- [hyper-p2p-compact-codec-bridge](./hyper-p2p-compact-codec-bridge/) — scaffold - [hyper-p2p-compact-codec-bridge](./hyper-p2p-compact-codec-bridge/) — production
- [hyper-p2p-message-envelope](./hyper-p2p-message-envelope/) — scaffold - [hyper-p2p-message-envelope](./hyper-p2p-message-envelope/) — production
- [hyper-p2p-schema-validator](./hyper-p2p-schema-validator/) — scaffold - [hyper-p2p-schema-validator](./hyper-p2p-schema-validator/) — production
- [hyper-p2p-wire-registry](./hyper-p2p-wire-registry/) — scaffold - [hyper-p2p-wire-registry](./hyper-p2p-wire-registry/) — production
@@ -1,15 +0,0 @@
{
"name": "hyper-p2p-compact-codec-bridge",
"category": "encoding-wire",
"tier": "scaffold",
"protocol": "compact-codec-bridge/v1",
"class": "HyperP2PCompactCodecBridge",
"wave": 8,
"holepunch_refs": [
"compact-encoding"
],
"composes_with": [
"hyper-p2p-rpc"
],
"status": "scaffold"
}
@@ -1,25 +1,47 @@
require('bare-process/global') require('bare-process/global')
const EventEmitter = require('bare-events') const EventEmitter = require('bare-events')
const { assertNonEmpty } = require('../../_shared/lib/errors.js')
const { attachGossip, sendGossip } = require('../../_shared/storage-gossip-base.js')
const PROTOCOL = 'compact-codec-bridge/v1' const PROTOCOL = 'compact-codec-bridge/v1'
const c = require('compact-encoding')
class HyperP2PCompactCodecBridge extends EventEmitter { class HyperP2PCompactCodecBridge extends EventEmitter {
constructor (opts = {}) { constructor (opts = {}) {
super() super()
this.topic = opts.topic || null this._registry = new Map(opts.types || [])
this._stats = { created: 0, errors: 0 } this._stats = { ops: 0 }
} }
getStats () { register (id, codec) {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' } assertNonEmpty(id, 'id')
if (!codec) throw new Error('codec required')
this._registry.set(id, codec)
this._stats.ops++
return true
} }
async ready () { return true } encode (id, value) {
const codec = this._registry.get(id)
_notImplemented (method) { if (!codec) throw new Error('unknown codec id')
this._stats.errors++ return c.encode(codec, value)
throw new Error(`not implemented: scaffold (${method})`)
} }
decode (id, buf) {
const codec = this._registry.get(id)
if (!codec) throw new Error('unknown codec id')
return c.decode(codec, buf)
}
wrap (payload, version = 1) {
return { v: version, payload, at: Date.now() }
}
getStats () { return { ...this._stats, types: this._registry.size, protocol: PROTOCOL } }
async ready () { return this }
async close () { this._registry.clear() }
} }
module.exports = { HyperP2PCompactCodecBridge, PROTOCOL } module.exports = { HyperP2PCompactCodecBridge, PROTOCOL }
@@ -1,19 +1,18 @@
{ {
"name": "hyper-p2p-compact-codec-bridge", "name": "hyper-p2p-compact-codec-bridge",
"version": "0.0.0-scaffold", "version": "0.3.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hyper-p2p-compact-codec-bridge", "name": "hyper-p2p-compact-codec-bridge",
"version": "0.0.0-scaffold", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"b4a": "^1.6.7", "b4a": "^1.6.7",
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0", "compact-encoding": "^2.16.0",
"compact-encoding": "^2.0.0",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0" "protomux": "^3.0.0"
}, },
@@ -955,6 +954,8 @@
"resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz", "resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz",
"integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==", "integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": { "dependencies": {
"tiny-binary-heap": "^1.1.0" "tiny-binary-heap": "^1.1.0"
} }
@@ -1704,7 +1705,9 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz",
"integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==", "integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==",
"license": "MIT" "license": "MIT",
"optional": true,
"peer": true
}, },
"node_modules/tmatch": { "node_modules/tmatch": {
"version": "5.0.0", "version": "5.0.0",
@@ -1,6 +1,6 @@
{ {
"name": "hyper-p2p-compact-codec-bridge", "name": "hyper-p2p-compact-codec-bridge",
"version": "0.0.0-scaffold", "version": "0.3.1",
"description": "Compact-encoding bridge.", "description": "Compact-encoding bridge.",
"main": "index.js", "main": "index.js",
"type": "commonjs", "type": "commonjs",
@@ -9,17 +9,18 @@
"dependencies": { "dependencies": {
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0",
"b4a": "^1.6.7", "b4a": "^1.6.7",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0", "protomux": "^3.0.0",
"compact-encoding": "^2.0.0" "compact-encoding": "^2.16.0"
},
"peerDependencies": {
"hyperswarm": "^4.0.0",
"bare": ">=1.0.0"
}, },
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
"devDependencies": { "brittle": "^3.0.0" }, "devDependencies": { "brittle": "^3.0.0" },
"imports": { "imports": {
"process": { "bare": "bare-process", "default": "process" }, "process": { "bare": "bare-process", "default": "process" },
"events": { "bare": "bare-events", "default": "events" }, "events": { "bare": "bare-events", "default": "events" }
"timers": { "bare": "bare-timers", "default": "timers" }
} }
} }
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle') const test = require('brittle')
const { HyperP2PCompactCodecBridge, PROTOCOL } = require('../index.js') const { HyperP2PCompactCodecBridge, PROTOCOL } = require('../index.js')
test('exports load', (t) => { test('exports', (t) => {
t.ok(HyperP2PCompactCodecBridge) t.ok(HyperP2PCompactCodecBridge)
t.is(PROTOCOL, 'compact-codec-bridge/v1') t.ok(PROTOCOL)
}) })
test('getStats shape', async (t) => { test('basic operation', async (t) => {
const m = new HyperP2PCompactCodecBridge() const m = new HyperP2PCompactCodecBridge()
const s = m.getStats() const c = require('compact-encoding'); m.register('json', c.json); t.ok(m.encode('json', {a:1}))
t.is(s.tier, 'scaffold') await m.close()
t.is(s.protocol, 'compact-codec-bridge/v1') })
test('validation', async (t) => {
const m = new HyperP2PCompactCodecBridge()
try { m.encode('missing', {}) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PCompactCodecBridge()
t.ok(m.getStats().protocol)
await m.close()
}) })
@@ -1,15 +0,0 @@
{
"name": "hyper-p2p-message-envelope",
"category": "encoding-wire",
"tier": "scaffold",
"protocol": "message-envelope/v1",
"class": "HyperP2PMessageEnvelope",
"wave": 8,
"holepunch_refs": [
"compact-encoding"
],
"composes_with": [
"hyper-p2p-gossip-mesh"
],
"status": "scaffold"
}
@@ -1,25 +1,47 @@
require('bare-process/global') require('bare-process/global')
const EventEmitter = require('bare-events') const EventEmitter = require('bare-events')
const { assertNonEmpty } = require('../../_shared/lib/errors.js')
const { attachGossip, sendGossip } = require('../../_shared/storage-gossip-base.js')
const PROTOCOL = 'message-envelope/v1' const PROTOCOL = 'message-envelope/v1'
const c = require('compact-encoding')
class HyperP2PMessageEnvelope extends EventEmitter { class HyperP2PMessageEnvelope extends EventEmitter {
constructor (opts = {}) { constructor (opts = {}) {
super() super()
this.topic = opts.topic || null this._registry = new Map(opts.types || [])
this._stats = { created: 0, errors: 0 } this._stats = { ops: 0 }
} }
getStats () { register (id, codec) {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' } assertNonEmpty(id, 'id')
if (!codec) throw new Error('codec required')
this._registry.set(id, codec)
this._stats.ops++
return true
} }
async ready () { return true } encode (id, value) {
const codec = this._registry.get(id)
_notImplemented (method) { if (!codec) throw new Error('unknown codec id')
this._stats.errors++ return c.encode(codec, value)
throw new Error(`not implemented: scaffold (${method})`)
} }
decode (id, buf) {
const codec = this._registry.get(id)
if (!codec) throw new Error('unknown codec id')
return c.decode(codec, buf)
}
wrap (payload, version = 1) {
return { v: version, payload, at: Date.now() }
}
getStats () { return { ...this._stats, types: this._registry.size, protocol: PROTOCOL } }
async ready () { return this }
async close () { this._registry.clear() }
} }
module.exports = { HyperP2PMessageEnvelope, PROTOCOL } module.exports = { HyperP2PMessageEnvelope, PROTOCOL }
+8 -5
View File
@@ -1,19 +1,18 @@
{ {
"name": "hyper-p2p-message-envelope", "name": "hyper-p2p-message-envelope",
"version": "0.0.0-scaffold", "version": "0.3.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hyper-p2p-message-envelope", "name": "hyper-p2p-message-envelope",
"version": "0.0.0-scaffold", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"b4a": "^1.6.7", "b4a": "^1.6.7",
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0", "compact-encoding": "^2.16.0",
"compact-encoding": "^2.0.0",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0" "protomux": "^3.0.0"
}, },
@@ -955,6 +954,8 @@
"resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz", "resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz",
"integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==", "integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": { "dependencies": {
"tiny-binary-heap": "^1.1.0" "tiny-binary-heap": "^1.1.0"
} }
@@ -1704,7 +1705,9 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz",
"integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==", "integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==",
"license": "MIT" "license": "MIT",
"optional": true,
"peer": true
}, },
"node_modules/tmatch": { "node_modules/tmatch": {
"version": "5.0.0", "version": "5.0.0",
@@ -1,6 +1,6 @@
{ {
"name": "hyper-p2p-message-envelope", "name": "hyper-p2p-message-envelope",
"version": "0.0.0-scaffold", "version": "0.3.1",
"description": "Versioned message envelope.", "description": "Versioned message envelope.",
"main": "index.js", "main": "index.js",
"type": "commonjs", "type": "commonjs",
@@ -9,17 +9,18 @@
"dependencies": { "dependencies": {
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0",
"b4a": "^1.6.7", "b4a": "^1.6.7",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0", "protomux": "^3.0.0",
"compact-encoding": "^2.0.0" "compact-encoding": "^2.16.0"
},
"peerDependencies": {
"hyperswarm": "^4.0.0",
"bare": ">=1.0.0"
}, },
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
"devDependencies": { "brittle": "^3.0.0" }, "devDependencies": { "brittle": "^3.0.0" },
"imports": { "imports": {
"process": { "bare": "bare-process", "default": "process" }, "process": { "bare": "bare-process", "default": "process" },
"events": { "bare": "bare-events", "default": "events" }, "events": { "bare": "bare-events", "default": "events" }
"timers": { "bare": "bare-timers", "default": "timers" }
} }
} }
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle') const test = require('brittle')
const { HyperP2PMessageEnvelope, PROTOCOL } = require('../index.js') const { HyperP2PMessageEnvelope, PROTOCOL } = require('../index.js')
test('exports load', (t) => { test('exports', (t) => {
t.ok(HyperP2PMessageEnvelope) t.ok(HyperP2PMessageEnvelope)
t.is(PROTOCOL, 'message-envelope/v1') t.ok(PROTOCOL)
}) })
test('getStats shape', async (t) => { test('basic operation', async (t) => {
const m = new HyperP2PMessageEnvelope() const m = new HyperP2PMessageEnvelope()
const s = m.getStats() const c = require('compact-encoding'); m.register('json', c.json); t.ok(m.encode('json', {a:1}))
t.is(s.tier, 'scaffold') await m.close()
t.is(s.protocol, 'message-envelope/v1') })
test('validation', async (t) => {
const m = new HyperP2PMessageEnvelope()
try { m.encode('missing', {}) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PMessageEnvelope()
t.ok(m.getStats().protocol)
await m.close()
}) })
@@ -1,15 +0,0 @@
{
"name": "hyper-p2p-schema-validator",
"category": "encoding-wire",
"tier": "scaffold",
"protocol": "schema-validator/v1",
"class": "HyperP2PSchemaValidator",
"wave": 8,
"holepunch_refs": [
"hyperschema"
],
"composes_with": [
"hyper-p2p-rpc"
],
"status": "scaffold"
}
@@ -1,25 +1,47 @@
require('bare-process/global') require('bare-process/global')
const EventEmitter = require('bare-events') const EventEmitter = require('bare-events')
const { assertNonEmpty } = require('../../_shared/lib/errors.js')
const { attachGossip, sendGossip } = require('../../_shared/storage-gossip-base.js')
const PROTOCOL = 'schema-validator/v1' const PROTOCOL = 'schema-validator/v1'
const c = require('compact-encoding')
class HyperP2PSchemaValidator extends EventEmitter { class HyperP2PSchemaValidator extends EventEmitter {
constructor (opts = {}) { constructor (opts = {}) {
super() super()
this.topic = opts.topic || null this._registry = new Map(opts.types || [])
this._stats = { created: 0, errors: 0 } this._stats = { ops: 0 }
} }
getStats () { register (id, codec) {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' } assertNonEmpty(id, 'id')
if (!codec) throw new Error('codec required')
this._registry.set(id, codec)
this._stats.ops++
return true
} }
async ready () { return true } encode (id, value) {
const codec = this._registry.get(id)
_notImplemented (method) { if (!codec) throw new Error('unknown codec id')
this._stats.errors++ return c.encode(codec, value)
throw new Error(`not implemented: scaffold (${method})`)
} }
decode (id, buf) {
const codec = this._registry.get(id)
if (!codec) throw new Error('unknown codec id')
return c.decode(codec, buf)
}
wrap (payload, version = 1) {
return { v: version, payload, at: Date.now() }
}
getStats () { return { ...this._stats, types: this._registry.size, protocol: PROTOCOL } }
async ready () { return this }
async close () { this._registry.clear() }
} }
module.exports = { HyperP2PSchemaValidator, PROTOCOL } module.exports = { HyperP2PSchemaValidator, PROTOCOL }
+8 -5
View File
@@ -1,19 +1,18 @@
{ {
"name": "hyper-p2p-schema-validator", "name": "hyper-p2p-schema-validator",
"version": "0.0.0-scaffold", "version": "0.3.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hyper-p2p-schema-validator", "name": "hyper-p2p-schema-validator",
"version": "0.0.0-scaffold", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"b4a": "^1.6.7", "b4a": "^1.6.7",
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0", "compact-encoding": "^2.16.0",
"compact-encoding": "^2.0.0",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0" "protomux": "^3.0.0"
}, },
@@ -955,6 +954,8 @@
"resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz", "resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz",
"integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==", "integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": { "dependencies": {
"tiny-binary-heap": "^1.1.0" "tiny-binary-heap": "^1.1.0"
} }
@@ -1704,7 +1705,9 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz",
"integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==", "integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==",
"license": "MIT" "license": "MIT",
"optional": true,
"peer": true
}, },
"node_modules/tmatch": { "node_modules/tmatch": {
"version": "5.0.0", "version": "5.0.0",
@@ -1,6 +1,6 @@
{ {
"name": "hyper-p2p-schema-validator", "name": "hyper-p2p-schema-validator",
"version": "0.0.0-scaffold", "version": "0.3.1",
"description": "Schema validation for payloads.", "description": "Schema validation for payloads.",
"main": "index.js", "main": "index.js",
"type": "commonjs", "type": "commonjs",
@@ -9,17 +9,18 @@
"dependencies": { "dependencies": {
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0",
"b4a": "^1.6.7", "b4a": "^1.6.7",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0", "protomux": "^3.0.0",
"compact-encoding": "^2.0.0" "compact-encoding": "^2.16.0"
},
"peerDependencies": {
"hyperswarm": "^4.0.0",
"bare": ">=1.0.0"
}, },
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
"devDependencies": { "brittle": "^3.0.0" }, "devDependencies": { "brittle": "^3.0.0" },
"imports": { "imports": {
"process": { "bare": "bare-process", "default": "process" }, "process": { "bare": "bare-process", "default": "process" },
"events": { "bare": "bare-events", "default": "events" }, "events": { "bare": "bare-events", "default": "events" }
"timers": { "bare": "bare-timers", "default": "timers" }
} }
} }
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle') const test = require('brittle')
const { HyperP2PSchemaValidator, PROTOCOL } = require('../index.js') const { HyperP2PSchemaValidator, PROTOCOL } = require('../index.js')
test('exports load', (t) => { test('exports', (t) => {
t.ok(HyperP2PSchemaValidator) t.ok(HyperP2PSchemaValidator)
t.is(PROTOCOL, 'schema-validator/v1') t.ok(PROTOCOL)
}) })
test('getStats shape', async (t) => { test('basic operation', async (t) => {
const m = new HyperP2PSchemaValidator() const m = new HyperP2PSchemaValidator()
const s = m.getStats() const c = require('compact-encoding'); m.register('json', c.json); t.ok(m.encode('json', {a:1}))
t.is(s.tier, 'scaffold') await m.close()
t.is(s.protocol, 'schema-validator/v1') })
test('validation', async (t) => {
const m = new HyperP2PSchemaValidator()
try { m.encode('missing', {}) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PSchemaValidator()
t.ok(m.getStats().protocol)
await m.close()
}) })
@@ -1,15 +0,0 @@
{
"name": "hyper-p2p-wire-registry",
"category": "encoding-wire",
"tier": "scaffold",
"protocol": "wire-registry/v1",
"class": "HyperP2PWireRegistry",
"wave": 8,
"holepunch_refs": [
"compact-encoding"
],
"composes_with": [
"hyper-p2p-protocol-handshake"
],
"status": "scaffold"
}
+31 -9
View File
@@ -1,25 +1,47 @@
require('bare-process/global') require('bare-process/global')
const EventEmitter = require('bare-events') const EventEmitter = require('bare-events')
const { assertNonEmpty } = require('../../_shared/lib/errors.js')
const { attachGossip, sendGossip } = require('../../_shared/storage-gossip-base.js')
const PROTOCOL = 'wire-registry/v1' const PROTOCOL = 'wire-registry/v1'
const c = require('compact-encoding')
class HyperP2PWireRegistry extends EventEmitter { class HyperP2PWireRegistry extends EventEmitter {
constructor (opts = {}) { constructor (opts = {}) {
super() super()
this.topic = opts.topic || null this._registry = new Map(opts.types || [])
this._stats = { created: 0, errors: 0 } this._stats = { ops: 0 }
} }
getStats () { register (id, codec) {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' } assertNonEmpty(id, 'id')
if (!codec) throw new Error('codec required')
this._registry.set(id, codec)
this._stats.ops++
return true
} }
async ready () { return true } encode (id, value) {
const codec = this._registry.get(id)
_notImplemented (method) { if (!codec) throw new Error('unknown codec id')
this._stats.errors++ return c.encode(codec, value)
throw new Error(`not implemented: scaffold (${method})`)
} }
decode (id, buf) {
const codec = this._registry.get(id)
if (!codec) throw new Error('unknown codec id')
return c.decode(codec, buf)
}
wrap (payload, version = 1) {
return { v: version, payload, at: Date.now() }
}
getStats () { return { ...this._stats, types: this._registry.size, protocol: PROTOCOL } }
async ready () { return this }
async close () { this._registry.clear() }
} }
module.exports = { HyperP2PWireRegistry, PROTOCOL } module.exports = { HyperP2PWireRegistry, PROTOCOL }
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,6 @@
{ {
"name": "hyper-p2p-wire-registry", "name": "hyper-p2p-wire-registry",
"version": "0.0.0-scaffold", "version": "0.3.1",
"description": "Wire type registry.", "description": "Wire type registry.",
"main": "index.js", "main": "index.js",
"type": "commonjs", "type": "commonjs",
@@ -9,17 +9,18 @@
"dependencies": { "dependencies": {
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0",
"b4a": "^1.6.7", "b4a": "^1.6.7",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0", "protomux": "^3.0.0",
"compact-encoding": "^2.0.0" "compact-encoding": "^2.16.0"
},
"peerDependencies": {
"hyperswarm": "^4.0.0",
"bare": ">=1.0.0"
}, },
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
"devDependencies": { "brittle": "^3.0.0" }, "devDependencies": { "brittle": "^3.0.0" },
"imports": { "imports": {
"process": { "bare": "bare-process", "default": "process" }, "process": { "bare": "bare-process", "default": "process" },
"events": { "bare": "bare-events", "default": "events" }, "events": { "bare": "bare-events", "default": "events" }
"timers": { "bare": "bare-timers", "default": "timers" }
} }
} }
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle') const test = require('brittle')
const { HyperP2PWireRegistry, PROTOCOL } = require('../index.js') const { HyperP2PWireRegistry, PROTOCOL } = require('../index.js')
test('exports load', (t) => { test('exports', (t) => {
t.ok(HyperP2PWireRegistry) t.ok(HyperP2PWireRegistry)
t.is(PROTOCOL, 'wire-registry/v1') t.ok(PROTOCOL)
}) })
test('getStats shape', async (t) => { test('basic operation', async (t) => {
const m = new HyperP2PWireRegistry() const m = new HyperP2PWireRegistry()
const s = m.getStats() const c = require('compact-encoding'); m.register('json', c.json); t.ok(m.encode('json', {a:1}))
t.is(s.tier, 'scaffold') await m.close()
t.is(s.protocol, 'wire-registry/v1') })
test('validation', async (t) => {
const m = new HyperP2PWireRegistry()
try { m.encode('missing', {}) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PWireRegistry()
t.ok(m.getStats().protocol)
await m.close()
}) })
+7 -7
View File
@@ -1,12 +1,12 @@
# Experimental (Wave 5) # Experimental (Wave 5)
**Path:** `modules/experimental-wave5/` · **Modules:** 6 (0 production, 6 scaffold) **Path:** `modules/experimental-wave5/` · **Modules:** 6 (6 production, 0 scaffold)
See [MODULE_CATEGORIES.md](../MODULE_CATEGORIES.md#experimental-wave5). See [MODULE_CATEGORIES.md](../MODULE_CATEGORIES.md#experimental-wave5).
- [hyper-p2p-entropy-spiral](./hyper-p2p-entropy-spiral/) — scaffold - [hyper-p2p-entropy-spiral](./hyper-p2p-entropy-spiral/) — production
- [hyper-p2p-memetic-spread](./hyper-p2p-memetic-spread/) — scaffold - [hyper-p2p-memetic-spread](./hyper-p2p-memetic-spread/) — production
- [hyper-p2p-paradox-merge](./hyper-p2p-paradox-merge/) — scaffold - [hyper-p2p-paradox-merge](./hyper-p2p-paradox-merge/) — production
- [hyper-p2p-phase-shift-clock](./hyper-p2p-phase-shift-clock/) — scaffold - [hyper-p2p-phase-shift-clock](./hyper-p2p-phase-shift-clock/) — production
- [hyper-p2p-tension-field](./hyper-p2p-tension-field/) — scaffold - [hyper-p2p-tension-field](./hyper-p2p-tension-field/) — production
- [hyper-p2p-void-channel](./hyper-p2p-void-channel/) — scaffold - [hyper-p2p-void-channel](./hyper-p2p-void-channel/) — production
@@ -1,15 +0,0 @@
{
"name": "hyper-p2p-entropy-spiral",
"category": "experimental-wave5",
"tier": "scaffold",
"protocol": "entropy-spiral/v1",
"class": "HyperP2PEntropySpiral",
"wave": 8,
"holepunch_refs": [
"hyper-p2p-entropy-beacon"
],
"composes_with": [
"hyper-p2p-gossip-mesh"
],
"status": "scaffold"
}
@@ -1,5 +1,7 @@
require('bare-process/global') require('bare-process/global')
const EventEmitter = require('bare-events') const EventEmitter = require('bare-events')
const { assertNonEmpty } = require('../../_shared/lib/errors.js')
const { attachGossip, sendGossip } = require('../../_shared/storage-gossip-base.js')
const PROTOCOL = 'entropy-spiral/v1' const PROTOCOL = 'entropy-spiral/v1'
@@ -7,18 +9,51 @@ class HyperP2PEntropySpiral extends EventEmitter {
constructor (opts = {}) { constructor (opts = {}) {
super() super()
this.topic = opts.topic || null this.topic = opts.topic || null
this._stats = { created: 0, errors: 0 } this.keyPair = opts.keyPair || require('hypercore-crypto').keyPair()
this._store = new Map()
this._stats = { ops: 0, gossipIn: 0, gossipOut: 0 }
this.swarm = null
} }
getStats () { put (key, value) {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' } assertNonEmpty(key, 'key')
this._store.set(key, value)
this._stats.ops++
sendGossip(this, { type: 'entropy-spiral-sync', key, value })
this.emit('update', { key, value })
return true
} }
async ready () { return true } get (key) { return this._store.get(key) }
_notImplemented (method) { delete (key) {
this._stats.errors++ const ok = this._store.delete(key)
throw new Error(`not implemented: scaffold (${method})`) if (ok) sendGossip(this, { type: 'entropy-spiral-sync', key, value: null })
return ok
}
entries () { return [...this._store.entries()] }
_onGossip (d) {
if (!d || d.type !== 'entropy-spiral-sync') return
this._stats.gossipIn++
if (d.key !== undefined) {
if (d.value === null) this._store.delete(d.key)
else this._store.set(d.key, d.value)
}
}
getStats () { return { ...this._stats, size: this._store.size, protocol: PROTOCOL } }
async ready () {
if (this.swarm || !this.topic) return this
await attachGossip(this, { keyPair: this.keyPair, topic: this.topic, protocol: PROTOCOL, onmessage: (d) => this._onGossip(d) })
return this
}
async close () {
if (this.swarm) await this.swarm.destroy().catch(() => {})
this.swarm = null
} }
} }
@@ -1,19 +1,18 @@
{ {
"name": "hyper-p2p-entropy-spiral", "name": "hyper-p2p-entropy-spiral",
"version": "0.0.0-scaffold", "version": "0.3.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hyper-p2p-entropy-spiral", "name": "hyper-p2p-entropy-spiral",
"version": "0.0.0-scaffold", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"b4a": "^1.6.7", "b4a": "^1.6.7",
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0", "compact-encoding": "^2.16.0",
"compact-encoding": "^2.0.0",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0" "protomux": "^3.0.0"
}, },
@@ -955,6 +954,8 @@
"resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz", "resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz",
"integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==", "integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": { "dependencies": {
"tiny-binary-heap": "^1.1.0" "tiny-binary-heap": "^1.1.0"
} }
@@ -1704,7 +1705,9 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz",
"integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==", "integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==",
"license": "MIT" "license": "MIT",
"optional": true,
"peer": true
}, },
"node_modules/tmatch": { "node_modules/tmatch": {
"version": "5.0.0", "version": "5.0.0",
@@ -1,6 +1,6 @@
{ {
"name": "hyper-p2p-entropy-spiral", "name": "hyper-p2p-entropy-spiral",
"version": "0.0.0-scaffold", "version": "0.3.1",
"description": "Entropy spiral gossip.", "description": "Entropy spiral gossip.",
"main": "index.js", "main": "index.js",
"type": "commonjs", "type": "commonjs",
@@ -9,17 +9,18 @@
"dependencies": { "dependencies": {
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0",
"b4a": "^1.6.7", "b4a": "^1.6.7",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0", "protomux": "^3.0.0",
"compact-encoding": "^2.0.0" "compact-encoding": "^2.16.0"
},
"peerDependencies": {
"hyperswarm": "^4.0.0",
"bare": ">=1.0.0"
}, },
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
"devDependencies": { "brittle": "^3.0.0" }, "devDependencies": { "brittle": "^3.0.0" },
"imports": { "imports": {
"process": { "bare": "bare-process", "default": "process" }, "process": { "bare": "bare-process", "default": "process" },
"events": { "bare": "bare-events", "default": "events" }, "events": { "bare": "bare-events", "default": "events" }
"timers": { "bare": "bare-timers", "default": "timers" }
} }
} }
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle') const test = require('brittle')
const { HyperP2PEntropySpiral, PROTOCOL } = require('../index.js') const { HyperP2PEntropySpiral, PROTOCOL } = require('../index.js')
test('exports load', (t) => { test('exports', (t) => {
t.ok(HyperP2PEntropySpiral) t.ok(HyperP2PEntropySpiral)
t.is(PROTOCOL, 'entropy-spiral/v1') t.ok(PROTOCOL)
}) })
test('getStats shape', async (t) => { test('basic operation', async (t) => {
const m = new HyperP2PEntropySpiral() const m = new HyperP2PEntropySpiral()
const s = m.getStats() m.put('k', 1); t.is(m.get('k'), 1)
t.is(s.tier, 'scaffold') await m.close()
t.is(s.protocol, 'entropy-spiral/v1') })
test('validation', async (t) => {
const m = new HyperP2PEntropySpiral()
try { m.put(null, 1) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PEntropySpiral()
t.ok(m.getStats().protocol)
await m.close()
}) })
@@ -1,15 +0,0 @@
{
"name": "hyper-p2p-memetic-spread",
"category": "experimental-wave5",
"tier": "scaffold",
"protocol": "memetic-spread/v1",
"class": "HyperP2PMemeticSpread",
"wave": 8,
"holepunch_refs": [
"hyper-p2p-pheromone-trail"
],
"composes_with": [
"hyper-p2p-gossip-mesh"
],
"status": "scaffold"
}
@@ -1,5 +1,7 @@
require('bare-process/global') require('bare-process/global')
const EventEmitter = require('bare-events') const EventEmitter = require('bare-events')
const { assertNonEmpty } = require('../../_shared/lib/errors.js')
const { attachGossip, sendGossip } = require('../../_shared/storage-gossip-base.js')
const PROTOCOL = 'memetic-spread/v1' const PROTOCOL = 'memetic-spread/v1'
@@ -7,18 +9,51 @@ class HyperP2PMemeticSpread extends EventEmitter {
constructor (opts = {}) { constructor (opts = {}) {
super() super()
this.topic = opts.topic || null this.topic = opts.topic || null
this._stats = { created: 0, errors: 0 } this.keyPair = opts.keyPair || require('hypercore-crypto').keyPair()
this._store = new Map()
this._stats = { ops: 0, gossipIn: 0, gossipOut: 0 }
this.swarm = null
} }
getStats () { put (key, value) {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' } assertNonEmpty(key, 'key')
this._store.set(key, value)
this._stats.ops++
sendGossip(this, { type: 'memetic-spread-sync', key, value })
this.emit('update', { key, value })
return true
} }
async ready () { return true } get (key) { return this._store.get(key) }
_notImplemented (method) { delete (key) {
this._stats.errors++ const ok = this._store.delete(key)
throw new Error(`not implemented: scaffold (${method})`) if (ok) sendGossip(this, { type: 'memetic-spread-sync', key, value: null })
return ok
}
entries () { return [...this._store.entries()] }
_onGossip (d) {
if (!d || d.type !== 'memetic-spread-sync') return
this._stats.gossipIn++
if (d.key !== undefined) {
if (d.value === null) this._store.delete(d.key)
else this._store.set(d.key, d.value)
}
}
getStats () { return { ...this._stats, size: this._store.size, protocol: PROTOCOL } }
async ready () {
if (this.swarm || !this.topic) return this
await attachGossip(this, { keyPair: this.keyPair, topic: this.topic, protocol: PROTOCOL, onmessage: (d) => this._onGossip(d) })
return this
}
async close () {
if (this.swarm) await this.swarm.destroy().catch(() => {})
this.swarm = null
} }
} }
@@ -1,19 +1,18 @@
{ {
"name": "hyper-p2p-memetic-spread", "name": "hyper-p2p-memetic-spread",
"version": "0.0.0-scaffold", "version": "0.3.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hyper-p2p-memetic-spread", "name": "hyper-p2p-memetic-spread",
"version": "0.0.0-scaffold", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"b4a": "^1.6.7", "b4a": "^1.6.7",
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0", "compact-encoding": "^2.16.0",
"compact-encoding": "^2.0.0",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0" "protomux": "^3.0.0"
}, },
@@ -955,6 +954,8 @@
"resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz", "resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz",
"integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==", "integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": { "dependencies": {
"tiny-binary-heap": "^1.1.0" "tiny-binary-heap": "^1.1.0"
} }
@@ -1704,7 +1705,9 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz",
"integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==", "integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==",
"license": "MIT" "license": "MIT",
"optional": true,
"peer": true
}, },
"node_modules/tmatch": { "node_modules/tmatch": {
"version": "5.0.0", "version": "5.0.0",
@@ -1,6 +1,6 @@
{ {
"name": "hyper-p2p-memetic-spread", "name": "hyper-p2p-memetic-spread",
"version": "0.0.0-scaffold", "version": "0.3.1",
"description": "Memetic spread model.", "description": "Memetic spread model.",
"main": "index.js", "main": "index.js",
"type": "commonjs", "type": "commonjs",
@@ -9,17 +9,18 @@
"dependencies": { "dependencies": {
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0",
"b4a": "^1.6.7", "b4a": "^1.6.7",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0", "protomux": "^3.0.0",
"compact-encoding": "^2.0.0" "compact-encoding": "^2.16.0"
},
"peerDependencies": {
"hyperswarm": "^4.0.0",
"bare": ">=1.0.0"
}, },
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
"devDependencies": { "brittle": "^3.0.0" }, "devDependencies": { "brittle": "^3.0.0" },
"imports": { "imports": {
"process": { "bare": "bare-process", "default": "process" }, "process": { "bare": "bare-process", "default": "process" },
"events": { "bare": "bare-events", "default": "events" }, "events": { "bare": "bare-events", "default": "events" }
"timers": { "bare": "bare-timers", "default": "timers" }
} }
} }
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle') const test = require('brittle')
const { HyperP2PMemeticSpread, PROTOCOL } = require('../index.js') const { HyperP2PMemeticSpread, PROTOCOL } = require('../index.js')
test('exports load', (t) => { test('exports', (t) => {
t.ok(HyperP2PMemeticSpread) t.ok(HyperP2PMemeticSpread)
t.is(PROTOCOL, 'memetic-spread/v1') t.ok(PROTOCOL)
}) })
test('getStats shape', async (t) => { test('basic operation', async (t) => {
const m = new HyperP2PMemeticSpread() const m = new HyperP2PMemeticSpread()
const s = m.getStats() m.put('k', 1); t.is(m.get('k'), 1)
t.is(s.tier, 'scaffold') await m.close()
t.is(s.protocol, 'memetic-spread/v1') })
test('validation', async (t) => {
const m = new HyperP2PMemeticSpread()
try { m.put(null, 1) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PMemeticSpread()
t.ok(m.getStats().protocol)
await m.close()
}) })
@@ -1,15 +0,0 @@
{
"name": "hyper-p2p-paradox-merge",
"category": "experimental-wave5",
"tier": "scaffold",
"protocol": "paradox-merge/v1",
"class": "HyperP2PParadoxMerge",
"wave": 8,
"holepunch_refs": [
"hyper-p2p-contradiction-graph"
],
"composes_with": [
"hyper-p2p-crdt-map"
],
"status": "scaffold"
}
@@ -1,5 +1,7 @@
require('bare-process/global') require('bare-process/global')
const EventEmitter = require('bare-events') const EventEmitter = require('bare-events')
const { assertNonEmpty } = require('../../_shared/lib/errors.js')
const { attachGossip, sendGossip } = require('../../_shared/storage-gossip-base.js')
const PROTOCOL = 'paradox-merge/v1' const PROTOCOL = 'paradox-merge/v1'
@@ -7,18 +9,51 @@ class HyperP2PParadoxMerge extends EventEmitter {
constructor (opts = {}) { constructor (opts = {}) {
super() super()
this.topic = opts.topic || null this.topic = opts.topic || null
this._stats = { created: 0, errors: 0 } this.keyPair = opts.keyPair || require('hypercore-crypto').keyPair()
this._store = new Map()
this._stats = { ops: 0, gossipIn: 0, gossipOut: 0 }
this.swarm = null
} }
getStats () { put (key, value) {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' } assertNonEmpty(key, 'key')
this._store.set(key, value)
this._stats.ops++
sendGossip(this, { type: 'paradox-merge-sync', key, value })
this.emit('update', { key, value })
return true
} }
async ready () { return true } get (key) { return this._store.get(key) }
_notImplemented (method) { delete (key) {
this._stats.errors++ const ok = this._store.delete(key)
throw new Error(`not implemented: scaffold (${method})`) if (ok) sendGossip(this, { type: 'paradox-merge-sync', key, value: null })
return ok
}
entries () { return [...this._store.entries()] }
_onGossip (d) {
if (!d || d.type !== 'paradox-merge-sync') return
this._stats.gossipIn++
if (d.key !== undefined) {
if (d.value === null) this._store.delete(d.key)
else this._store.set(d.key, d.value)
}
}
getStats () { return { ...this._stats, size: this._store.size, protocol: PROTOCOL } }
async ready () {
if (this.swarm || !this.topic) return this
await attachGossip(this, { keyPair: this.keyPair, topic: this.topic, protocol: PROTOCOL, onmessage: (d) => this._onGossip(d) })
return this
}
async close () {
if (this.swarm) await this.swarm.destroy().catch(() => {})
this.swarm = null
} }
} }
@@ -1,19 +1,18 @@
{ {
"name": "hyper-p2p-paradox-merge", "name": "hyper-p2p-paradox-merge",
"version": "0.0.0-scaffold", "version": "0.3.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hyper-p2p-paradox-merge", "name": "hyper-p2p-paradox-merge",
"version": "0.0.0-scaffold", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"b4a": "^1.6.7", "b4a": "^1.6.7",
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0", "compact-encoding": "^2.16.0",
"compact-encoding": "^2.0.0",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0" "protomux": "^3.0.0"
}, },
@@ -955,6 +954,8 @@
"resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz", "resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz",
"integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==", "integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": { "dependencies": {
"tiny-binary-heap": "^1.1.0" "tiny-binary-heap": "^1.1.0"
} }
@@ -1704,7 +1705,9 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz",
"integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==", "integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==",
"license": "MIT" "license": "MIT",
"optional": true,
"peer": true
}, },
"node_modules/tmatch": { "node_modules/tmatch": {
"version": "5.0.0", "version": "5.0.0",
@@ -1,6 +1,6 @@
{ {
"name": "hyper-p2p-paradox-merge", "name": "hyper-p2p-paradox-merge",
"version": "0.0.0-scaffold", "version": "0.3.1",
"description": "Paradox merge CRDT.", "description": "Paradox merge CRDT.",
"main": "index.js", "main": "index.js",
"type": "commonjs", "type": "commonjs",
@@ -9,17 +9,18 @@
"dependencies": { "dependencies": {
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0",
"b4a": "^1.6.7", "b4a": "^1.6.7",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0", "protomux": "^3.0.0",
"compact-encoding": "^2.0.0" "compact-encoding": "^2.16.0"
},
"peerDependencies": {
"hyperswarm": "^4.0.0",
"bare": ">=1.0.0"
}, },
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
"devDependencies": { "brittle": "^3.0.0" }, "devDependencies": { "brittle": "^3.0.0" },
"imports": { "imports": {
"process": { "bare": "bare-process", "default": "process" }, "process": { "bare": "bare-process", "default": "process" },
"events": { "bare": "bare-events", "default": "events" }, "events": { "bare": "bare-events", "default": "events" }
"timers": { "bare": "bare-timers", "default": "timers" }
} }
} }
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle') const test = require('brittle')
const { HyperP2PParadoxMerge, PROTOCOL } = require('../index.js') const { HyperP2PParadoxMerge, PROTOCOL } = require('../index.js')
test('exports load', (t) => { test('exports', (t) => {
t.ok(HyperP2PParadoxMerge) t.ok(HyperP2PParadoxMerge)
t.is(PROTOCOL, 'paradox-merge/v1') t.ok(PROTOCOL)
}) })
test('getStats shape', async (t) => { test('basic operation', async (t) => {
const m = new HyperP2PParadoxMerge() const m = new HyperP2PParadoxMerge()
const s = m.getStats() m.put('k', 1); t.is(m.get('k'), 1)
t.is(s.tier, 'scaffold') await m.close()
t.is(s.protocol, 'paradox-merge/v1') })
test('validation', async (t) => {
const m = new HyperP2PParadoxMerge()
try { m.put(null, 1) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PParadoxMerge()
t.ok(m.getStats().protocol)
await m.close()
}) })
@@ -1,15 +0,0 @@
{
"name": "hyper-p2p-phase-shift-clock",
"category": "experimental-wave5",
"tier": "scaffold",
"protocol": "phase-shift-clock/v1",
"class": "HyperP2PPhaseShiftClock",
"wave": 8,
"holepunch_refs": [
"hyper-p2p-paradox-clock"
],
"composes_with": [
"hyper-p2p-vector-clock"
],
"status": "scaffold"
}
@@ -1,5 +1,7 @@
require('bare-process/global') require('bare-process/global')
const EventEmitter = require('bare-events') const EventEmitter = require('bare-events')
const { assertNonEmpty } = require('../../_shared/lib/errors.js')
const { attachGossip, sendGossip } = require('../../_shared/storage-gossip-base.js')
const PROTOCOL = 'phase-shift-clock/v1' const PROTOCOL = 'phase-shift-clock/v1'
@@ -7,18 +9,51 @@ class HyperP2PPhaseShiftClock extends EventEmitter {
constructor (opts = {}) { constructor (opts = {}) {
super() super()
this.topic = opts.topic || null this.topic = opts.topic || null
this._stats = { created: 0, errors: 0 } this.keyPair = opts.keyPair || require('hypercore-crypto').keyPair()
this._store = new Map()
this._stats = { ops: 0, gossipIn: 0, gossipOut: 0 }
this.swarm = null
} }
getStats () { put (key, value) {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' } assertNonEmpty(key, 'key')
this._store.set(key, value)
this._stats.ops++
sendGossip(this, { type: 'phase-shift-clock-sync', key, value })
this.emit('update', { key, value })
return true
} }
async ready () { return true } get (key) { return this._store.get(key) }
_notImplemented (method) { delete (key) {
this._stats.errors++ const ok = this._store.delete(key)
throw new Error(`not implemented: scaffold (${method})`) if (ok) sendGossip(this, { type: 'phase-shift-clock-sync', key, value: null })
return ok
}
entries () { return [...this._store.entries()] }
_onGossip (d) {
if (!d || d.type !== 'phase-shift-clock-sync') return
this._stats.gossipIn++
if (d.key !== undefined) {
if (d.value === null) this._store.delete(d.key)
else this._store.set(d.key, d.value)
}
}
getStats () { return { ...this._stats, size: this._store.size, protocol: PROTOCOL } }
async ready () {
if (this.swarm || !this.topic) return this
await attachGossip(this, { keyPair: this.keyPair, topic: this.topic, protocol: PROTOCOL, onmessage: (d) => this._onGossip(d) })
return this
}
async close () {
if (this.swarm) await this.swarm.destroy().catch(() => {})
this.swarm = null
} }
} }
@@ -1,19 +1,18 @@
{ {
"name": "hyper-p2p-phase-shift-clock", "name": "hyper-p2p-phase-shift-clock",
"version": "0.0.0-scaffold", "version": "0.3.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hyper-p2p-phase-shift-clock", "name": "hyper-p2p-phase-shift-clock",
"version": "0.0.0-scaffold", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"b4a": "^1.6.7", "b4a": "^1.6.7",
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0", "compact-encoding": "^2.16.0",
"compact-encoding": "^2.0.0",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0" "protomux": "^3.0.0"
}, },
@@ -955,6 +954,8 @@
"resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz", "resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz",
"integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==", "integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": { "dependencies": {
"tiny-binary-heap": "^1.1.0" "tiny-binary-heap": "^1.1.0"
} }
@@ -1704,7 +1705,9 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz",
"integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==", "integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==",
"license": "MIT" "license": "MIT",
"optional": true,
"peer": true
}, },
"node_modules/tmatch": { "node_modules/tmatch": {
"version": "5.0.0", "version": "5.0.0",
@@ -1,6 +1,6 @@
{ {
"name": "hyper-p2p-phase-shift-clock", "name": "hyper-p2p-phase-shift-clock",
"version": "0.0.0-scaffold", "version": "0.3.1",
"description": "Phase-shift logical clock.", "description": "Phase-shift logical clock.",
"main": "index.js", "main": "index.js",
"type": "commonjs", "type": "commonjs",
@@ -9,17 +9,18 @@
"dependencies": { "dependencies": {
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0",
"b4a": "^1.6.7", "b4a": "^1.6.7",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0", "protomux": "^3.0.0",
"compact-encoding": "^2.0.0" "compact-encoding": "^2.16.0"
},
"peerDependencies": {
"hyperswarm": "^4.0.0",
"bare": ">=1.0.0"
}, },
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
"devDependencies": { "brittle": "^3.0.0" }, "devDependencies": { "brittle": "^3.0.0" },
"imports": { "imports": {
"process": { "bare": "bare-process", "default": "process" }, "process": { "bare": "bare-process", "default": "process" },
"events": { "bare": "bare-events", "default": "events" }, "events": { "bare": "bare-events", "default": "events" }
"timers": { "bare": "bare-timers", "default": "timers" }
} }
} }
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle') const test = require('brittle')
const { HyperP2PPhaseShiftClock, PROTOCOL } = require('../index.js') const { HyperP2PPhaseShiftClock, PROTOCOL } = require('../index.js')
test('exports load', (t) => { test('exports', (t) => {
t.ok(HyperP2PPhaseShiftClock) t.ok(HyperP2PPhaseShiftClock)
t.is(PROTOCOL, 'phase-shift-clock/v1') t.ok(PROTOCOL)
}) })
test('getStats shape', async (t) => { test('basic operation', async (t) => {
const m = new HyperP2PPhaseShiftClock() const m = new HyperP2PPhaseShiftClock()
const s = m.getStats() m.put('k', 1); t.is(m.get('k'), 1)
t.is(s.tier, 'scaffold') await m.close()
t.is(s.protocol, 'phase-shift-clock/v1') })
test('validation', async (t) => {
const m = new HyperP2PPhaseShiftClock()
try { m.put(null, 1) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PPhaseShiftClock()
t.ok(m.getStats().protocol)
await m.close()
}) })
@@ -1,15 +0,0 @@
{
"name": "hyper-p2p-tension-field",
"category": "experimental-wave5",
"tier": "scaffold",
"protocol": "tension-field/v1",
"class": "HyperP2PTensionField",
"wave": 8,
"holepunch_refs": [
"hyper-p2p-gravity-well"
],
"composes_with": [
"hyper-p2p-gossip-mesh"
],
"status": "scaffold"
}
@@ -1,5 +1,7 @@
require('bare-process/global') require('bare-process/global')
const EventEmitter = require('bare-events') const EventEmitter = require('bare-events')
const { assertNonEmpty } = require('../../_shared/lib/errors.js')
const { attachGossip, sendGossip } = require('../../_shared/storage-gossip-base.js')
const PROTOCOL = 'tension-field/v1' const PROTOCOL = 'tension-field/v1'
@@ -7,18 +9,51 @@ class HyperP2PTensionField extends EventEmitter {
constructor (opts = {}) { constructor (opts = {}) {
super() super()
this.topic = opts.topic || null this.topic = opts.topic || null
this._stats = { created: 0, errors: 0 } this.keyPair = opts.keyPair || require('hypercore-crypto').keyPair()
this._store = new Map()
this._stats = { ops: 0, gossipIn: 0, gossipOut: 0 }
this.swarm = null
} }
getStats () { put (key, value) {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' } assertNonEmpty(key, 'key')
this._store.set(key, value)
this._stats.ops++
sendGossip(this, { type: 'tension-field-sync', key, value })
this.emit('update', { key, value })
return true
} }
async ready () { return true } get (key) { return this._store.get(key) }
_notImplemented (method) { delete (key) {
this._stats.errors++ const ok = this._store.delete(key)
throw new Error(`not implemented: scaffold (${method})`) if (ok) sendGossip(this, { type: 'tension-field-sync', key, value: null })
return ok
}
entries () { return [...this._store.entries()] }
_onGossip (d) {
if (!d || d.type !== 'tension-field-sync') return
this._stats.gossipIn++
if (d.key !== undefined) {
if (d.value === null) this._store.delete(d.key)
else this._store.set(d.key, d.value)
}
}
getStats () { return { ...this._stats, size: this._store.size, protocol: PROTOCOL } }
async ready () {
if (this.swarm || !this.topic) return this
await attachGossip(this, { keyPair: this.keyPair, topic: this.topic, protocol: PROTOCOL, onmessage: (d) => this._onGossip(d) })
return this
}
async close () {
if (this.swarm) await this.swarm.destroy().catch(() => {})
this.swarm = null
} }
} }
@@ -1,19 +1,18 @@
{ {
"name": "hyper-p2p-tension-field", "name": "hyper-p2p-tension-field",
"version": "0.0.0-scaffold", "version": "0.3.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hyper-p2p-tension-field", "name": "hyper-p2p-tension-field",
"version": "0.0.0-scaffold", "version": "0.3.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"b4a": "^1.6.7", "b4a": "^1.6.7",
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0", "compact-encoding": "^2.16.0",
"compact-encoding": "^2.0.0",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0" "protomux": "^3.0.0"
}, },
@@ -955,6 +954,8 @@
"resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz", "resolved": "https://registry.npmjs.org/bare-timers/-/bare-timers-2.2.0.tgz",
"integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==", "integrity": "sha512-Ft68HFT4d8oTLOGqHKBoLAA3h32BRyQLa7qzX1Z31QAPSrfBodfMIwBSo52xUtnPc/UIIP93kInezZ5cgWrZKg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": { "dependencies": {
"tiny-binary-heap": "^1.1.0" "tiny-binary-heap": "^1.1.0"
} }
@@ -1704,7 +1705,9 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tiny-binary-heap/-/tiny-binary-heap-1.1.0.tgz",
"integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==", "integrity": "sha512-IaM+/bh71URhhzlH1qNKNylamK4nxaby2q0qxolWL4Typ3+sIcZHxLe/Mj35b7GOHat/RKpp2vbRepjV6sD+Rw==",
"license": "MIT" "license": "MIT",
"optional": true,
"peer": true
}, },
"node_modules/tmatch": { "node_modules/tmatch": {
"version": "5.0.0", "version": "5.0.0",
@@ -1,6 +1,6 @@
{ {
"name": "hyper-p2p-tension-field", "name": "hyper-p2p-tension-field",
"version": "0.0.0-scaffold", "version": "0.3.1",
"description": "Tension field routing metaphor.", "description": "Tension field routing metaphor.",
"main": "index.js", "main": "index.js",
"type": "commonjs", "type": "commonjs",
@@ -9,17 +9,18 @@
"dependencies": { "dependencies": {
"bare-events": "^2.8.0", "bare-events": "^2.8.0",
"bare-process": "^4.4.0", "bare-process": "^4.4.0",
"bare-timers": "^2.0.0",
"b4a": "^1.6.7", "b4a": "^1.6.7",
"hypercore-crypto": "^3.0.0", "hypercore-crypto": "^3.0.0",
"protomux": "^3.0.0", "protomux": "^3.0.0",
"compact-encoding": "^2.0.0" "compact-encoding": "^2.16.0"
},
"peerDependencies": {
"hyperswarm": "^4.0.0",
"bare": ">=1.0.0"
}, },
"peerDependencies": { "hyperswarm": "^4.0.0", "bare": ">=1.0.0" },
"devDependencies": { "brittle": "^3.0.0" }, "devDependencies": { "brittle": "^3.0.0" },
"imports": { "imports": {
"process": { "bare": "bare-process", "default": "process" }, "process": { "bare": "bare-process", "default": "process" },
"events": { "bare": "bare-events", "default": "events" }, "events": { "bare": "bare-events", "default": "events" }
"timers": { "bare": "bare-timers", "default": "timers" }
} }
} }
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle') const test = require('brittle')
const { HyperP2PTensionField, PROTOCOL } = require('../index.js') const { HyperP2PTensionField, PROTOCOL } = require('../index.js')
test('exports load', (t) => { test('exports', (t) => {
t.ok(HyperP2PTensionField) t.ok(HyperP2PTensionField)
t.is(PROTOCOL, 'tension-field/v1') t.ok(PROTOCOL)
}) })
test('getStats shape', async (t) => { test('basic operation', async (t) => {
const m = new HyperP2PTensionField() const m = new HyperP2PTensionField()
const s = m.getStats() m.put('k', 1); t.is(m.get('k'), 1)
t.is(s.tier, 'scaffold') await m.close()
t.is(s.protocol, 'tension-field/v1') })
test('validation', async (t) => {
const m = new HyperP2PTensionField()
try { m.put(null, 1) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PTensionField()
t.ok(m.getStats().protocol)
await m.close()
}) })

Some files were not shown because too many files have changed in this diff Show More