From b2818932eabff9c558c6431fda24749dd64958ff Mon Sep 17 00:00:00 2001 From: David Dias Date: Tue, 28 Nov 2017 09:04:09 +0000 Subject: [PATCH 1/9] fix: update *-star multiaddrs to explicity say that they need tcp and a port --- README.md | 6 +++--- examples/exchange-files-in-browser/public/js/app.js | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a5be85fbd2..97c0bcd5f3 100644 --- a/README.md +++ b/README.md @@ -334,7 +334,7 @@ const node = new IPFS({ config: { Addresses: { Swarm: [ - '/dns4/wrtc-star.discovery.libp2p.io/wss/p2p-webrtc-star' + '/dns4/wrtc-star.discovery.libp2p.io/tcp/443/wss/p2p-webrtc-star' ] } } @@ -369,7 +369,7 @@ const node = new IPFS({ Swarm: [ "/ip4/0.0.0.0/tcp/4002", "/ip4/127.0.0.1/tcp/4003/ws", - "/dns4/wrtc-star.discovery.libp2p.io/wss/p2p-webrtc-star" + "/dns4/wrtc-star.discovery.libp2p.io/tcp/433/wss/p2p-webrtc-star" ] } }, @@ -426,7 +426,7 @@ const node = new IPFS({ config: { Addresses: { Swarm: [ - '/dns4/ws-star.discovery.libp2p.io/wss/p2p-websocket-star' + '/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star' ] } } diff --git a/examples/exchange-files-in-browser/public/js/app.js b/examples/exchange-files-in-browser/public/js/app.js index 5141e0b62d..89b7dafb9f 100644 --- a/examples/exchange-files-in-browser/public/js/app.js +++ b/examples/exchange-files-in-browser/public/js/app.js @@ -37,20 +37,20 @@ function start () { config: { Addresses: { Swarm: [ - // '/dns4/wrtc-star.discovery.libp2p.io/wss/p2p-webrtc-star' - '/dns4/ws-star.discovery.libp2p.io/wss/p2p-websocket-star' + '/dns4/wrtc-star.discovery.libp2p.io/tcp/443/wss/p2p-webrtc-star' + // '/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star' ] } } } // IFDEV: To test with latest js-ipfs - // const IPFS = require('ipfs') - // node = new IPFS(options) + const IPFS = require('ipfs') + node = new IPFS(options) // VEDIF // EXAMPLE - node = new self.Ipfs(options) + // node = new self.Ipfs(options) node.once('start', () => node.id((err, id) => { if (err) { return onError(err) } From 35bbaf9313752a053ba11eeaa1b779aa82e46f1f Mon Sep 17 00:00:00 2001 From: David Dias Date: Wed, 29 Nov 2017 17:04:31 +0000 Subject: [PATCH 2/9] fix appveyor badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 97c0bcd5f3..e38bf36670 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ - +
From 3b9815f56d83531543175e106fa002ccb6855e6d Mon Sep 17 00:00:00 2001 From: David Dias Date: Thu, 30 Nov 2017 13:33:21 +0000 Subject: [PATCH 3/9] chore --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7b400751f1..5281542787 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "libp2p-secio": "~0.8.1", "libp2p-tcp": "~0.11.1", "libp2p-webrtc-star": "~0.13.2", - "libp2p-websocket-star": "~0.6.0", + "libp2p-websocket-star": "~0.7.1", "libp2p-websockets": "~0.10.4", "lodash.flatmap": "^4.5.0", "lodash.get": "^4.4.2", From 69a04c0754bef1f1e070a301b7837399d6a4ac20 Mon Sep 17 00:00:00 2001 From: David Dias Date: Thu, 30 Nov 2017 13:59:25 +0000 Subject: [PATCH 4/9] test --- examples/exchange-files-in-browser/public/js/app.js | 6 +++--- package.json | 2 +- src/core/runtime/libp2p-browser.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/exchange-files-in-browser/public/js/app.js b/examples/exchange-files-in-browser/public/js/app.js index 89b7dafb9f..a308a2af5a 100644 --- a/examples/exchange-files-in-browser/public/js/app.js +++ b/examples/exchange-files-in-browser/public/js/app.js @@ -33,12 +33,12 @@ function start () { updateView('starting', node) const options = { - repo: 'ipfs-' + Math.random(), + repo: 'ipfs-' + Math.random() + Date.now().toString(), config: { Addresses: { Swarm: [ - '/dns4/wrtc-star.discovery.libp2p.io/tcp/443/wss/p2p-webrtc-star' - // '/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star' + // '/dns4/wrtc-star.discovery.libp2p.io/tcp/443/wss/p2p-webrtc-star' + '/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star' ] } } diff --git a/package.json b/package.json index 5281542787..808fa1ba2e 100644 --- a/package.json +++ b/package.json @@ -128,7 +128,7 @@ "libp2p-railing": "~0.7.1", "libp2p-secio": "~0.8.1", "libp2p-tcp": "~0.11.1", - "libp2p-webrtc-star": "~0.13.2", + "libp2p-webrtc-star": "~0.13.3", "libp2p-websocket-star": "~0.7.1", "libp2p-websockets": "~0.10.4", "lodash.flatmap": "^4.5.0", diff --git a/src/core/runtime/libp2p-browser.js b/src/core/runtime/libp2p-browser.js index 4994f74617..1a28fbad5d 100644 --- a/src/core/runtime/libp2p-browser.js +++ b/src/core/runtime/libp2p-browser.js @@ -11,16 +11,16 @@ const libp2p = require('libp2p') class Node extends libp2p { constructor (peerInfo, peerBook, options) { options = options || {} - const wstar = new WebRTCStar() + const wrtcstar = new WebRTCStar() const wsstar = new WebSocketStar({id: peerInfo.id}) const modules = { - transport: [new WS(), wstar, wsstar], + transport: [new WS(), wrtcstar, wsstar], connection: { muxer: [Multiplex], crypto: [SECIO] }, - discovery: [wstar.discovery, wsstar.discovery] + discovery: [wrtcstar.discovery, wsstar.discovery] } if (options.bootstrap) { From ce50336877c61ffbe5383543269b093275072891 Mon Sep 17 00:00:00 2001 From: David Dias Date: Fri, 1 Dec 2017 09:51:33 +0000 Subject: [PATCH 5/9] chore: update deps --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 808fa1ba2e..abfd14a0ab 100644 --- a/package.json +++ b/package.json @@ -104,10 +104,10 @@ "fsm-event": "^2.1.0", "get-folder-size": "^1.0.0", "glob": "^7.1.2", - "hapi": "^16.6.2", + "hapi": "^16.2.2", "hapi-set-header": "^1.0.2", "hoek": "^5.0.2", - "ipfs-api": "^17.1.2", + "ipfs-api": "^17.1.3", "ipfs-bitswap": "~0.17.4", "ipfs-block": "~0.6.1", "ipfs-block-service": "~0.13.0", @@ -119,7 +119,7 @@ "is-ipfs": "^0.3.2", "is-stream": "^1.1.0", "joi": "^13.0.2", - "libp2p": "~0.13.1", + "libp2p": "~0.13.3", "libp2p-circuit": "~0.1.4", "libp2p-floodsub": "~0.13.0", "libp2p-kad-dht": "~0.6.0", @@ -142,9 +142,9 @@ "multihashes": "~0.4.12", "once": "^1.4.0", "path-exists": "^3.0.0", - "peer-book": "~0.5.1", - "peer-id": "~0.10.2", - "peer-info": "~0.11.1", + "peer-book": "~0.5.2", + "peer-id": "~0.10.3", + "peer-info": "~0.11.3", "progress": "^2.0.0", "promisify-es6": "^1.0.3", "pull-abortable": "^4.1.1", From 045dcf668dae7b75b4154ab871187177941e9ba0 Mon Sep 17 00:00:00 2001 From: David Dias Date: Fri, 1 Dec 2017 09:52:20 +0000 Subject: [PATCH 6/9] pass peerId to webrtc-star as well --- src/core/runtime/libp2p-browser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/runtime/libp2p-browser.js b/src/core/runtime/libp2p-browser.js index 1a28fbad5d..65b019445b 100644 --- a/src/core/runtime/libp2p-browser.js +++ b/src/core/runtime/libp2p-browser.js @@ -11,7 +11,7 @@ const libp2p = require('libp2p') class Node extends libp2p { constructor (peerInfo, peerBook, options) { options = options || {} - const wrtcstar = new WebRTCStar() + const wrtcstar = new WebRTCStar({id: peerInfo.id}) const wsstar = new WebSocketStar({id: peerInfo.id}) const modules = { From 90803f4946433b53b49a71efc2173f6b6354579c Mon Sep 17 00:00:00 2001 From: David Dias Date: Fri, 1 Dec 2017 10:02:01 +0000 Subject: [PATCH 7/9] check that multiaddrs are working --- examples/exchange-files-in-browser/public/js/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/exchange-files-in-browser/public/js/app.js b/examples/exchange-files-in-browser/public/js/app.js index a308a2af5a..de4b35a76a 100644 --- a/examples/exchange-files-in-browser/public/js/app.js +++ b/examples/exchange-files-in-browser/public/js/app.js @@ -37,8 +37,8 @@ function start () { config: { Addresses: { Swarm: [ - // '/dns4/wrtc-star.discovery.libp2p.io/tcp/443/wss/p2p-webrtc-star' - '/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star' + '/dns4/wrtc-star.discovery.libp2p.io/tcp/443/wss/p2p-webrtc-star' + // '/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star' ] } } From fbdc8091eb9fd73e226688c30af3bb44547cdef6 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Fri, 1 Dec 2017 10:15:20 +0000 Subject: [PATCH 8/9] fix download bug --- examples/exchange-files-in-browser/public/js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/exchange-files-in-browser/public/js/app.js b/examples/exchange-files-in-browser/public/js/app.js index de4b35a76a..4815e797b3 100644 --- a/examples/exchange-files-in-browser/public/js/app.js +++ b/examples/exchange-files-in-browser/public/js/app.js @@ -72,7 +72,7 @@ function stop () { */ function createFileBlob (data, multihash) { - const file = new window.Blob(data, { type: 'application/octet-binary' }) + const file = new window.Blob([data], { type: 'application/octet-binary' }) const fileUrl = window.URL.createObjectURL(file) const listItem = document.createElement('div') From 072700c600dc1cf13aee08a4945ec71679d4b82c Mon Sep 17 00:00:00 2001 From: David Dias Date: Fri, 1 Dec 2017 10:21:05 +0000 Subject: [PATCH 9/9] crisis averted --- examples/exchange-files-in-browser/public/js/app.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/examples/exchange-files-in-browser/public/js/app.js b/examples/exchange-files-in-browser/public/js/app.js index 4815e797b3..7b54655be5 100644 --- a/examples/exchange-files-in-browser/public/js/app.js +++ b/examples/exchange-files-in-browser/public/js/app.js @@ -100,9 +100,6 @@ function getFile () { files.forEach((file) => { if (file.content) { - console.log('Fetched file:', cid, file.content.length) - - // TODO: FIX calling createFileBlob makes the Chrome go "Oh Snap" const listItem = createFileBlob(file.content, cid) $filesList.insertBefore(listItem, $filesList.firstChild) }