@bitsocial/pubsub-voting 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/client/voter.d.ts +1 -1
- package/dist/transport/types.d.ts +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ The same engine generalizes to the original use case in [pkc-js issue #25](https
|
|
|
18
18
|
- The engine is reusable across clients and contests.
|
|
19
19
|
- The core (`schema/`, `verify/`, `crdt/`, `tally/`) is transport-agnostic and unit-testable without a network. libp2p only appears in `transport/`.
|
|
20
20
|
|
|
21
|
-
This library does not start its own node. It consumes the host's running Helia node directly — no adapter — and drives that node's gossipsub service and blockstore itself. The node must carry a pubsub service at `libp2p.services.pubsub` (a plain Helia node does not — register e.g. `@libp2p/gossipsub`), a usable `blockstore`, and a libp2p fetch service at `libp2p.services.fetch` (register `@libp2p/fetch` — the checkpoint root-record pull rides it); construction throws `MissingPubsubError` / `MissingBlockstoreError` / `MissingFetchError` otherwise. With pkc-js
|
|
21
|
+
This library does not start its own node. It consumes the host's running Helia node directly — no adapter — and drives that node's gossipsub service and blockstore itself. The node must carry a pubsub service at `libp2p.services.pubsub` (a plain Helia node does not — register e.g. `@libp2p/gossipsub`), a usable `blockstore`, and a libp2p fetch service at `libp2p.services.fetch` (register `@libp2p/fetch` — the checkpoint root-record pull rides it); construction throws `MissingPubsubError` / `MissingBlockstoreError` / `MissingFetchError` otherwise. With pkc-js that node is reached at `pkc.clients.libp2pJsClients[key].heliaNode` — the documented, semver-covered accessor since pkc-js `0.0.72` (see [DESIGN.md, Deferred pkc-js work](./DESIGN.md#deferred-pkc-js-work)).
|
|
22
22
|
|
|
23
23
|
## Design at a glance
|
|
24
24
|
|
package/dist/client/voter.d.ts
CHANGED
|
@@ -182,7 +182,7 @@ export interface VoteClient {
|
|
|
182
182
|
export interface PubsubVoterOptions {
|
|
183
183
|
/**
|
|
184
184
|
* The host's running Helia node (the value `createHelia` returns; for pkc-js it is
|
|
185
|
-
* `pkc.clients.libp2pJsClients[key].
|
|
185
|
+
* `pkc.clients.libp2pJsClients[key].heliaNode`). The only host-node seam, passed
|
|
186
186
|
* directly with no adapter. It MUST carry a gossipsub service at
|
|
187
187
|
* `libp2p.services.pubsub`, a usable `blockstore`, and a libp2p fetch service at
|
|
188
188
|
* `libp2p.services.fetch`; the constructor throws `MissingPubsubError` /
|
|
@@ -18,7 +18,7 @@ import type { RootRecord } from "./messages.js";
|
|
|
18
18
|
*
|
|
19
19
|
* The library does not start a node and does not take a host SDK. It receives the
|
|
20
20
|
* host's already-running **Helia node** directly (e.g. the value `createHelia` returns,
|
|
21
|
-
* which for a pkc-js host is `pkc.clients.libp2pJsClients[key].
|
|
21
|
+
* which for a pkc-js host is `pkc.clients.libp2pJsClients[key].heliaNode`) and drives its
|
|
22
22
|
* libp2p pubsub + blockstore itself — there is no host-written adapter. The node must
|
|
23
23
|
* carry a gossipsub service at `libp2p.services.pubsub` and a usable `blockstore`;
|
|
24
24
|
* construction enforces both (see `requireHeliaServices` / `MissingPubsubError` /
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitsocial/pubsub-voting",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Trustless pubsub voting over a shared libp2p/Helia node.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "GPL-3.0-or-later",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
27
27
|
"typecheck:examples": "tsc -p tsconfig.examples.json --noEmit",
|
|
28
28
|
"test": "vitest run",
|
|
29
|
+
"test:coverage": "vitest run --coverage",
|
|
29
30
|
"test:watch": "vitest",
|
|
30
31
|
"test:integration": "vitest run -c vitest.integration.config.ts",
|
|
31
32
|
"build:bench": "tsc -p benchmark/tsconfig.json",
|
|
@@ -64,9 +65,10 @@
|
|
|
64
65
|
"@libp2p/identify": "4.1.8",
|
|
65
66
|
"@libp2p/tcp": "11.0.22",
|
|
66
67
|
"@multiformats/multiaddr": "13.0.3",
|
|
67
|
-
"@pkcprotocol/pkc-js": "0.0.
|
|
68
|
+
"@pkcprotocol/pkc-js": "0.0.72",
|
|
68
69
|
"@release-it/conventional-changelog": "10.0.6",
|
|
69
70
|
"@types/better-sqlite3": "7.6.13",
|
|
71
|
+
"@vitest/coverage-v8": "4.1.9",
|
|
70
72
|
"commitizen": "4.3.1",
|
|
71
73
|
"cz-conventional-changelog": "3.3.0",
|
|
72
74
|
"husky": "9.1.7",
|