mirror of
https://github.com/Permissionless-Software-Foundation/bch-dex.git
synced 2026-09-21 16:52:00 -07:00
fix(get-peers): finalizing REST endpoint behavior
This commit is contained in:
Generated
+1
-1
@@ -82,7 +82,7 @@
|
||||
"standard": "17.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"ipfs-http-client": ">= 58.0.0"
|
||||
"libp2p": ">= 0.46.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@achingbrain/nat-port-mapper": {
|
||||
|
||||
@@ -85,14 +85,14 @@ class IPFS {
|
||||
async getPeers (showAll) {
|
||||
try {
|
||||
const peerData = this.ipfsCoordAdapter.ipfsCoord.thisNode.peerData
|
||||
console.log(`peerData: ${JSON.stringify(peerData, null, 2)}`)
|
||||
// console.log(`peerData: ${JSON.stringify(peerData, null, 2)}`)
|
||||
|
||||
let ipfsPeers =
|
||||
await this.ipfsCoordAdapter.ipfsCoord.adapters.ipfs.getPeers()
|
||||
console.log('ipfsPeers: ', ipfsPeers)
|
||||
// console.log('ipfsPeers: ', ipfsPeers)
|
||||
|
||||
ipfsPeers = this._removeDuplicatePeers(ipfsPeers)
|
||||
console.log('filtered ipfsPeers: ', ipfsPeers)
|
||||
// console.log('filtered ipfsPeers: ', ipfsPeers)
|
||||
|
||||
const peerDataOut = []
|
||||
|
||||
@@ -131,8 +131,8 @@ class IPFS {
|
||||
thisPeer.peerData = thisPeerData
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(
|
||||
` ${thisPeer.peer}: ${err.message}`
|
||||
console.warn(
|
||||
`warning: ${thisPeer.peer}: ${err.message}`
|
||||
)
|
||||
}
|
||||
|
||||
@@ -177,6 +177,7 @@ class IPFS {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
thisRelay.name = thisPeer[0].data.jsonLd.name
|
||||
thisRelay.description = thisPeer[0].data.jsonLd.description
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user