diff --git a/packages/ipfs-http-client/examples/name-api/index.js b/examples/http-client-name-api/index.js
similarity index 71%
rename from packages/ipfs-http-client/examples/name-api/index.js
rename to examples/http-client-name-api/index.js
index 10d7758b43..df2dfdb3a7 100644
--- a/packages/ipfs-http-client/examples/name-api/index.js
+++ b/examples/http-client-name-api/index.js
@@ -2,14 +2,15 @@
'use strict'
const { Buffer } = require('buffer')
const ipfsHttp = require('ipfs-http-client')
-const ipfs = ipfsHttp('/ip4/127.0.0.1/tcp/5001')
+let ipfs
const DOM = {
status: document.getElementById('status'),
buttons: document.getElementsByTagName('button'),
- publishNew: document.forms[0],
- publishPath: document.forms[1],
- resolveName: document.forms[2],
+ connect: document.getElementById('connect-to-http-api'),
+ publishNew: document.getElementById('publish-text'),
+ publishPath: document.getElementById('publish-path'),
+ resolveName: document.getElementById('resolve-name'),
publishResultsDiv: document.querySelector('.results--publish'),
resolveResultsDiv: document.querySelector('.results--resolve'),
publishResult: document.getElementById('publish-result'),
@@ -37,14 +38,20 @@ const enableForms = () => {
}
}
-const init = () => {
+const connect = async (e) => {
+ e.preventDefault()
+
+ const input = e.target.elements.text.value.trim()
+ showStatus(`Connecting to ${input}`, COLORS.active)
+
+ ipfs = ipfsHttp(input)
ipfs.id()
.then(res => {
- showStatus(`daemon active\nid: ${res.id}`, COLORS.success)
+ showStatus(`Daemon active\nID: ${res.id}`, COLORS.success)
enableForms()
})
.catch(err => {
- showStatus('daemon inactive', COLORS.error)
+ showStatus('Failed to connect to daemon', COLORS.error)
console.error(err)
})
}
@@ -56,58 +63,60 @@ const addAndPublish = async (e) => {
const input = e.target.elements.text
const buffer = Buffer.from(input.value)
- showStatus('adding to IPFS...', COLORS.active)
+ showStatus('Adding to IPFS...', COLORS.active)
try {
for await (const file of ipfs.add(buffer)) {
- showStatus('success!', COLORS.success)
+ showStatus('Success!', COLORS.success)
publish(file.path)
input.value = ''
}
} catch (err) {
- showStatus('failed to add the data', COLORS.error)
+ showStatus('Failed to add the data', COLORS.error)
console.error(err)
}
}
// Publishes an IPFS file or directory under your node's identity
const publish = (path) => {
- showStatus('publishing...', COLORS.active)
+ showStatus('Publishing...', COLORS.active)
DOM.publishResultsDiv.classList.add('hidden')
ipfs.name.publish(path)
.then(res => {
const name = res.name
- showStatus('success!', COLORS.success)
+ showStatus('Success!', COLORS.success)
DOM.publishResultsDiv.classList.remove('hidden')
DOM.publishResult.innerText = `/ipns/${name}`
DOM.publishGatewayLink.href = `${IPFS_DOMAIN}/ipns/${name}`
})
.catch(err => {
- showStatus(`error publishing ${path}`, COLORS.error)
+ showStatus(`Error publishing ${path}`, COLORS.error)
console.error(err)
})
}
// Resolves an IPNS name
const resolve = async (name) => {
- showStatus('resolving...', COLORS.active)
+ showStatus('Resolving...', COLORS.active)
DOM.resolveResultsDiv.classList.add('hidden')
try {
for await (const path of ipfs.name.resolve(name)) {
- showStatus('success!', COLORS.success)
+ showStatus('Success!', COLORS.success)
DOM.resolveResultsDiv.classList.remove('hidden')
DOM.resolveResult.innerText = path
DOM.resolveGatewayLink.href = `${IPFS_DOMAIN}${path}`
}
} catch (err) {
- showStatus(`error resolving ${name}`, COLORS.error)
+ showStatus(`Error resolving ${name}`, COLORS.error)
console.error(err)
}
}
// Event listeners
+DOM.connect.onsubmit = connect
+
DOM.publishNew.onsubmit = addAndPublish
DOM.publishPath.onsubmit = (e) => {
@@ -123,5 +132,3 @@ DOM.resolveName.onsubmit = (e) => {
resolve(input.value)
input.value = ''
}
-
-init()
diff --git a/examples/http-client-name-api/package.json b/examples/http-client-name-api/package.json
new file mode 100644
index 0000000000..0f817c0ad9
--- /dev/null
+++ b/examples/http-client-name-api/package.json
@@ -0,0 +1,27 @@
+{
+ "name": "example-http-client-name-api",
+ "version": "1.0.0",
+ "description": "",
+ "main": "index.js",
+ "scripts": {
+ "clean": "rm -rf ./dist",
+ "build": "parcel build index.html --public-url '.'",
+ "start": "parcel index.html -p 8888",
+ "test": "test-ipfs-example"
+ },
+ "author": "Tara Vancil ",
+ "license": "MIT",
+ "dependencies": {
+ "ipfs-http-client": "^44.3.0"
+ },
+ "devDependencies": {
+ "execa": "^4.0.0",
+ "go-ipfs": "^0.6.0",
+ "ipfsd-ctl": "^4.1.1",
+ "parcel-bundler": "^1.12.4",
+ "test-ipfs-example": "^2.0.3"
+ },
+ "browserslist": [
+ "last 2 versions and not dead and > 2%"
+ ]
+}
diff --git a/examples/http-client-name-api/test.js b/examples/http-client-name-api/test.js
new file mode 100644
index 0000000000..2ed69a14c1
--- /dev/null
+++ b/examples/http-client-name-api/test.js
@@ -0,0 +1,112 @@
+'use strict'
+
+const path = require('path')
+const execa = require('execa')
+const { createFactory } = require('ipfsd-ctl')
+const df = createFactory({
+ ipfsHttpModule: require('ipfs-http-client'),
+ ipfsBin: require('go-ipfs').path(),
+ args: ['--enable-pubsub-experiment']
+})
+const {
+ startServer
+} = require('test-ipfs-example/utils')
+const pkg = require('./package.json')
+
+async function testUI (url, api, id) {
+ const proc = execa(require.resolve('test-ipfs-example/node_modules/.bin/nightwatch'), ['--config', require.resolve('test-ipfs-example/nightwatch.conf.js'), path.join(__dirname, 'test.js')], {
+ cwd: path.resolve(__dirname, '../'),
+ env: {
+ ...process.env,
+ CI: true,
+ IPFS_EXAMPLE_TEST_URL: url,
+ IPFS_API_MULTIADDR: api,
+ IPFS_ID: id
+ },
+ all: true
+ })
+ proc.all.on('data', (data) => {
+ process.stdout.write(data)
+ })
+
+ await proc
+}
+
+async function runTest () {
+ const app = await startServer(__dirname)
+ const daemon = await df.spawn({
+ type: 'go',
+ test: true,
+ ipfsOptions: {
+ config: {
+ Addresses: {
+ API: '/ip4/127.0.0.1/tcp/0'
+ },
+ API: {
+ HTTPHeaders: {
+ 'Access-Control-Allow-Origin': [
+ app.url
+ ]
+ }
+ }
+ }
+ }
+ })
+
+ // Cannot publish ipns names without peers
+ const daemon2 = await df.spawn({
+ type: 'go',
+ test: true
+ })
+ await daemon.api.swarm.connect(await daemon2.api.peerId.addresses[0])
+
+ try {
+ await testUI(app.url, daemon.apiAddr, daemon.api.peerId.id)
+ } finally {
+ await daemon.stop()
+ await daemon2.stop()
+ await app.stop()
+ }
+}
+
+module.exports = runTest
+
+module.exports[pkg.name] = function (browser) {
+ browser
+ .url(process.env.IPFS_EXAMPLE_TEST_URL)
+ .waitForElementVisible('#connect-input')
+ .clearValue('#connect-input')
+ .setValue('#connect-input', process.env.IPFS_API_MULTIADDR)
+ .pause(1000)
+ .click('#connect-submit')
+
+ browser.expect.element('#status').text.to.contain(`Daemon active\nID: ${process.env.IPFS_ID}`)
+
+ const content = 'hello world'
+
+ // publish a name
+ browser
+ .waitForElementVisible('#add-file-input')
+ .clearValue('#add-file-input')
+ .setValue('#add-file-input', content)
+ .pause(1000)
+ .click('#add-file-submit')
+
+ browser.expect.element('#publish-result').text.to.contain('/ipns/Qm')
+
+ // resolve a name
+ browser.getText('#publish-result', (result) => {
+ const ipnsName = result.value.trim()
+
+ browser
+ .waitForElementVisible('#resolve-name-input')
+ .clearValue('#resolve-name-input')
+ .setValue('#resolve-name-input', ipnsName)
+ .pause(1000)
+ .click('#resolve-name-submit')
+
+ browser.expect.element('#resolve-result').text.to.contain('/ipfs/Qm')
+ })
+
+ browser.end()
+}
diff --git a/packages/ipfs-http-client/examples/upload-file-via-browser/README.md b/examples/http-client-upload-file-via-browser/README.md
similarity index 100%
rename from packages/ipfs-http-client/examples/upload-file-via-browser/README.md
rename to examples/http-client-upload-file-via-browser/README.md
diff --git a/packages/ipfs-http-client/examples/upload-file-via-browser/index.html b/examples/http-client-upload-file-via-browser/index.html
similarity index 100%
rename from packages/ipfs-http-client/examples/upload-file-via-browser/index.html
rename to examples/http-client-upload-file-via-browser/index.html
diff --git a/packages/ipfs-http-client/examples/upload-file-via-browser/package.json b/examples/http-client-upload-file-via-browser/package.json
similarity index 57%
rename from packages/ipfs-http-client/examples/upload-file-via-browser/package.json
rename to examples/http-client-upload-file-via-browser/package.json
index 8f6bf2876f..1c3f405edc 100644
--- a/packages/ipfs-http-client/examples/upload-file-via-browser/package.json
+++ b/examples/http-client-upload-file-via-browser/package.json
@@ -1,9 +1,12 @@
{
- "name": "upload-file-via-browser",
+ "name": "example-http-client-upload-file-via-browser",
"version": "1.0.0",
"description": "Upload file to IPFS via browser using js-ipfs-http-client with Webpack",
"scripts": {
- "start": "parcel index.html"
+ "clean": "rm -rf ./dist",
+ "build": "parcel build index.html --public-url '.'",
+ "start": "parcel index.html",
+ "test": "test-ipfs-example"
},
"author": "Harlan T Wood ",
"contributors": [
@@ -11,12 +14,14 @@
],
"license": "MIT",
"dependencies": {
- "ipfs-http-client": "../.."
+ "ipfs-http-client": "^44.3.0"
},
"devDependencies": {
+ "ipfs": "^0.47.0",
+ "parcel-bundler": "^1.12.4",
"react": "^16.8.6",
"react-dom": "^16.8.6",
- "parcel-bundler": "^1.12.4"
+ "test-ipfs-example": "^2.0.3"
},
"browserslist": [
"last 2 versions and not dead and > 2%"
diff --git a/packages/ipfs-http-client/examples/upload-file-via-browser/screenshot.png b/examples/http-client-upload-file-via-browser/screenshot.png
similarity index 100%
rename from packages/ipfs-http-client/examples/upload-file-via-browser/screenshot.png
rename to examples/http-client-upload-file-via-browser/screenshot.png
diff --git a/packages/ipfs-http-client/examples/upload-file-via-browser/src/App.js b/examples/http-client-upload-file-via-browser/src/App.js
similarity index 57%
rename from packages/ipfs-http-client/examples/upload-file-via-browser/src/App.js
rename to examples/http-client-upload-file-via-browser/src/App.js
index 16e48ef43b..b6a23555f5 100644
--- a/packages/ipfs-http-client/examples/upload-file-via-browser/src/App.js
+++ b/examples/http-client-upload-file-via-browser/src/App.js
@@ -1,5 +1,6 @@
/* eslint-disable no-console */
'use strict'
+
const React = require('react')
const ipfsClient = require('ipfs-http-client')
@@ -9,18 +10,19 @@ class App extends React.Component {
this.state = {
added_file_hash: null
}
- this.ipfs = ipfsClient('/ip4/127.0.0.1/tcp/5001')
// bind methods
this.captureFile = this.captureFile.bind(this)
this.saveToIpfs = this.saveToIpfs.bind(this)
this.handleSubmit = this.handleSubmit.bind(this)
+ this.connect = this.connect.bind(this)
+ this.multiaddr = React.createRef()
}
captureFile (event) {
event.stopPropagation()
event.preventDefault()
- if (document.getElementById('keepFilename').checked) {
+ if (document.getElementById('keep-filename').checked) {
this.saveToIpfsWithFilename(event.target.files)
} else {
this.saveToIpfs(event.target.files)
@@ -30,7 +32,7 @@ class App extends React.Component {
// Example #1
// Add file to IPFS and return a CID
async saveToIpfs (files) {
- const source = this.ipfs.add(
+ const source = this.state.ipfs.add(
[...files],
{
progress: (prog) => console.log(`received: ${prog}`)
@@ -59,7 +61,7 @@ class App extends React.Component {
progress: (prog) => console.log(`received: ${prog}`)
}
- const source = this.ipfs.add(fileDetails, options)
+ const source = this.state.ipfs.add(fileDetails, options)
try {
for await (const file of source) {
console.log(file)
@@ -74,19 +76,37 @@ class App extends React.Component {
event.preventDefault()
}
+ async connect () {
+ this.setState({
+ ipfs: ipfsClient(this.multiaddr.current.value)
+ })
+ }
+
render () {
- return (
-
-
+ if (this.state.ipfs) {
+ return (
+ )
+ }
+
+ return (
+
+
Enter the multiaddr for an IPFS node HTTP API
+
)
}
diff --git a/packages/ipfs-http-client/examples/upload-file-via-browser/src/index.js b/examples/http-client-upload-file-via-browser/src/index.js
similarity index 100%
rename from packages/ipfs-http-client/examples/upload-file-via-browser/src/index.js
rename to examples/http-client-upload-file-via-browser/src/index.js
diff --git a/examples/http-client-upload-file-via-browser/test.js b/examples/http-client-upload-file-via-browser/test.js
new file mode 100644
index 0000000000..7cd231154c
--- /dev/null
+++ b/examples/http-client-upload-file-via-browser/test.js
@@ -0,0 +1,83 @@
+'use strict'
+
+const path = require('path')
+const execa = require('execa')
+const { createFactory } = require('ipfsd-ctl')
+const df = createFactory({
+ ipfsHttpModule: require('ipfs-http-client'),
+ ipfsBin: require.resolve('ipfs/src/cli/bin.js')
+})
+const {
+ startServer
+} = require('test-ipfs-example/utils')
+const pkg = require('./package.json')
+
+async function testUI (url, api, id) {
+ const proc = execa(require.resolve('test-ipfs-example/node_modules/.bin/nightwatch'), ['--config', require.resolve('test-ipfs-example/nightwatch.conf.js'), path.join(__dirname, 'test.js')], {
+ cwd: path.resolve(__dirname, '../'),
+ env: {
+ ...process.env,
+ CI: true,
+ IPFS_EXAMPLE_TEST_URL: url,
+ IPFS_API_MULTIADDR: api,
+ IPFS_ID: id
+ },
+ all: true
+ })
+ proc.all.on('data', (data) => {
+ process.stdout.write(data)
+ })
+
+ await proc
+}
+
+async function runTest () {
+ const app = await startServer(__dirname)
+ const daemon = await df.spawn({
+ type: 'js',
+ test: true,
+ ipfsOptions: {
+ config: {
+ Addresses: {
+ API: '/ip4/127.0.0.1/tcp/0'
+ },
+ API: {
+ HTTPHeaders: {
+ 'Access-Control-Allow-Origin': [
+ app.url
+ ]
+ }
+ }
+ }
+ }
+ })
+
+ try {
+ await testUI(app.url, daemon.apiAddr, daemon.api.peerId.id)
+ } finally {
+ await daemon.stop()
+ await app.stop()
+ }
+}
+
+module.exports = runTest
+
+module.exports[pkg.name] = function (browser) {
+ browser
+ .url(process.env.IPFS_EXAMPLE_TEST_URL)
+ .waitForElementVisible('#connect-input')
+ .clearValue('#connect-input')
+ .setValue('#connect-input', process.env.IPFS_API_MULTIADDR)
+ .pause(1000)
+ .click('#connect-submit')
+
+ // upload file
+ browser
+ .waitForElementVisible('#capture-media')
+ .setValue('#input-file', require('path').resolve(__dirname + '/screenshot.png'))
+ .pause(1000)
+
+ browser.expect.element('#gateway-link').text.to.contain('QmWGmeq2kxsXqhrPhtTEhvck6PXucPf5153PSpZZRxvTwT')
+
+ browser.end()
+}
diff --git a/examples/traverse-ipld-graphs/package.json b/examples/traverse-ipld-graphs/package.json
index 201f37c376..5b75c38cde 100644
--- a/examples/traverse-ipld-graphs/package.json
+++ b/examples/traverse-ipld-graphs/package.json
@@ -13,10 +13,10 @@
"test-ipfs-example": "^2.0.3"
},
"dependencies": {
- "cids": "^0.8.2",
+ "cids": "^0.8.3",
"ipfs": "^0.47.0",
"ipld-block": "^0.9.1",
"ipld-dag-pb": "^0.18.5",
- "multihashing-async": "^0.8.1"
+ "multihashing-async": "^1.0.0"
}
}
diff --git a/lerna.json b/lerna.json
index 60756e2343..21474c9b38 100644
--- a/lerna.json
+++ b/lerna.json
@@ -9,7 +9,9 @@
"hoist": true,
"nohoist": [
"libp2p-delegated-content-routing",
- "libp2p-delegated-peer-routing"
+ "libp2p-delegated-peer-routing",
+ "ipfs-css",
+ "tachyons"
]
},
"run": {
diff --git a/packages/interface-ipfs-core/package.json b/packages/interface-ipfs-core/package.json
index 28af7b6eed..7d39d25b8d 100644
--- a/packages/interface-ipfs-core/package.json
+++ b/packages/interface-ipfs-core/package.json
@@ -36,7 +36,7 @@
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"chai-subset": "^1.6.0",
- "cids": "^0.8.0",
+ "cids": "^0.8.3",
"delay": "^4.3.0",
"dirty-chai": "^2.0.1",
"ipfs-unixfs": "^1.0.3",
diff --git a/packages/ipfs-core-utils/package.json b/packages/ipfs-core-utils/package.json
index a2d4d249d5..8144d9f15c 100644
--- a/packages/ipfs-core-utils/package.json
+++ b/packages/ipfs-core-utils/package.json
@@ -29,7 +29,7 @@
"license": "MIT",
"dependencies": {
"buffer": "^5.6.0",
- "cids": "^0.8.0",
+ "cids": "^0.8.3",
"err-code": "^2.0.0",
"ipfs-utils": "^2.2.2"
},
diff --git a/packages/ipfs-http-client/README.md b/packages/ipfs-http-client/README.md
index f951e66813..44570be69d 100644
--- a/packages/ipfs-http-client/README.md
+++ b/packages/ipfs-http-client/README.md
@@ -290,11 +290,11 @@ const list = await bitswap.wantlist()
Same as in Node.js, you just have to [browserify](http://browserify.org) the code before serving it. See the browserify repo for how to do that.
-See the example in the [examples folder](/examples/browser-browserify) to get a boilerplate.
+See the example in the [examples folder](/examples/http-client-browser-browserify) to get a boilerplate.
**through webpack**
-See the example in the [examples folder](examples/bundle-webpack) to get an idea on how to use `js-ipfs-http-client` with webpack.
+See the example in the [examples folder](/examples/http-client-bundle-webpack) to get an idea on how to use `js-ipfs-http-client` with webpack.
**from CDN**
diff --git a/packages/ipfs-http-client/examples/browser-pubsub/package.json b/packages/ipfs-http-client/examples/browser-pubsub/package.json
deleted file mode 100644
index 6e519bf9ec..0000000000
--- a/packages/ipfs-http-client/examples/browser-pubsub/package.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "name": "browser-pubsub-example",
- "version": "0.0.0",
- "description": "An example demonstrating pubsub in the browser",
- "private": true,
- "main": "index.js",
- "scripts": {
- "start": "parcel index.html"
- },
- "author": "Alan Shaw",
- "license": "MIT",
- "dependencies": {
- "ipfs-http-client": "../../"
- },
- "browserslist": [
- "last 2 versions and not dead and > 2%"
- ],
- "devDependencies": {
- "parcel-bundler": "^1.12.4"
- }
-}
diff --git a/packages/ipfs-http-client/examples/bundle-webpack/package.json b/packages/ipfs-http-client/examples/bundle-webpack/package.json
deleted file mode 100644
index 9a41b758e0..0000000000
--- a/packages/ipfs-http-client/examples/bundle-webpack/package.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "name": "bundle-webpack",
- "version": "1.0.0",
- "description": "Bundle js-ipfs-http-client with Webpack",
- "scripts": {
- "start": "node server.js"
- },
- "author": "Victor Bjelkholm
",
- "license": "MIT",
- "keywords": [],
- "devDependencies": {
- "@babel/core": "^7.2.2",
- "@babel/preset-env": "^7.3.1",
- "@babel/preset-react": "^7.0.0",
- "babel-loader": "^8.0.5",
- "ipfs-http-client": "../../",
- "react": "^16.8.6",
- "react-dom": "^16.8.6",
- "react-hot-loader": "^4.8.4",
- "webpack": "^4.31.0",
- "webpack-dev-server": "^3.3.1"
- },
- "browserslist": [
- "last 2 versions and not dead and > 2%"
- ]
-}
diff --git a/packages/ipfs-http-client/examples/bundle-webpack/server.js b/packages/ipfs-http-client/examples/bundle-webpack/server.js
deleted file mode 100644
index dd1d4358b6..0000000000
--- a/packages/ipfs-http-client/examples/bundle-webpack/server.js
+++ /dev/null
@@ -1,16 +0,0 @@
-'use strict'
-var webpack = require('webpack')
-var WebpackDevServer = require('webpack-dev-server')
-var config = require('./webpack.config')
-
-new WebpackDevServer(webpack(config), {
- publicPath: config.output.publicPath,
- hot: true,
- historyApiFallback: true
-}).listen(3000, 'localhost', function (err, result) {
- if (err) {
- console.log(err)
- }
-
- console.log('Listening at localhost:3000')
-})
diff --git a/packages/ipfs-http-client/examples/bundle-webpack/src/App.js b/packages/ipfs-http-client/examples/bundle-webpack/src/App.js
deleted file mode 100644
index bc25b5b810..0000000000
--- a/packages/ipfs-http-client/examples/bundle-webpack/src/App.js
+++ /dev/null
@@ -1,60 +0,0 @@
-'use strict'
-const React = require('react')
-const ipfsClient = require('ipfs-http-client')
-
-const ipfs = ipfsClient('/ip4/127.0.0.1/tcp/5001')
-const stringToUse = 'hello world from webpacked IPFS'
-
-class App extends React.Component {
- constructor (props) {
- super(props)
- this.state = {
- id: null,
- version: null,
- protocol_version: null,
- added_file_hash: null,
- added_file_contents: null
- }
- }
- async componentDidMount () {
- const id = await ipfs.id()
- this.setState({
- id: id.id,
- version: id.agentVersion,
- protocol_version: id.protocolVersion
- })
-
- const source = ipfs.add(stringToUse)
- for await (const file of source) {
- console.log("TCL: App -> forawait -> file", file)
- const hash = file.path
- this.setState({ added_file_hash: hash })
-
- const source = ipfs.cat(hash)
- const data = []
- for await (const chunk of source) {
- data.push(chunk)
- }
- this.setState({ added_file_contents: Buffer.concat(data).toString() })
- }
- }
- render () {
- return
-
Everything is working!
-
Your ID is {this.state.id}
-
Your IPFS version is {this.state.version}
-
Your IPFS protocol version is {this.state.protocol_version}
-
-
- Added a file!
- {this.state.added_file_hash}
-
-
- Contents of this file:
- {this.state.added_file_contents}
-
-
-
- }
-}
-module.exports = App
diff --git a/packages/ipfs-http-client/examples/files-api/files-api.js b/packages/ipfs-http-client/examples/files-api/files-api.js
deleted file mode 100644
index 06bf6bf4b3..0000000000
--- a/packages/ipfs-http-client/examples/files-api/files-api.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/* eslint-disable no-console */
-'use strict'
-const { Buffer } = require('buffer')
-// Run `ipfs daemon` in your terminal to start the IPFS daemon
-// Look for `API server listening on /ip4/127.0.0.1/tcp/5001`
-const ipfs = require('../../src')('/ip4/127.0.0.1/tcp/5001')
-
-const run = async () => {
- await ipfs.files.write(
- '/temp/hello-world',
- Buffer.from('Hello, world!'),
- { create: true, parents: true }
- )
- const source = ipfs.files.ls('/temp')
-
- for await (const file of source) {
- console.log(file)
- }
-}
-
-run()
diff --git a/packages/ipfs-http-client/examples/name-api/README.md b/packages/ipfs-http-client/examples/name-api/README.md
deleted file mode 100644
index 11d814464b..0000000000
--- a/packages/ipfs-http-client/examples/name-api/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# JS IPFS API - Example Browser - Name
-
-## Setup
-
-Install [go-ipfs](https://ipfs.io/docs/install/) and start the daemon.
-
-Configure CORS as suggested by the README https://github.com/ipfs/js-ipfs-http-client#cors
-
-```bash
-> ipfs daemon
-```
-
-then in this folder run
-
-```bash
-> npm install
-> npm start
-```
-
-and open your browser at `http://localhost:8888`.
diff --git a/packages/ipfs-http-client/examples/name-api/package.json b/packages/ipfs-http-client/examples/name-api/package.json
deleted file mode 100644
index 3929830dca..0000000000
--- a/packages/ipfs-http-client/examples/name-api/package.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "js-ipfs-http-client-example-name-publish-resolve",
- "version": "1.0.0",
- "description": "",
- "main": "index.js",
- "scripts": {
- "start": "parcel index.html"
- },
- "author": "Tara Vancil ",
- "license": "MIT",
- "devDependencies": {
- "parcel-bundler": "^1.12.4"
- },
- "dependencies": {
- "ipfs-http-client": "../.."
- },
- "browserslist": [
- "last 2 versions and not dead and > 2%"
- ]
-}
diff --git a/packages/ipfs-http-client/examples/sub-module/bundles-size-KBs.csv b/packages/ipfs-http-client/examples/sub-module/bundles-size-KBs.csv
deleted file mode 100644
index 3bc5bce328..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/bundles-size-KBs.csv
+++ /dev/null
@@ -1,28 +0,0 @@
-name, bundled (KBs), minified (KBs)
-IPFS, 1412.20, 573.44
-add, 591.17, 198.23
-bitswap, 590.14, 197.96
-block, 630.50, 216.31
-bootstrap, 590.97, 198.22
-cat, 630.78, 216.41
-commands, 589.22, 197.59
-config, 592.21, 198.93
-dht, 593.86, 199.24
-diag, 590.31, 198.00
-files, 669.07, 235.88
-get, 661.57, 233.16
-id, 589.65, 197.78
-key, 589.93, 197.86
-log, 590.74, 198.20
-ls, 589.35, 197.63
-mount, 589.53, 197.69
-name, 589.97, 197.88
-object, 833.17, 307.73
-pin, 590.86, 198.22
-ping, 589.94, 197.73
-pubsub, 595.31, 199.76
-refs, 589.74, 197.77
-repo, 589.91, 197.85
-swarm, 1239.42, 498.59
-update, 589.79, 197.79
-version, 589.55, 197.71
diff --git a/packages/ipfs-http-client/examples/sub-module/complete-module.js b/packages/ipfs-http-client/examples/sub-module/complete-module.js
deleted file mode 100644
index c6a3c99e9f..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/complete-module.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../src')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/add/add.js b/packages/ipfs-http-client/examples/sub-module/modules/add/add.js
deleted file mode 100644
index cbb27a7e1e..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/add/add.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/add')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/bitswap/bitswap.js b/packages/ipfs-http-client/examples/sub-module/modules/bitswap/bitswap.js
deleted file mode 100644
index ed4c91068d..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/bitswap/bitswap.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/bitswap')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/block/block.js b/packages/ipfs-http-client/examples/sub-module/modules/block/block.js
deleted file mode 100644
index 587bf3cf9b..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/block/block.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/block')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/bootstrap/bootstrap.js b/packages/ipfs-http-client/examples/sub-module/modules/bootstrap/bootstrap.js
deleted file mode 100644
index 19c78b4c41..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/bootstrap/bootstrap.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/bootstrap')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/cat/cat.js b/packages/ipfs-http-client/examples/sub-module/modules/cat/cat.js
deleted file mode 100644
index 079aaf9085..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/cat/cat.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/cat')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/commands/commands.js b/packages/ipfs-http-client/examples/sub-module/modules/commands/commands.js
deleted file mode 100644
index 2a1286f35a..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/commands/commands.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/commands')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/config/config.js b/packages/ipfs-http-client/examples/sub-module/modules/config/config.js
deleted file mode 100644
index e49c0d49ae..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/config/config.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/config')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/dht/dht.js b/packages/ipfs-http-client/examples/sub-module/modules/dht/dht.js
deleted file mode 100644
index 4ea8b78bc3..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/dht/dht.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/dht')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/diag/diag.js b/packages/ipfs-http-client/examples/sub-module/modules/diag/diag.js
deleted file mode 100644
index f4be953be3..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/diag/diag.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/diag')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/files/files.js b/packages/ipfs-http-client/examples/sub-module/modules/files/files.js
deleted file mode 100644
index 85de08a177..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/files/files.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/files')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/get/get.js b/packages/ipfs-http-client/examples/sub-module/modules/get/get.js
deleted file mode 100644
index 9fee179ffd..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/get/get.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/get')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/id/id.js b/packages/ipfs-http-client/examples/sub-module/modules/id/id.js
deleted file mode 100644
index 046ebac9e2..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/id/id.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/id')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/key/key.js b/packages/ipfs-http-client/examples/sub-module/modules/key/key.js
deleted file mode 100644
index 875122892d..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/key/key.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/key')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/log/log.js b/packages/ipfs-http-client/examples/sub-module/modules/log/log.js
deleted file mode 100644
index 91e436bd8e..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/log/log.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/log')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/ls/ls.js b/packages/ipfs-http-client/examples/sub-module/modules/ls/ls.js
deleted file mode 100644
index b134b37fc7..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/ls/ls.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/ls')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/mount/mount.js b/packages/ipfs-http-client/examples/sub-module/modules/mount/mount.js
deleted file mode 100644
index 9facf27a6b..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/mount/mount.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/mount')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/name/name.js b/packages/ipfs-http-client/examples/sub-module/modules/name/name.js
deleted file mode 100644
index c8dcacc6e3..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/name/name.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/name')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/object/object.js b/packages/ipfs-http-client/examples/sub-module/modules/object/object.js
deleted file mode 100644
index 0ea29a8a89..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/object/object.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/object')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/pin/pin.js b/packages/ipfs-http-client/examples/sub-module/modules/pin/pin.js
deleted file mode 100644
index 1ce452cb8b..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/pin/pin.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/pin')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/ping/ping.js b/packages/ipfs-http-client/examples/sub-module/modules/ping/ping.js
deleted file mode 100644
index 6f849708b4..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/ping/ping.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/ping')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/pubsub/pubsub.js b/packages/ipfs-http-client/examples/sub-module/modules/pubsub/pubsub.js
deleted file mode 100644
index 4a4ca8656e..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/pubsub/pubsub.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/pubsub')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/refs/refs.js b/packages/ipfs-http-client/examples/sub-module/modules/refs/refs.js
deleted file mode 100644
index 25034ba4f7..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/refs/refs.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/refs')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/repo/repo.js b/packages/ipfs-http-client/examples/sub-module/modules/repo/repo.js
deleted file mode 100644
index 552b2891ef..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/repo/repo.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/repo')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/swarm/swarm.js b/packages/ipfs-http-client/examples/sub-module/modules/swarm/swarm.js
deleted file mode 100644
index 627649c148..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/swarm/swarm.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/swarm')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/update/update.js b/packages/ipfs-http-client/examples/sub-module/modules/update/update.js
deleted file mode 100644
index 948ac29e61..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/update/update.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/update')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/modules/version/version.js b/packages/ipfs-http-client/examples/sub-module/modules/version/version.js
deleted file mode 100644
index 21a47fdf11..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/modules/version/version.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict'
-
-require('../../../../src/version')('/ip4/127.0.0.1/tcp/5001')
diff --git a/packages/ipfs-http-client/examples/sub-module/package.json b/packages/ipfs-http-client/examples/sub-module/package.json
deleted file mode 100644
index 8282d26ce2..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/package.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "name": "sub-module",
- "version": "1.0.0",
- "description": "",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "Nuno Nogueira",
- "license": "MIT",
- "devDependencies": {
- "babel-core": "^6.25.0",
- "babel-loader": "^8.0.5",
- "babel-preset-env": "^1.5.2",
- "babili": "^0.1.4",
- "webpack": "^4.31.0"
- }
-}
diff --git a/packages/ipfs-http-client/examples/sub-module/test-modules-size.sh b/packages/ipfs-http-client/examples/sub-module/test-modules-size.sh
deleted file mode 100755
index 0b330d6a25..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/test-modules-size.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-set -e
-
-modules=($(ls modules/))
-
-echo "name, bundled (KBs), minified (KBs)"
-
-# Full IPFS module
-webpack --display none --config webpack.config.js complete-module.js complete-bundle.js
-babili complete-bundle.js -o complete-bundle-minified.js
-
-ipfsBundleSize=($(wc -c < complete-bundle.js | awk '{b=$1/1024; printf "%.2f\n", b}' | sed 's/,/./g'))
-ipfsMinSize=($(wc -c < complete-bundle-minified.js | awk '{b=$1/1024; printf "%.2f\n", b}' | sed 's/,/./g'))
-
-echo IPFS, $ipfsBundleSize, $ipfsMinSize
-
-for module in "${modules[@]}"
-do
- moduledir="modules/$module"
- webpack --display none --config webpack.config.js $moduledir/$module.js $moduledir/bundle.js
- babili $moduledir/bundle.js -o $moduledir/bundle-minified.js
-
- bundlesize=($(wc -c < $moduledir/bundle.js | awk '{b=$1/1024; printf "%.2f\n", b}' | sed 's/,/./g'))
- minsize=($(wc -c < $moduledir/bundle-minified.js | awk '{b=$1/1024; printf "%.2f\n", b}' | sed 's/,/./g'))
- echo $module, $bundlesize, $minsize
-done
diff --git a/packages/ipfs-http-client/examples/sub-module/webpack.config.js b/packages/ipfs-http-client/examples/sub-module/webpack.config.js
deleted file mode 100644
index 7124eb3db0..0000000000
--- a/packages/ipfs-http-client/examples/sub-module/webpack.config.js
+++ /dev/null
@@ -1,15 +0,0 @@
-'use strict'
-
-module.exports = {
- module: {
- loaders: [{
- test: /\.js$/,
- loaders: ['babel-loader']
- }]
- },
- node: {
- fs: 'empty',
- net: 'empty',
- tls: 'empty'
- }
-}
diff --git a/packages/ipfs-http-client/package.json b/packages/ipfs-http-client/package.json
index 8a58a239d8..5a2695362e 100644
--- a/packages/ipfs-http-client/package.json
+++ b/packages/ipfs-http-client/package.json
@@ -43,7 +43,7 @@
"any-signal": "^1.1.0",
"bignumber.js": "^9.0.0",
"buffer": "^5.6.0",
- "cids": "^0.8.0",
+ "cids": "^0.8.3",
"debug": "^4.1.0",
"form-data": "^3.0.0",
"ipfs-core-utils": "^0.2.4",
diff --git a/packages/ipfs/package.json b/packages/ipfs/package.json
index 7f433c02b2..7102121881 100644
--- a/packages/ipfs/package.json
+++ b/packages/ipfs/package.json
@@ -76,7 +76,7 @@
"buffer": "^5.6.0",
"byteman": "^1.3.5",
"cid-tool": "^0.4.0",
- "cids": "^0.8.0",
+ "cids": "^0.8.3",
"class-is": "^1.1.0",
"dag-cbor-links": "^1.3.3",
"datastore-core": "^1.1.0",
@@ -137,10 +137,10 @@
"libp2p-gossipsub": "^0.4.0",
"libp2p-kad-dht": "^0.19.9",
"libp2p-mdns": "^0.14.1",
- "libp2p-mplex": "^0.9.3",
+ "libp2p-mplex": "^0.9.5",
"libp2p-noise": "^1.1.1",
"libp2p-record": "^0.7.3",
- "libp2p-secio": "^0.12.2",
+ "libp2p-secio": "^0.12.6",
"libp2p-tcp": "^0.14.5",
"libp2p-webrtc-star": "^0.18.0",
"libp2p-websockets": "^0.13.3",