@olane/o-config 0.4.1 → 0.4.3

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;AAKpC,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,YASjC,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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olane/o-config",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "type": "module",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -62,18 +62,18 @@
62
62
  "@libp2p/identify": "^3.0.35",
63
63
  "@libp2p/interface": "^2.10.4",
64
64
  "@libp2p/kad-dht": "^15.1.11",
65
- "@libp2p/memory": "^1.1.11",
65
+ "@libp2p/memory": "^1.1.14",
66
66
  "@libp2p/peer-id-factory": "^4.2.4",
67
- "@libp2p/peer-store": "^11.2.5",
68
- "@libp2p/ping": "^2.0.35",
69
- "@libp2p/pubsub": "^10.1.16",
67
+ "@libp2p/peer-store": "^11.2.7",
68
+ "@libp2p/ping": "^2.0.37",
69
+ "@libp2p/pubsub": "^10.1.18",
70
70
  "@libp2p/tcp": "^10.1.19",
71
- "@libp2p/websockets": "^9.2.18",
72
- "@libp2p/webtransport": "^5.0.50",
71
+ "@libp2p/websockets": "^9.2.19",
72
+ "@libp2p/webtransport": "^5.0.51",
73
73
  "@multiformats/multiaddr": "^12.5.0",
74
74
  "it-all": "^3.0.9",
75
75
  "it-pushable": "^3.2.3",
76
- "libp2p": "^2.8.11",
76
+ "libp2p": "^2.10.0",
77
77
  "uint8arraylist": "^2.4.8"
78
78
  }
79
79
  }