-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #449 from oceanprotocol/feature/p2p_peers_fixes
fix p2p peers
- Loading branch information
Showing
10 changed files
with
385 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,2 @@ | ||
export * from './handleBroadcasts.js' | ||
export * from './handleProtocolCommands.js' | ||
|
||
export function handlePeerConnect(details: any) { | ||
if (details) { | ||
// const peerId = details.detail | ||
// console.log('Connection established to:', peerId.toString()) // Emitted when a peer has been found | ||
/* | ||
try{ | ||
this._libp2p.services.pubsub.connect(peerId.toString()) | ||
} | ||
catch(e){ | ||
console.log(e) | ||
console.log("Failed to connect pubsub") | ||
} | ||
*/ | ||
} | ||
// else{ | ||
// console.log("Null evt ") | ||
// } | ||
} | ||
|
||
export function handlePeerDisconnect(details: any) { | ||
// const peerId = details.detail | ||
// console.log('Connection closed to:', peerId.toString()) // Emitted when a peer has been found | ||
} | ||
|
||
export function handlePeerDiscovery(details: any) { | ||
// const peerInfo = details.detail | ||
// console.log('Discovered new peer:', peerInfo.id.toString()) | ||
// console.log(details.detail) | ||
/* | ||
try{ | ||
//this._libp2p.services.pubsub.connect(peerInfo.id.toString()) | ||
this._libp2p.services.dht.connect(peerInfo.id.toString()) | ||
} | ||
catch(e){ | ||
console.log(e) | ||
console.log("Failed to connect pubsub") | ||
} | ||
*/ | ||
} | ||
|
||
export function handlePeerJoined(details: any) { | ||
// console.log('New peer joined us:', details) | ||
} | ||
|
||
export function handlePeerLeft(details: any) { | ||
// console.log('New peer joined us:', details) | ||
} | ||
|
||
export function handleSubscriptionCHange(details: any) { | ||
// console.log('subscription-change:', details.detail) | ||
} |
Oops, something went wrong.