helia-coord 1.2.12 → 1.2.13

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.
@@ -159,14 +159,14 @@ class RelayUseCases {
159
159
 
160
160
  // Check if target circuit-relay is currently conected to the node.
161
161
  const connectedPeer = connectedPeers.filter(peerId => thisRelay.ipfsId.includes(peerId))
162
- console.log('connectedPeer: ', connectedPeer)
162
+ // console.log('connectedPeer: ', connectedPeer)
163
163
 
164
164
  // Get the peer data corresponding to this relay
165
165
  // let peerData = thisNode.peerData.filter(x => x.from.includes(thisRelay.ipfsId))
166
166
  const peerIds = thisNode.peerData.map(x => x.from)
167
167
  // console.log('peerIds: ', peerIds)
168
168
  const peerIndex = peerIds.indexOf(thisRelay.ipfsId)
169
- console.log('peerIndex: ', peerIndex)
169
+ // console.log('peerIndex: ', peerIndex)
170
170
  // peerData = peerData[0]
171
171
 
172
172
  // Update the connection state.
@@ -175,7 +175,7 @@ class RelayUseCases {
175
175
  // Already connected.
176
176
  thisRelay.connected = true
177
177
  // console.log(`Already connected to Circuit Relay ${thisRelay.multiaddr}`)
178
- this.adapters.log.statusLog(0, `Already connected to Circuit Relay ${thisRelay.multiaddr}`)
178
+ this.adapters.log.statusLog(2, `Already connected to Circuit Relay ${thisRelay.multiaddr}`)
179
179
 
180
180
  // Make sure the peer data corresponding to this connect relay reflects
181
181
  // the multiaddr that was used to successfully connect to it.
@@ -188,7 +188,7 @@ class RelayUseCases {
188
188
 
189
189
  const libp2p = this.adapters.ipfs.ipfs.libp2p
190
190
  const remoteConnection = libp2p.getConnections(connectedPeer[0])
191
- console.log(`multiaddr ${thisRelay.multiaddr} should be ${remoteConnection[0].remoteAddr.toString()} `)
191
+ // console.log(`multiaddr ${thisRelay.multiaddr} should be ${remoteConnection[0].remoteAddr.toString()} `)
192
192
 
193
193
  thisRelay.multiaddr = remoteConnection[0].remoteAddr.toString()
194
194
 
@@ -199,7 +199,7 @@ class RelayUseCases {
199
199
  thisNode.peerData[peerIndex].data.connectionAddr = remoteConnection[0].remoteAddr.toString()
200
200
  }
201
201
 
202
- console.log(`Multiaddr changed to ${thisRelay.multiaddr}`)
202
+ // console.log(`Multiaddr changed to ${thisRelay.multiaddr}`)
203
203
 
204
204
  if (thisRelay.multiaddr.includes('/p2p-circuit')) {
205
205
  for (const connection of libp2p.getConnections()) {
@@ -218,8 +218,9 @@ class RelayUseCases {
218
218
  thisRelay.connected = connStatus.success
219
219
  // console.log(`thisRelay.connected: ${thisRelay.connected}`)
220
220
 
221
+ // Debugging: Trying to figure out the best way to select the multiaddr
221
222
  if (thisRelay.connected && !thisRelay.multiaddr.includes('/tcp/')) {
222
- console.log('thisRelay.multiaddr: ', thisRelay.multiaddr)
223
+ // console.log('thisRelay.multiaddr: ', thisRelay.multiaddr)
223
224
 
224
225
  const libp2p = this.adapters.ipfs.ipfs.libp2p
225
226
  for (const connection of libp2p.getConnections()) {
@@ -230,13 +231,13 @@ class RelayUseCases {
230
231
 
231
232
  if (thisRelay.connected) {
232
233
  this.adapters.log.statusLog(
233
- 0,
234
+ 2,
234
235
  `Connected to Circuit Relay peer ${thisRelay.ipfsId} with multiaddress ${thisRelay.multiaddr}`
235
236
  )
236
237
  console.log(`connectToCRs() Connected to Circuit Relay peer ${thisRelay.ipfsId}`)
237
238
  } else {
238
239
  this.adapters.log.statusLog(
239
- 0,
240
+ 2,
240
241
  `Could not connect to Circuit Relay with this multiaddr: ${thisRelay.multiaddr}, reason: ${connStatus.details}`
241
242
  )
242
243
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "helia-coord",
3
- "version": "1.2.12",
3
+ "version": "1.2.13",
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",