helia-coord 1.1.0 → 1.1.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.
@@ -66,7 +66,8 @@ class IpfsAdapter {
66
66
 
67
67
  // Get multiaddrs that can be used to connect to this node.
68
68
  // const addrs = id2.addresses.map(elem => elem.toString())
69
- const addrs = this.ipfs.libp2p.getMultiaddrs().map(elem => elem.toString())
69
+ let addrs = this.ipfs.libp2p.getMultiaddrs()
70
+ addrs = addrs.map(elem => elem.toString())
70
71
  // this.state.ipfsMultiaddrs = addrs
71
72
  this.ipfsMultiaddrs = addrs
72
73
 
@@ -107,9 +107,8 @@ class TimerControllers {
107
107
  async listPubsubChannels () {
108
108
  const ipfs = this.adapters.ipfs.ipfs
109
109
 
110
- // const pubsubChans = await ipfs.pubsub.ls()
111
- const pubsubChans = ipfs.libp2p.services.pubsub.subscriptions
112
- console.log(`subscribed pubsub channels: ${JSON.stringify(pubsubChans, null, 2)}`)
110
+ const pubsubChans = ipfs.libp2p.services.pubsub.getTopics()
111
+ // console.log(`subscribed pubsub channels: ${JSON.stringify(pubsubChans, null, 2)}`)
113
112
  this.adapters.log.statusLog(2, `subscribed pubsub channels: ${JSON.stringify(pubsubChans, null, 2)}`)
114
113
 
115
114
  return true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "helia-coord",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "A JS library for helping IPFS peers coordinate, find a common interest, and stay connected around that interest.",
5
5
  "main": "./index.js",
6
6
  "type": "module",
@@ -20,7 +20,8 @@ class AdaptersMock {
20
20
  pubsub: {
21
21
  publish: async () => {},
22
22
  subscribe: async () => {},
23
- subscriptions: []
23
+ subscriptions: [],
24
+ getTopics: () => []
24
25
  }
25
26
  }
26
27
  }
@@ -29,9 +29,9 @@ const ipfs = {
29
29
  peerId: {
30
30
  toString: () => 'fake-peerId'
31
31
  },
32
- getMultiaddrs: () => [],
32
+ getMultiaddrs: () => ['a', 'b'],
33
33
  dial: async () => {},
34
- getPeers: async () => [],
34
+ getPeers: async () => ['a', 'b'],
35
35
  services: {
36
36
  pubsub: {
37
37
  publish: async () => {},