@peerbit/trusted-network 2.0.2 → 2.0.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 +4 -3
- package/lib/esm/controller.d.ts +1 -1
- package/package.json +4 -4
- package/src/controller.ts +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# Trusted network
|
|
2
2
|
## 🚧 Experimental state 🚧
|
|
3
3
|
|
|
4
|
-
A store that lets you build trusted networks of identities
|
|
5
|
-
|
|
4
|
+
A store that lets you build trusted networks of identities.
|
|
5
|
+
|
|
6
|
+
The store is defined by the "root trust" which has the responsibility in the beginning to trust additional identities. Later, these identities can add more identities to the network.
|
|
6
7
|
Trusted identities can also be revoked.
|
|
7
8
|
|
|
8
|
-
Distributing content among untrusted peers will be unreliable and not resilient to malicious parties that
|
|
9
|
+
Distributing content among untrusted peers will be unreliable, and not resilient to malicious parties that start to participate in the replication process with large amount (>> min replicas) of nodes followed by shutting them down simultaneously (no way for the original peers recover all lost data). To mitigate this, you can launch your program in a "Network", which is basically a list of nodes that trust each other. Symbolically you could thing of this as a VPC.
|
|
9
10
|
|
|
10
11
|
To do this, you only have to implement the "Network" interface:
|
|
11
12
|
```typescript
|
package/lib/esm/controller.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { PublicSignKey } from "@peerbit/crypto";
|
|
|
4
4
|
import { DeleteOperation } from "@peerbit/document";
|
|
5
5
|
import { IdentityRelation } from "./identity-graph.js";
|
|
6
6
|
import { Program } from "@peerbit/program";
|
|
7
|
-
import { PeerId } from "@libp2p/interface
|
|
7
|
+
import { PeerId } from "@libp2p/interface/peer-id";
|
|
8
8
|
type IdentityGraphArgs = {
|
|
9
9
|
canRead?: CanRead<IdentityRelation>;
|
|
10
10
|
role?: Role;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peerbit/trusted-network",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "Access controller that operates on a DB",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@dao-xyz/borsh": "^5.1.5",
|
|
34
34
|
"@peerbit/crypto": "1.0.5",
|
|
35
|
-
"@peerbit/document": "3.0.
|
|
35
|
+
"@peerbit/document": "3.0.4"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@ethersproject/wallet": "^5.7.0",
|
|
39
|
-
"@peerbit/test-utils": "^1.0.
|
|
39
|
+
"@peerbit/test-utils": "^1.0.19",
|
|
40
40
|
"@peerbit/time": "1.0.2"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "017864072da27e6adf8955eab5287f93d2e8f610"
|
|
43
43
|
}
|
package/src/controller.ts
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "./identity-graph.js";
|
|
25
25
|
import { Program } from "@peerbit/program";
|
|
26
26
|
import { sha256Base64Sync } from "@peerbit/crypto";
|
|
27
|
-
import { PeerId } from "@libp2p/interface
|
|
27
|
+
import { PeerId } from "@libp2p/interface/peer-id";
|
|
28
28
|
|
|
29
29
|
const coercePublicKey = (publicKey: PublicSignKey | PeerId) => {
|
|
30
30
|
return publicKey instanceof PublicSignKey
|