Skip to content

Commit 4ed5c03

Browse files
thomaseizingerjacobheun
authored andcommitted
chore: change from ipfs to p2p protocol (#315)
multiformats/js-multiaddr#76 changed the default protocol from ipfs to p2p. js-multiaddr is a transitive dependency of peer-info, so in order to get this change, we had to bump the version of peer-info. * fix: revert ipfs -> p2p change for some tests As per PR feedback. Needed for backwards-compatibility.
1 parent 9e7a080 commit 4ed5c03

23 files changed

+67
-67
lines changed

examples/chat/src/dialer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async.parallel([
4646
console.log('Dialer ready, listening on:')
4747

4848
peerListener.multiaddrs.forEach((ma) => {
49-
console.log(ma.toString() + '/ipfs/' + idListener.toB58String())
49+
console.log(ma.toString() + '/p2p/' + idListener.toB58String())
5050
})
5151

5252
nodeDialer.dialProtocol(peerListener, '/chat/1.0.0', (err, conn) => {

examples/chat/src/listener.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ PeerId.createFromJSON(require('./peer-id-listener'), (err, idListener) => {
5050

5151
console.log('Listener ready, listening on:')
5252
peerListener.multiaddrs.forEach((ma) => {
53-
console.log(ma.toString() + '/ipfs/' + idListener.toB58String())
53+
console.log(ma.toString() + '/p2p/' + idListener.toB58String())
5454
})
5555
})
5656
})

examples/delegated-routing/src/App.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const Ipfs = require('ipfs')
77
const libp2pBundle = require('./libp2p-bundle')
88
// require('./App.css')
99

10-
const BootstrapNode = '/ip4/127.0.0.1/tcp/8081/ws/ipfs/QmdoG8DpzYUZMVP5dGmgmigZwR1RE8Cf6SxMPg1SBXJAQ8'
10+
const BootstrapNode = '/ip4/127.0.0.1/tcp/8081/ws/p2p/QmdoG8DpzYUZMVP5dGmgmigZwR1RE8Cf6SxMPg1SBXJAQ8'
1111

1212
class App extends Component {
1313
constructor (props) {

examples/discovery-mechanisms/1.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ const defaultsDeep = require('@nodeutils/defaults-deep')
1212

1313
// Find this list at: https://github.com/ipfs/js-ipfs/blob/master/src/core/runtime/config-nodejs.json
1414
const bootstrapers = [
15-
'/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ',
16-
'/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z',
17-
'/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM',
18-
'/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm',
19-
'/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu',
20-
'/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64',
21-
'/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd',
22-
'/ip4/178.62.61.185/tcp/4001/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3',
23-
'/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx'
15+
'/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ',
16+
'/ip4/104.236.176.52/tcp/4001/p2p/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z',
17+
'/ip4/104.236.179.241/tcp/4001/p2p/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM',
18+
'/ip4/162.243.248.213/tcp/4001/p2p/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm',
19+
'/ip4/128.199.219.111/tcp/4001/p2p/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu',
20+
'/ip4/104.236.76.40/tcp/4001/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64',
21+
'/ip4/178.62.158.247/tcp/4001/p2p/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd',
22+
'/ip4/178.62.61.185/tcp/4001/p2p/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3',
23+
'/ip4/104.236.151.122/tcp/4001/p2p/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx'
2424
]
2525

2626
class MyBundle extends libp2p {

examples/discovery-mechanisms/README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ In this bundle, we use a `bootstrappers` array listing peers to connect _on boot
4343

4444
```JavaScript
4545
const bootstrapers = [
46-
'/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ',
47-
'/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z',
48-
'/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM',
49-
'/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm',
50-
'/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu',
51-
'/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64',
52-
'/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd',
53-
'/ip4/178.62.61.185/tcp/4001/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3',
54-
'/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx'
46+
'/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ',
47+
'/ip4/104.236.176.52/tcp/4001/p2p/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z',
48+
'/ip4/104.236.179.241/tcp/4001/p2p/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM',
49+
'/ip4/162.243.248.213/tcp/4001/p2p/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm',
50+
'/ip4/128.199.219.111/tcp/4001/p2p/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu',
51+
'/ip4/104.236.76.40/tcp/4001/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64',
52+
'/ip4/178.62.158.247/tcp/4001/p2p/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd',
53+
'/ip4/178.62.61.185/tcp/4001/p2p/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3',
54+
'/ip4/104.236.151.122/tcp/4001/p2p/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx'
5555
]
5656
```
5757

examples/echo/src/dialer.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async.parallel([
2828
// Peer to Dial
2929
const listenerPeerInfo = new PeerInfo(ids[1])
3030
const listenerId = ids[1]
31-
const listenerMultiaddr = '/ip4/127.0.0.1/tcp/10333/ipfs/' +
31+
const listenerMultiaddr = '/ip4/127.0.0.1/tcp/10333/p2p/' +
3232
listenerId.toB58String()
3333
listenerPeerInfo.multiaddrs.add(listenerMultiaddr)
3434

@@ -37,7 +37,7 @@ async.parallel([
3737

3838
console.log('Dialer ready, listening on:')
3939
dialerPeerInfo.multiaddrs.forEach((ma) => console.log(ma.toString() +
40-
'/ipfs/' + dialerId.toB58String()))
40+
'/p2p/' + dialerId.toB58String()))
4141

4242
console.log('Dialing to peer:', listenerMultiaddr.toString())
4343
dialerNode.dialProtocol(listenerPeerInfo, '/echo/1.0.0', (err, conn) => {

examples/echo/src/listener.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ series([
4141

4242
console.log('Listener ready, listening on:')
4343
listenerNode.peerInfo.multiaddrs.forEach((ma) => {
44-
console.log(ma.toString() + '/ipfs/' + listenerId.toB58String())
44+
console.log(ma.toString() + '/p2p/' + listenerId.toB58String())
4545
})
4646
})

examples/libp2p-in-the-browser/1/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
"libp2p-webrtc-star": "~0.15.3",
2525
"libp2p-websocket-star": "~0.8.1",
2626
"libp2p-websockets": "~0.12.0",
27-
"peer-info": "~0.14.1"
27+
"peer-info": "~0.15.1"
2828
}
2929
}

examples/libp2p-in-the-browser/1/src/browser-bundle.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ const libp2p = require('../../../../')
1212

1313
// Find this list at: https://github.com/ipfs/js-ipfs/blob/master/src/core/runtime/config-browser.json
1414
const bootstrapList = [
15-
'/dns4/ams-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd',
16-
'/dns4/sfo-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx',
17-
'/dns4/lon-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3',
18-
'/dns4/sfo-2.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z',
19-
'/dns4/sfo-3.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM',
20-
'/dns4/sgp-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu',
21-
'/dns4/nyc-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm',
22-
'/dns4/nyc-2.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64',
23-
'/dns4/node0.preload.ipfs.io/tcp/443/wss/ipfs/QmZMxNdpMkewiVZLMRxaNxUeZpDUb34pWjZ1kZvsd16Zic',
24-
'/dns4/node0.preload.ipfs.io/tcp/443/wss/ipfs/Qmbut9Ywz9YEDrz8ySBSgWyJk41Uvm2QJPhwDJzJyGFsD6'
15+
'/dns4/ams-1.bootstrap.libp2p.io/tcp/443/wss/p2p/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd',
16+
'/dns4/sfo-1.bootstrap.libp2p.io/tcp/443/wss/p2p/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx',
17+
'/dns4/lon-1.bootstrap.libp2p.io/tcp/443/wss/p2p/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3',
18+
'/dns4/sfo-2.bootstrap.libp2p.io/tcp/443/wss/p2p/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z',
19+
'/dns4/sfo-3.bootstrap.libp2p.io/tcp/443/wss/p2p/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM',
20+
'/dns4/sgp-1.bootstrap.libp2p.io/tcp/443/wss/p2p/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu',
21+
'/dns4/nyc-1.bootstrap.libp2p.io/tcp/443/wss/p2p/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm',
22+
'/dns4/nyc-2.bootstrap.libp2p.io/tcp/443/wss/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64',
23+
'/dns4/node0.preload.ipfs.io/tcp/443/wss/p2p/QmZMxNdpMkewiVZLMRxaNxUeZpDUb34pWjZ1kZvsd16Zic',
24+
'/dns4/node0.preload.ipfs.io/tcp/443/wss/p2p/Qmbut9Ywz9YEDrz8ySBSgWyJk41Uvm2QJPhwDJzJyGFsD6'
2525
]
2626

2727
class Node extends libp2p {

examples/libp2p-in-the-browser/1/src/create-node.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function createNode (callback) {
1010
}
1111

1212
const peerIdStr = peerInfo.id.toB58String()
13-
const ma = `/dns4/star-signal.cloud.ipfs.team/tcp/443/wss/p2p-webrtc-star/ipfs/${peerIdStr}`
13+
const ma = `/dns4/star-signal.cloud.ipfs.team/tcp/443/wss/p2p-webrtc-star/p2p/${peerIdStr}`
1414

1515
peerInfo.multiaddrs.add(ma)
1616

examples/peer-and-content-routing/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ You should see the output being something like:
6969
```Bash
7070
> node 1.js
7171
Found it, multiaddrs are:
72-
/ip4/127.0.0.1/tcp/63617/ipfs/QmWrFXvZr9S4iDqycyoyc2zDdrT1jg9wpdenUTdd1LTar6
73-
/ip4/192.168.86.41/tcp/63617/ipfs/QmWrFXvZr9S4iDqycyoyc2zDdrT1jg9wpdenUTdd1LTar6
72+
/ip4/127.0.0.1/tcp/63617/p2p/QmWrFXvZr9S4iDqycyoyc2zDdrT1jg9wpdenUTdd1LTar6
73+
/ip4/192.168.86.41/tcp/63617/p2p/QmWrFXvZr9S4iDqycyoyc2zDdrT1jg9wpdenUTdd1LTar6
7474
```
7575

7676
You have successfully used Peer Routing to find a peer that you were not directly connected. Now all you have to do is to dial to the multiaddrs you discovered.

examples/protocol-and-stream-muxing/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ You can see this working on example [3.js](./3.js). The result should look like
169169
> node 3.js
170170
from 1 to 2
171171
Addresses by which both peers are connected
172-
node 1 to node 2: /ip4/127.0.0.1/tcp/50629/ipfs/QmZwMKTo6wG4Te9A6M2eJnWDpR8uhsGed4YRegnV5DcKiv
173-
node 2 to node 1: /ip4/127.0.0.1/tcp/50630/ipfs/QmRgormJQeDyXhDKma11eUtksoh8vWmeBoxghVt4meauW9
172+
node 1 to node 2: /ip4/127.0.0.1/tcp/50629/p2p/QmZwMKTo6wG4Te9A6M2eJnWDpR8uhsGed4YRegnV5DcKiv
173+
node 2 to node 1: /ip4/127.0.0.1/tcp/50630/p2p/QmRgormJQeDyXhDKma11eUtksoh8vWmeBoxghVt4meauW9
174174
from 2 to 1
175175
```

examples/transports/README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ Running this should result in something like:
8888
> node 1.js
8989
node has started (true/false): true
9090
listening on:
91-
/ip4/127.0.0.1/tcp/61329/ipfs/QmW2cKTakTYqbQkUzBTEGXgWYFj1YEPeUndE1YWs6CBzDQ
92-
/ip4/192.168.2.156/tcp/61329/ipfs/QmW2cKTakTYqbQkUzBTEGXgWYFj1YEPeUndE1YWs6CBzDQ
91+
/ip4/127.0.0.1/tcp/61329/p2p/QmW2cKTakTYqbQkUzBTEGXgWYFj1YEPeUndE1YWs6CBzDQ
92+
/ip4/192.168.2.156/tcp/61329/p2p/QmW2cKTakTYqbQkUzBTEGXgWYFj1YEPeUndE1YWs6CBzDQ
9393
```
9494

9595
That `QmW2cKTakTYqbQkUzBTEGXgWYFj1YEPeUndE1YWs6CBzDQ` is the PeerId that was created during the PeerInfo generation.
@@ -175,11 +175,11 @@ The result should be look like:
175175
```bash
176176
> node 2.js
177177
node 1 is listening on:
178-
/ip4/127.0.0.1/tcp/62279/ipfs/QmeM4wNWv1uci7UJjUXZYfvcy9uqAbw7G9icuxdqy88Mj9
179-
/ip4/192.168.2.156/tcp/62279/ipfs/QmeM4wNWv1uci7UJjUXZYfvcy9uqAbw7G9icuxdqy88Mj9
178+
/ip4/127.0.0.1/tcp/62279/p2p/QmeM4wNWv1uci7UJjUXZYfvcy9uqAbw7G9icuxdqy88Mj9
179+
/ip4/192.168.2.156/tcp/62279/p2p/QmeM4wNWv1uci7UJjUXZYfvcy9uqAbw7G9icuxdqy88Mj9
180180
node 2 is listening on:
181-
/ip4/127.0.0.1/tcp/62278/ipfs/QmWp58xJgzbouNJcyiNNTpZuqQCJU8jf6ixc7TZT9xEZhV
182-
/ip4/192.168.2.156/tcp/62278/ipfs/QmWp58xJgzbouNJcyiNNTpZuqQCJU8jf6ixc7TZT9xEZhV
181+
/ip4/127.0.0.1/tcp/62278/p2p/QmWp58xJgzbouNJcyiNNTpZuqQCJU8jf6ixc7TZT9xEZhV
182+
/ip4/192.168.2.156/tcp/62278/p2p/QmWp58xJgzbouNJcyiNNTpZuqQCJU8jf6ixc7TZT9xEZhV
183183
Hello p2p world!
184184
```
185185

@@ -304,14 +304,14 @@ If everything was set correctly, you now should see the following after you run
304304
```Bash
305305
> node 3.js
306306
node 1 is listening on:
307-
/ip4/127.0.0.1/tcp/62620/ipfs/QmWpWmcVJkF6EpmAaVDauku8g1uFGuxPsGP35XZp9GYEqs
308-
/ip4/192.168.2.156/tcp/62620/ipfs/QmWpWmcVJkF6EpmAaVDauku8g1uFGuxPsGP35XZp9GYEqs
307+
/ip4/127.0.0.1/tcp/62620/p2p/QmWpWmcVJkF6EpmAaVDauku8g1uFGuxPsGP35XZp9GYEqs
308+
/ip4/192.168.2.156/tcp/62620/p2p/QmWpWmcVJkF6EpmAaVDauku8g1uFGuxPsGP35XZp9GYEqs
309309
node 2 is listening on:
310-
/ip4/127.0.0.1/tcp/10000/ws/ipfs/QmWAQtWdzWXibgfyc7WRHhhv6MdqVKzXvyfSTnN2aAvixX
311-
/ip4/127.0.0.1/tcp/62619/ipfs/QmWAQtWdzWXibgfyc7WRHhhv6MdqVKzXvyfSTnN2aAvixX
312-
/ip4/192.168.2.156/tcp/62619/ipfs/QmWAQtWdzWXibgfyc7WRHhhv6MdqVKzXvyfSTnN2aAvixX
310+
/ip4/127.0.0.1/tcp/10000/ws/p2p/QmWAQtWdzWXibgfyc7WRHhhv6MdqVKzXvyfSTnN2aAvixX
311+
/ip4/127.0.0.1/tcp/62619/p2p/QmWAQtWdzWXibgfyc7WRHhhv6MdqVKzXvyfSTnN2aAvixX
312+
/ip4/192.168.2.156/tcp/62619/p2p/QmWAQtWdzWXibgfyc7WRHhhv6MdqVKzXvyfSTnN2aAvixX
313313
node 3 is listening on:
314-
/ip4/127.0.0.1/tcp/20000/ws/ipfs/QmVq1PWh3VSDYdFqYMtqp4YQyXcrH27N7968tGdM1VQPj1
314+
/ip4/127.0.0.1/tcp/20000/ws/p2p/QmVq1PWh3VSDYdFqYMtqp4YQyXcrH27N7968tGdM1VQPj1
315315
node 3 failed to dial to node 1 with: No available transport to dial to
316316
node 1 dialed to node 2 successfully
317317
node 2 dialed to node 3 successfully

pdd/pdd-the-ipfs-bundle--story-1--peer-a.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ test('story 1 - peerA', (t) => {
5959
t.ifErr(err, 'created Node successfully')
6060
t.ok(node.isStarted(), 'PeerA is Running')
6161

62-
const peerBAddr = `/ip4/127.0.0.1/tcp/10001/ipfs/${PeerB.id}`
62+
const peerBAddr = `/ip4/127.0.0.1/tcp/10001/p2p/${PeerB.id}`
6363

6464
node.handle('/time/1.0.0', (protocol, conn) => {
6565
pull(

pdd/pdd-the-ipfs-bundle--story-1--peer-b.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ test('story 1 - peerA', (t) => {
5959
t.ifErr(err, 'created Node successfully')
6060
t.ok(node.isStarted(), 'PeerB is Running')
6161

62-
const peerAAddr = `/ip4/127.0.0.1/tcp/10000/ipfs/${PeerA.id}`
62+
const peerAAddr = `/ip4/127.0.0.1/tcp/10000/p2p/${PeerA.id}`
6363

6464
node.handle('/echo/1.0.0', (protocol, conn) => {
6565
pull(

pdd/pdd-transport--story-1--peer-a.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ test('story 1 - peerA', (t) => {
3333
t.ifErr(err, 'created Node')
3434
t.ok(node.isStarted(), 'PeerA is running')
3535

36-
const PeerBAddr = `/ip4/127.0.0.1/tcp/10001/ipfs/${PeerB.id}`
36+
const PeerBAddr = `/ip4/127.0.0.1/tcp/10001/p2p/${PeerB.id}`
3737

3838
node.dial(PeerBAddr, '/echo/1.0.0', (err, conn) => {
3939
t.ifErr(err, 'dial successful')

pdd/pdd-transport--story-2--peer-a.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ test('story 2 - peerA', (t) => {
3333
t.ifErr(err, 'created Node')
3434
t.ok(node.isStarted(), 'PeerA is running')
3535

36-
const PeerBAddr = `/ip4/127.0.0.1/tcp/10001/ws/ipfs/${PeerB.id}`
36+
const PeerBAddr = `/ip4/127.0.0.1/tcp/10001/p2p/${PeerB.id}`
3737

3838
node.dial(PeerBAddr, '/echo/1.0.0', (err, conn) => {
3939
t.ifErr(err, 'dial successful')

pdd/pdd-transport--story-3--peer-a.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ test('story 3 - peerA', (t) => {
3232
t.ifErr(err, 'created Node')
3333
t.ok(node.isStarted(), 'PeerA is running')
3434

35-
const PeerBAddr = `/ip4/127.0.0.1/tcp/10001/ws/ipfs/${PeerB.id}`
35+
const PeerBAddr = `/ip4/127.0.0.1/tcp/10001/ws/p2p/${PeerB.id}`
3636

3737
setTimeout(() => node.dial(PeerBAddr, '/echo/1.0.0', (err, conn) => {
3838
t.ok(err, 'dial failed')

pdd/pdd-transport--story-3--peer-b.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ test('story 3 - peerB', (t) => {
3232
t.ifErr(err, 'created Node')
3333
t.ok(node.isStarted(), 'PeerA is running')
3434

35-
const PeerAAddr = `/ip4/127.0.0.1/tcp/10000/ws/ipfs/${PeerA.id}`
35+
const PeerAAddr = `/ip4/127.0.0.1/tcp/10000/ws/p2p/${PeerA.id}`
3636

3737
setTimeout(() => node.dial(PeerAAddr, '/echo/1.0.0', (err, conn) => {
3838
t.ok(err, 'dial failed')

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ class Node extends EventEmitter {
326326
this.peerInfo.multiaddrs.toArray().forEach((ma) => {
327327
if (!ma.getPeerId()) {
328328
maOld.push(ma)
329-
maNew.push(ma.encapsulate('/ipfs/' + this.peerInfo.id.toB58String()))
329+
maNew.push(ma.encapsulate('/p2p/' + this.peerInfo.id.toB58String()))
330330
}
331331
})
332332
this.peerInfo.multiaddrs.replace(maOld, maNew)

test/circuit-relay.node.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ describe('circuit relay', () => {
117117
// set up node with TCP and listening on relay1
118118
(cb) => setupNode([
119119
'/ip4/0.0.0.0/tcp/0',
120-
`/ipfs/${relayNode1.peerInfo.id.toB58String()}/p2p-circuit`
120+
`/p2p/${relayNode1.peerInfo.id.toB58String()}/p2p-circuit`
121121
], {
122122
config: {
123123
relay: {
@@ -131,7 +131,7 @@ describe('circuit relay', () => {
131131
// set up node with TCP and listening on relay2 over TCP transport
132132
(cb) => setupNode([
133133
'/ip4/0.0.0.0/tcp/0',
134-
`/ip4/0.0.0.0/tcp/0/ipfs/${relayNode2.peerInfo.id.toB58String()}/p2p-circuit`
134+
`/ip4/0.0.0.0/tcp/0/p2p/${relayNode2.peerInfo.id.toB58String()}/p2p-circuit`
135135
], {
136136
config: {
137137
relay: {

test/transports.browser.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const jsonPeerId = require('./fixtures/test-peer.json')
2121
describe('transports', () => {
2222
describe('websockets', () => {
2323
let peerB
24-
let peerBMultiaddr = '/ip4/127.0.0.1/tcp/9200/ws/ipfs/' + jsonPeerId.id
24+
let peerBMultiaddr = '/ip4/127.0.0.1/tcp/9200/ws/p2p/' + jsonPeerId.id
2525
let nodeA
2626

2727
before((done) => {
@@ -256,11 +256,11 @@ describe('transports', () => {
256256
expect(err).to.not.exist()
257257

258258
peer1 = new PeerInfo(ids[0])
259-
const ma1 = '/ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/ipfs/' + ids[0].toB58String()
259+
const ma1 = '/ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/p2p/' + ids[0].toB58String()
260260
peer1.multiaddrs.add(ma1)
261261

262262
peer2 = new PeerInfo(ids[1])
263-
const ma2 = '/ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/ipfs/' + ids[1].toB58String()
263+
const ma2 = '/ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/p2p/' + ids[1].toB58String()
264264
peer2.multiaddrs.add(ma2)
265265

266266
done()
@@ -333,7 +333,7 @@ describe('transports', () => {
333333
}
334334

335335
const peer3 = new PeerInfo(id3)
336-
const ma3 = '/ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/ipfs/' + b58Id
336+
const ma3 = '/ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/p2p/' + b58Id
337337
peer3.multiaddrs.add(ma3)
338338

339339
node1.on('peer:discovery', (peerInfo) => node1.dial(peerInfo, check))
@@ -441,7 +441,7 @@ describe('transports', () => {
441441
expect(err).to.not.exist()
442442

443443
const peer3 = new PeerInfo(id3)
444-
const ma3 = '/ip4/127.0.0.1/tcp/14444/ws/p2p-websocket-star/ipfs/' + id3.toB58String()
444+
const ma3 = '/ip4/127.0.0.1/tcp/14444/ws/p2p-websocket-star/p2p/' + id3.toB58String()
445445
peer3.multiaddrs.add(ma3)
446446

447447
node1.on('peer:discovery', (peerInfo) => node1.dial(peerInfo, check))

test/turbolence.node.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('Turbolence tests', () => {
4848

4949
it('connect nodeA to that node', (done) => {
5050
const spawnedId = require('./test-data/test-id.json')
51-
const maddr = multiaddr('/ip4/127.0.0.1/tcp/12345/ipfs/' + spawnedId.id)
51+
const maddr = multiaddr('/ip4/127.0.0.1/tcp/12345/p2p/' + spawnedId.id)
5252

5353
nodeA.dial(maddr, '/echo/1.0.0', (err, conn) => {
5454
expect(err).to.not.exist()

0 commit comments

Comments
 (0)