@serfab/cadre-core 1.8.0 → 1.9.0
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/dist/cadre-node.d.ts +153 -104
- package/dist/cadre-node.js +227 -199
- package/dist/cadre-node.js.map +1 -1
- package/dist/index.d.ts +2 -4
- package/dist/index.js +10 -11
- package/dist/index.js.map +1 -1
- package/dist/node-local-snapshot.d.ts +6 -4
- package/dist/node-local-snapshot.js +7 -3
- package/dist/node-local-snapshot.js.map +1 -1
- package/dist/peer-join-backfill.d.ts +0 -9
- package/dist/peer-join-backfill.js +2 -3
- package/dist/peer-join-backfill.js.map +1 -1
- package/dist/strand-formation-protocol.d.ts +0 -11
- package/dist/strand-formation-protocol.js +3 -4
- package/dist/strand-formation-protocol.js.map +1 -1
- package/dist/strand-fret-addrs.d.ts +54 -0
- package/dist/strand-fret-addrs.js +108 -0
- package/dist/strand-fret-addrs.js.map +1 -0
- package/dist/strand-instance-manager.d.ts +9 -38
- package/dist/strand-instance-manager.js +13 -73
- package/dist/strand-instance-manager.js.map +1 -1
- package/dist/strand-network-state-file.d.ts +12 -0
- package/dist/strand-network-state-file.js +38 -0
- package/dist/strand-network-state-file.js.map +1 -0
- package/dist/strand-network-state.d.ts +111 -0
- package/dist/strand-network-state.js +191 -0
- package/dist/strand-network-state.js.map +1 -0
- package/dist/types.d.ts +20 -23
- package/package.json +11 -10
- package/src/cadre-node.ts +238 -205
- package/src/index.ts +15 -55
- package/src/node-local-snapshot.ts +12 -7
- package/src/peer-join-backfill.ts +2 -3
- package/src/strand-formation-protocol.ts +3 -4
- package/src/strand-fret-addrs.ts +145 -0
- package/src/strand-instance-manager.ts +20 -96
- package/src/strand-network-state-file.ts +40 -0
- package/src/strand-network-state.ts +243 -0
- package/src/types.ts +20 -23
- package/dist/strand-peer-book-file.d.ts +0 -12
- package/dist/strand-peer-book-file.js +0 -37
- package/dist/strand-peer-book-file.js.map +0 -1
- package/dist/strand-peer-book-protocol.d.ts +0 -168
- package/dist/strand-peer-book-protocol.js +0 -356
- package/dist/strand-peer-book-protocol.js.map +0 -1
- package/dist/strand-peer-book-swap.d.ts +0 -104
- package/dist/strand-peer-book-swap.js +0 -284
- package/dist/strand-peer-book-swap.js.map +0 -1
- package/dist/strand-peer-book.d.ts +0 -159
- package/dist/strand-peer-book.js +0 -361
- package/dist/strand-peer-book.js.map +0 -1
- package/dist/strand-peer-observer.d.ts +0 -88
- package/dist/strand-peer-observer.js +0 -180
- package/dist/strand-peer-observer.js.map +0 -1
- package/src/strand-peer-book-file.ts +0 -39
- package/src/strand-peer-book-protocol.ts +0 -466
- package/src/strand-peer-book-swap.ts +0 -338
- package/src/strand-peer-book.ts +0 -475
- package/src/strand-peer-observer.ts +0 -235
package/dist/types.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import type { SeedTrustPolicy } from './seed-trust-policy.js';
|
|
|
11
11
|
import type { KeyStore, KeyId } from './key-store.js';
|
|
12
12
|
import type { TrustedOwnerStore, TrustSource } from './trusted-owner-store.js';
|
|
13
13
|
import type { BootstrapPeerStore } from './bootstrap-peer-store.js';
|
|
14
|
-
import type {
|
|
14
|
+
import type { StrandNetworkStateStore } from './strand-network-state.js';
|
|
15
15
|
import type { EnrolledMachineStore } from './enrolled-machine-store.js';
|
|
16
16
|
import type { JoinedStrandStore } from './joined-strand-store.js';
|
|
17
17
|
import type { PushNotifier } from './push-notifier.js';
|
|
@@ -955,32 +955,29 @@ export interface CadreNodeConfig {
|
|
|
955
955
|
store?: JoinedStrandStore;
|
|
956
956
|
};
|
|
957
957
|
/**
|
|
958
|
-
* Node-local strand
|
|
959
|
-
*
|
|
960
|
-
*
|
|
961
|
-
*
|
|
962
|
-
*
|
|
963
|
-
*
|
|
964
|
-
*
|
|
965
|
-
*
|
|
966
|
-
*
|
|
967
|
-
*
|
|
968
|
-
*
|
|
969
|
-
*
|
|
970
|
-
*
|
|
971
|
-
*
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
* `DurableSlot` and inject `PersistentStrandPeerBookStore.open(slot, partyId)`.
|
|
975
|
-
*/
|
|
976
|
-
strandPeers?: {
|
|
958
|
+
* Node-local strand network state (see `strand-network-state.ts`): per strand, the
|
|
959
|
+
* state Optimystic's db-p2p saves for the strand's libp2p node — its FRET routing
|
|
960
|
+
* table, each entry carrying the peer's signed address record. A strand node reads
|
|
961
|
+
* it back when it is built and re-imports the table, so a restarted machine already
|
|
962
|
+
* holds addresses for the strand peers it was talking to (gotchoices/sereus#18).
|
|
963
|
+
* Sibling of {@link bootstrapPeers} — same NON-replicated, per-party,
|
|
964
|
+
* injected-backend shape — and, like it, nothing here is trust-bearing: FRET
|
|
965
|
+
* verifies every record at import.
|
|
966
|
+
*
|
|
967
|
+
* Absent ⇒ an in-memory store is created at start() (ephemeral: a restarted process
|
|
968
|
+
* starts every strand with an empty routing table). Every reference embedder
|
|
969
|
+
* injects a durable backend over the same slot kind as its bootstrap-peer store. A
|
|
970
|
+
* new platform needs no new store class: supply a `DurableSlot` and inject
|
|
971
|
+
* `PersistentStrandNetworkStateStore.open(slot, partyId)`.
|
|
972
|
+
*/
|
|
973
|
+
strandNetworkState?: {
|
|
977
974
|
/**
|
|
978
|
-
* Injected store instance — e.g. a `
|
|
979
|
-
* Node-only subpath `@serfab/cadre-core/strand-
|
|
975
|
+
* Injected store instance — e.g. a `FileStrandNetworkStateStore` from the
|
|
976
|
+
* Node-only subpath `@serfab/cadre-core/strand-network-state-file`, persisted in
|
|
980
977
|
* the node's state directory. Its `partyId` must match
|
|
981
978
|
* `controlNetwork.partyId`; start() fails closed on a mismatch.
|
|
982
979
|
*/
|
|
983
|
-
store?:
|
|
980
|
+
store?: StrandNetworkStateStore;
|
|
984
981
|
};
|
|
985
982
|
/**
|
|
986
983
|
* Platform push-delivery for suspended mobile peers. When present, the node's
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serfab/cadre-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Core library for Sereus cadre nodes - manages control networks and strand participation",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"types": "./dist/enrolled-machine-store-file.d.ts",
|
|
37
37
|
"import": "./dist/enrolled-machine-store-file.js"
|
|
38
38
|
},
|
|
39
|
-
"./strand-
|
|
40
|
-
"types": "./dist/strand-
|
|
41
|
-
"import": "./dist/strand-
|
|
39
|
+
"./strand-network-state-file": {
|
|
40
|
+
"types": "./dist/strand-network-state-file.d.ts",
|
|
41
|
+
"import": "./dist/strand-network-state-file.js"
|
|
42
42
|
},
|
|
43
43
|
"./push-node": {
|
|
44
44
|
"types": "./dist/push-node.d.ts",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@libp2p/tcp": "^11.0.10",
|
|
78
78
|
"@libp2p/webrtc": "6.0.14",
|
|
79
79
|
"@libp2p/websockets": "^10.1.3",
|
|
80
|
-
"@optimystic/db-p2p-storage-fs": "^1.8.
|
|
80
|
+
"@optimystic/db-p2p-storage-fs": "^1.8.1",
|
|
81
81
|
"@types/debug": "^4.1.12",
|
|
82
82
|
"@types/node": "^25.0.10",
|
|
83
83
|
"@vitest/coverage-v8": "^4.0.17",
|
|
@@ -91,13 +91,14 @@
|
|
|
91
91
|
"@libp2p/crypto": "^5.1.13",
|
|
92
92
|
"@libp2p/interface": "^3.1.0",
|
|
93
93
|
"@libp2p/peer-id": "^6.0.4",
|
|
94
|
+
"@libp2p/peer-record": "^9.0.5",
|
|
94
95
|
"@multiformats/multiaddr": "^12.5.1",
|
|
95
|
-
"@optimystic/db-core": "^1.8.
|
|
96
|
-
"@optimystic/db-p2p": "^1.8.
|
|
97
|
-
"@optimystic/quereus-plugin-crypto": "^1.8.
|
|
98
|
-
"@optimystic/quereus-plugin-optimystic": "^1.8.
|
|
96
|
+
"@optimystic/db-core": "^1.8.1",
|
|
97
|
+
"@optimystic/db-p2p": "^1.8.1",
|
|
98
|
+
"@optimystic/quereus-plugin-crypto": "^1.8.1",
|
|
99
|
+
"@optimystic/quereus-plugin-optimystic": "^1.8.1",
|
|
99
100
|
"@quereus/quereus": "^4.20.0",
|
|
100
|
-
"@serfab/quereus-plugin-sereus": "^1.
|
|
101
|
+
"@serfab/quereus-plugin-sereus": "^1.9.0",
|
|
101
102
|
"debug": "^4.4.3",
|
|
102
103
|
"libp2p": "^3.1.3",
|
|
103
104
|
"uint8arrays": "^5.1.0"
|