mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-04-25 10:32:14 +00:00
chore: update getting started connect event (#752)
This commit is contained in:
parent
58b793d700
commit
0087218194
@ -232,8 +232,8 @@ node.on('peer:discovery', (peer) => {
|
||||
console.log('Discovered %s', peer.id.toB58String()) // Log discovered peer
|
||||
})
|
||||
|
||||
node.on('peer:connect', (peer) => {
|
||||
console.log('Connected to %s', peer.id.toB58String()) // Log connected peer
|
||||
node.connectionManager.on('peer:connect', (connection) => {
|
||||
console.log('Connected to %s', connection.remotePeer.toB58String()) // Log connected peer
|
||||
})
|
||||
|
||||
// start libp2p
|
||||
|
@ -5,7 +5,7 @@ import WebRTCStar from 'libp2p-webrtc-star'
|
||||
import { NOISE } from 'libp2p-noise'
|
||||
import Secio from 'libp2p-secio'
|
||||
import Mplex from 'libp2p-mplex'
|
||||
import Boostrap from 'libp2p-bootstrap'
|
||||
import Bootstrap from 'libp2p-bootstrap'
|
||||
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
// Create our libp2p node
|
||||
@ -23,11 +23,13 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||
transport: [Websockets, WebRTCStar],
|
||||
connEncryption: [NOISE, Secio],
|
||||
streamMuxer: [Mplex],
|
||||
peerDiscovery: [Boostrap]
|
||||
peerDiscovery: [Bootstrap]
|
||||
},
|
||||
config: {
|
||||
peerDiscovery: {
|
||||
bootstrap: {
|
||||
// The `tag` property will be searched when creating the instance of your Peer Discovery service.
|
||||
// The associated object, will be passed to the service when it is instantiated.
|
||||
[Bootstrap.tag]: {
|
||||
enabled: true,
|
||||
list: [
|
||||
'/dns4/ams-1.bootstrap.libp2p.io/tcp/443/wss/p2p/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd',
|
||||
|
Loading…
x
Reference in New Issue
Block a user