Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix dial function name and multiaddr variable name in echo and chat d… #109

Merged
merged 1 commit into from
Jul 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/chat/src/dialer.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ async.parallel([
], (err, ids) => {
if (err) throw err
const peerDialer = new PeerInfo(ids[0])
peerDialer.multiaddr.add('/ip4/0.0.0.0/tcp/0')
peerDialer.multiaddrs.add('/ip4/0.0.0.0/tcp/0')
const nodeDialer = new Node(peerDialer)

const peerListener = new PeerInfo(ids[1])
idListener = ids[1]
peerListener.multiaddr.add('/ip4/127.0.0.1/tcp/10333')
peerListener.multiaddrs.add('/ip4/127.0.0.1/tcp/10333')
nodeDialer.start((err) => {
if (err) {
throw err
Expand All @@ -47,7 +47,7 @@ async.parallel([
console.log(ma.toString() + '/ipfs/' + idListener.toB58String())
})

nodeDialer.dialByPeerInfo(peerListener, '/chat/1.0.0', (err, conn) => {
nodeDialer.dial(peerListener, '/chat/1.0.0', (err, conn) => {
if (err) {
throw err
}
Expand Down
2 changes: 1 addition & 1 deletion examples/chat/src/libp2p-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const spdy = require('libp2p-spdy')
const KadDHT = require('libp2p-kad-dht')
const multiplex = require('libp2p-multiplex')
const secio = require('libp2p-secio')
const libp2p = require('../..')
const libp2p = require('../../..')

function mapMuxers (list) {
return list.map((pref) => {
Expand Down
2 changes: 1 addition & 1 deletion examples/chat/src/listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PeerId.createFromJSON(require('./peer-id-listener'), (err, idListener) => {
throw err
}
const peerListener = new PeerInfo(idListener)
peerListener.multiaddr.add('/ip4/0.0.0.0/tcp/10333')
peerListener.multiaddrs.add('/ip4/0.0.0.0/tcp/10333')
const nodeListener = new Node(peerListener)

nodeListener.start((err) => {
Expand Down
6 changes: 3 additions & 3 deletions examples/echo/src/dialer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ async.parallel([
// Dialer
const dialerId = ids[0]
const dialerPeerInfo = new PeerInfo(dialerId)
dialerPeerInfo.multiaddr.add('/ip4/0.0.0.0/tcp/0')
dialerPeerInfo.multiaddrs.add('/ip4/0.0.0.0/tcp/0')
const dialerNode = new Node(dialerPeerInfo)

// Peer to Dial
const listenerPeerInfo = new PeerInfo(ids[1])
const listenerId = ids[1]
const listenerMultiaddr = '/ip4/127.0.0.1/tcp/10333/ipfs/' +
listenerId.toB58String()
listenerPeerInfo.multiaddr.add(listenerMultiaddr)
listenerPeerInfo.multiaddrs.add(listenerMultiaddr)

dialerNode.start((err) => {
if (err) { throw err }
Expand All @@ -38,7 +38,7 @@ async.parallel([
'/ipfs/' + dialerId.toB58String()))

console.log('Dialing to peer:', listenerMultiaddr.toString())
dialerNode.dialByPeerInfo(listenerPeerInfo, '/echo/1.0.0', (err, conn) => {
dialerNode.dial(listenerPeerInfo, '/echo/1.0.0', (err, conn) => {
if (err) { throw err }

console.log('nodeA dialed to nodeB on protocol: /echo/1.0.0')
Expand Down
2 changes: 1 addition & 1 deletion examples/echo/src/listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ series([
},
(cb) => {
const listenerPeerInfo = new PeerInfo(listenerId)
listenerPeerInfo.multiaddr.add('/ip4/0.0.0.0/tcp/10333')
listenerPeerInfo.multiaddrs.add('/ip4/0.0.0.0/tcp/10333')
listenerNode = new Node(listenerPeerInfo)

listenerNode.swarm.on('peer-mux-established', (peerInfo) => {
Expand Down