@olane/o-config 0.4.1 → 0.4.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAOpC,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC;IACnB,oBAAoB,CAAC,EAAE,GAAG,EAAE,CAAC;IAC7B,YAAY,CAAC,EAAE,GAAG,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,eAAO,MAAM,mBAAmB,EAAE,YAcjC,CAAC"}
|
|
@@ -5,13 +5,20 @@ import { identify } from '@libp2p/identify';
|
|
|
5
5
|
import { webTransport } from '@libp2p/webtransport';
|
|
6
6
|
import { webSockets } from '@libp2p/websockets';
|
|
7
7
|
import { tcp } from '@libp2p/tcp';
|
|
8
|
+
import { kadDHT, removePublicAddressesMapper } from '@libp2p/kad-dht';
|
|
9
|
+
import { memory } from '@libp2p/memory';
|
|
8
10
|
export const defaultLibp2pConfig = {
|
|
9
|
-
listeners: [],
|
|
10
|
-
transports: [webTransport(), webSockets(), tcp()],
|
|
11
|
+
listeners: ['/ip4/0.0.0.0/tcp/0', '/ip6/::/tcp/0'],
|
|
12
|
+
transports: [webTransport(), webSockets(), tcp(), memory()],
|
|
11
13
|
connectionEncrypters: [noise()],
|
|
12
14
|
streamMuxers: [yamux()],
|
|
13
15
|
services: {
|
|
14
16
|
ping: ping(),
|
|
15
17
|
identify: identify(),
|
|
18
|
+
dht: kadDHT({
|
|
19
|
+
peerInfoMapper: removePublicAddressesMapper,
|
|
20
|
+
clientMode: false, // DO NOT CHANGE THIS, it will break the network
|
|
21
|
+
kBucketSize: 20, // peer size
|
|
22
|
+
}),
|
|
16
23
|
},
|
|
17
24
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
|
-
import { kadDHT, removePublicAddressesMapper } from '@libp2p/kad-dht';
|
|
3
2
|
import { defaultLibp2pConfig } from '../../src/config/config.js';
|
|
4
3
|
import { createNode } from '../../src/node/node.js';
|
|
5
4
|
import { CID } from 'multiformats';
|
|
@@ -23,27 +22,11 @@ describe('P2P networking', () => {
|
|
|
23
22
|
node1 = await createNode({
|
|
24
23
|
...defaultLibp2pConfig,
|
|
25
24
|
listeners: ['/ip4/0.0.0.0/tcp/0/ws'],
|
|
26
|
-
services: {
|
|
27
|
-
...defaultLibp2pConfig.services,
|
|
28
|
-
dht: kadDHT({
|
|
29
|
-
peerInfoMapper: removePublicAddressesMapper,
|
|
30
|
-
clientMode: false, // DO NOT CHANGE THIS, it will break the network
|
|
31
|
-
kBucketSize: 20, // peer size
|
|
32
|
-
}),
|
|
33
|
-
},
|
|
34
25
|
});
|
|
35
26
|
await node1.start();
|
|
36
27
|
node2 = await createNode({
|
|
37
28
|
...defaultLibp2pConfig,
|
|
38
29
|
listeners: ['/ip4/0.0.0.0/tcp/0/ws'],
|
|
39
|
-
services: {
|
|
40
|
-
...defaultLibp2pConfig.services,
|
|
41
|
-
dht: kadDHT({
|
|
42
|
-
peerInfoMapper: removePublicAddressesMapper,
|
|
43
|
-
clientMode: false, // DO NOT CHANGE THIS, it will break the network
|
|
44
|
-
kBucketSize: 20, // peer size
|
|
45
|
-
}),
|
|
46
|
-
},
|
|
47
30
|
});
|
|
48
31
|
await node2.start();
|
|
49
32
|
});
|