Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

fix: update *-star multiaddrs to explicity say that they need tcp and a port #1117

Merged
merged 9 commits into from
Dec 1, 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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<a href="https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fipfs%2Fjs-ipfs?ref=badge_small" alt="FOSSA Status"><img src="https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fipfs%2Fjs-ipfs.svg?type=small"/></a>
<a href="https://travis-ci.org/ipfs/js-ipfs"><img src="https://travis-ci.org/ipfs/js-ipfs.svg?branch=master" /></a>
<a href="https://circleci.com/gh/ipfs/js-ipfs"><img src="https://circleci.com/gh/ipfs/js-ipfs.svg?style=svg" /></a>
<a href="https://ci.appveyor.com/project/diasdavid/js-ipfs"><img src="https://ci.appveyor.com/api/projects/status/txn75y7843r2ff0p?svg=true" /></a>
<a href="https://ci.appveyor.com/project/wubalubadubdub/js-ipfs"><img src="https://ci.appveyor.com/api/projects/status/txn75y7843r2ff0p?svg=true" /></a>
<a href="https://coveralls.io/github/ipfs/js-ipfs?branch=master"><img src="https://coveralls.io/repos/github/ipfs/js-ipfs/badge.svg?branch=master"></a>
<br>
<a href="https://david-dm.org/ipfs/js-ipfs"><img src="https://david-dm.org/ipfs/js-ipfs.svg?style=flat-square" /></a>
Expand Down Expand Up @@ -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'
]
}
}
Expand Down Expand Up @@ -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"
]
}
},
Expand Down Expand Up @@ -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'
]
}
}
Expand Down
17 changes: 7 additions & 10 deletions examples/exchange-files-in-browser/public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,24 @@ 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/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) }
Expand All @@ -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')
Expand Down Expand Up @@ -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)
}
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -128,8 +128,8 @@
"libp2p-railing": "~0.7.1",
"libp2p-secio": "~0.8.1",
"libp2p-tcp": "~0.11.1",
"libp2p-webrtc-star": "~0.13.2",
"libp2p-websocket-star": "~0.6.0",
"libp2p-webrtc-star": "~0.13.3",
"libp2p-websocket-star": "~0.7.1",
"libp2p-websockets": "~0.10.4",
"lodash.flatmap": "^4.5.0",
"lodash.get": "^4.4.2",
Expand All @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/core/runtime/libp2p-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({id: peerInfo.id})
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) {
Expand Down