@peerbit/libp2p-test-utils 1.0.3 → 1.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/lib/esm/session.js +4 -4
- package/lib/esm/transports.js +2 -2
- package/package.json +3 -3
- package/src/session.ts +4 -4
- package/src/transports.ts +2 -2
package/lib/esm/session.js
CHANGED
|
@@ -41,10 +41,10 @@ export class LSession {
|
|
|
41
41
|
const result = async () => {
|
|
42
42
|
const node = await createLibp2p({
|
|
43
43
|
addresses: {
|
|
44
|
-
listen: ["/ip4/127.0.0.1/tcp/0", "/ip4/127.0.0.1/tcp/0/ws"]
|
|
44
|
+
listen: ["/ip4/127.0.0.1/tcp/0", "/ip4/127.0.0.1/tcp/0/ws"]
|
|
45
45
|
},
|
|
46
46
|
connectionManager: (options?.[i] || options)?.connectionManager ?? {
|
|
47
|
-
minConnections: 0
|
|
47
|
+
minConnections: 0
|
|
48
48
|
},
|
|
49
49
|
datastore: (options?.[i] || options)?.datastore,
|
|
50
50
|
transports: (options?.[i] || options)?.transports ??
|
|
@@ -52,11 +52,11 @@ export class LSession {
|
|
|
52
52
|
services: {
|
|
53
53
|
relay: (options?.[i] || options)?.browser ? undefined : relay(),
|
|
54
54
|
identify: identifyService(),
|
|
55
|
-
...(options?.[i] || options)?.services
|
|
55
|
+
...(options?.[i] || options)?.services
|
|
56
56
|
},
|
|
57
57
|
connectionEncryption: [noise()],
|
|
58
58
|
streamMuxers: [mplex({ disconnectThreshold: 10 })],
|
|
59
|
-
start: (options?.[i] || options)?.start
|
|
59
|
+
start: (options?.[i] || options)?.start
|
|
60
60
|
});
|
|
61
61
|
return node;
|
|
62
62
|
};
|
package/lib/esm/transports.js
CHANGED
|
@@ -7,10 +7,10 @@ import { tcp } from "@libp2p/tcp";
|
|
|
7
7
|
export const transports = (browser) => browser
|
|
8
8
|
? [
|
|
9
9
|
circuitRelayTransport({
|
|
10
|
-
discoverRelays: 1
|
|
10
|
+
discoverRelays: 1
|
|
11
11
|
}),
|
|
12
12
|
webRTC({}),
|
|
13
|
-
webSockets({ filter: filters.all })
|
|
13
|
+
webSockets({ filter: filters.all })
|
|
14
14
|
]
|
|
15
15
|
: [tcp()];
|
|
16
16
|
export const relay = () => circuitRelayServer({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peerbit/libp2p-test-utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Test utils for Peerbit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"memory-level": "^1.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@peerbit/time": "1.0.
|
|
50
|
+
"@peerbit/time": "1.0.3"
|
|
51
51
|
},
|
|
52
52
|
"localMaintainers": [
|
|
53
53
|
"dao.xyz"
|
|
54
54
|
],
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "0cfa376bc90c31e1063ddaf5435c828b490e0228"
|
|
56
56
|
}
|
package/src/session.ts
CHANGED
|
@@ -78,10 +78,10 @@ export class LSession<T> {
|
|
|
78
78
|
const result = async () => {
|
|
79
79
|
const node = await createLibp2p<T>({
|
|
80
80
|
addresses: {
|
|
81
|
-
listen: ["/ip4/127.0.0.1/tcp/0", "/ip4/127.0.0.1/tcp/0/ws"]
|
|
81
|
+
listen: ["/ip4/127.0.0.1/tcp/0", "/ip4/127.0.0.1/tcp/0/ws"]
|
|
82
82
|
},
|
|
83
83
|
connectionManager: (options?.[i] || options)?.connectionManager ?? {
|
|
84
|
-
minConnections: 0
|
|
84
|
+
minConnections: 0
|
|
85
85
|
},
|
|
86
86
|
datastore: (options?.[i] || options)?.datastore,
|
|
87
87
|
transports:
|
|
@@ -90,11 +90,11 @@ export class LSession<T> {
|
|
|
90
90
|
services: {
|
|
91
91
|
relay: (options?.[i] || options)?.browser ? undefined : relay(),
|
|
92
92
|
identify: identifyService(),
|
|
93
|
-
...(options?.[i] || options)?.services
|
|
93
|
+
...(options?.[i] || options)?.services
|
|
94
94
|
},
|
|
95
95
|
connectionEncryption: [noise()],
|
|
96
96
|
streamMuxers: [mplex({ disconnectThreshold: 10 })],
|
|
97
|
-
start: (options?.[i] || options)?.start
|
|
97
|
+
start: (options?.[i] || options)?.start
|
|
98
98
|
});
|
|
99
99
|
return node;
|
|
100
100
|
};
|
package/src/transports.ts
CHANGED