mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-30 09:21:35 +00:00
chore: change from ipfs to p2p protocol (#315)
https://github.com/multiformats/js-multiaddr/pull/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.
This commit is contained in:
committed by
Jacob Heun
parent
9e7a080a5c
commit
4ed5c039fc
@ -117,7 +117,7 @@ describe('circuit relay', () => {
|
||||
// set up node with TCP and listening on relay1
|
||||
(cb) => setupNode([
|
||||
'/ip4/0.0.0.0/tcp/0',
|
||||
`/ipfs/${relayNode1.peerInfo.id.toB58String()}/p2p-circuit`
|
||||
`/p2p/${relayNode1.peerInfo.id.toB58String()}/p2p-circuit`
|
||||
], {
|
||||
config: {
|
||||
relay: {
|
||||
@ -131,7 +131,7 @@ describe('circuit relay', () => {
|
||||
// set up node with TCP and listening on relay2 over TCP transport
|
||||
(cb) => setupNode([
|
||||
'/ip4/0.0.0.0/tcp/0',
|
||||
`/ip4/0.0.0.0/tcp/0/ipfs/${relayNode2.peerInfo.id.toB58String()}/p2p-circuit`
|
||||
`/ip4/0.0.0.0/tcp/0/p2p/${relayNode2.peerInfo.id.toB58String()}/p2p-circuit`
|
||||
], {
|
||||
config: {
|
||||
relay: {
|
||||
|
@ -21,7 +21,7 @@ const jsonPeerId = require('./fixtures/test-peer.json')
|
||||
describe('transports', () => {
|
||||
describe('websockets', () => {
|
||||
let peerB
|
||||
let peerBMultiaddr = '/ip4/127.0.0.1/tcp/9200/ws/ipfs/' + jsonPeerId.id
|
||||
let peerBMultiaddr = '/ip4/127.0.0.1/tcp/9200/ws/p2p/' + jsonPeerId.id
|
||||
let nodeA
|
||||
|
||||
before((done) => {
|
||||
@ -256,11 +256,11 @@ describe('transports', () => {
|
||||
expect(err).to.not.exist()
|
||||
|
||||
peer1 = new PeerInfo(ids[0])
|
||||
const ma1 = '/ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/ipfs/' + ids[0].toB58String()
|
||||
const ma1 = '/ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/p2p/' + ids[0].toB58String()
|
||||
peer1.multiaddrs.add(ma1)
|
||||
|
||||
peer2 = new PeerInfo(ids[1])
|
||||
const ma2 = '/ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/ipfs/' + ids[1].toB58String()
|
||||
const ma2 = '/ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/p2p/' + ids[1].toB58String()
|
||||
peer2.multiaddrs.add(ma2)
|
||||
|
||||
done()
|
||||
@ -333,7 +333,7 @@ describe('transports', () => {
|
||||
}
|
||||
|
||||
const peer3 = new PeerInfo(id3)
|
||||
const ma3 = '/ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/ipfs/' + b58Id
|
||||
const ma3 = '/ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/p2p/' + b58Id
|
||||
peer3.multiaddrs.add(ma3)
|
||||
|
||||
node1.on('peer:discovery', (peerInfo) => node1.dial(peerInfo, check))
|
||||
@ -441,7 +441,7 @@ describe('transports', () => {
|
||||
expect(err).to.not.exist()
|
||||
|
||||
const peer3 = new PeerInfo(id3)
|
||||
const ma3 = '/ip4/127.0.0.1/tcp/14444/ws/p2p-websocket-star/ipfs/' + id3.toB58String()
|
||||
const ma3 = '/ip4/127.0.0.1/tcp/14444/ws/p2p-websocket-star/p2p/' + id3.toB58String()
|
||||
peer3.multiaddrs.add(ma3)
|
||||
|
||||
node1.on('peer:discovery', (peerInfo) => node1.dial(peerInfo, check))
|
||||
|
@ -48,7 +48,7 @@ describe('Turbolence tests', () => {
|
||||
|
||||
it('connect nodeA to that node', (done) => {
|
||||
const spawnedId = require('./test-data/test-id.json')
|
||||
const maddr = multiaddr('/ip4/127.0.0.1/tcp/12345/ipfs/' + spawnedId.id)
|
||||
const maddr = multiaddr('/ip4/127.0.0.1/tcp/12345/p2p/' + spawnedId.id)
|
||||
|
||||
nodeA.dial(maddr, '/echo/1.0.0', (err, conn) => {
|
||||
expect(err).to.not.exist()
|
||||
|
Reference in New Issue
Block a user