mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-23 14:01:35 +00:00
docs: update examples to 0.28.x api (#625)
* chore: update examples to 0.28 api * chore: use libp2p-noise in examples * chore: examples using multiaddrs property of libp2p Co-authored-by: Jacob Heun <jacobheun@gmail.com> * docs: update language around secio in crypto example Co-authored-by: Jacob Heun <jacobheun@gmail.com>
This commit is contained in:
@ -29,7 +29,9 @@ generate(otherSwarmKey)
|
||||
|
||||
console.log('nodes started...')
|
||||
|
||||
await node1.dial(node2.peerInfo)
|
||||
// Add node 2 data to node1's PeerStore
|
||||
node1.peerStore.addressBook.set(node2.peerId, node2.multiaddrs)
|
||||
await node1.dial(node2.peerId)
|
||||
|
||||
node2.handle('/private', ({ stream }) => {
|
||||
pipe(
|
||||
@ -42,7 +44,7 @@ generate(otherSwarmKey)
|
||||
)
|
||||
})
|
||||
|
||||
const { stream } = await node1.dialProtocol(node2.peerInfo, '/private')
|
||||
const { stream } = await node1.dialProtocol(node2.peerId, '/private')
|
||||
|
||||
await pipe(
|
||||
['This message is sent on a private network'],
|
||||
|
Reference in New Issue
Block a user