Skip to content

Support specify hash algorithm in files.add #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
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: 7 additions & 1 deletion .aegir.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict'

const factory = require('./test/ipfs-factory/tasks')

module.exports = {
karma: {
files: [{
Expand All @@ -8,5 +10,9 @@ module.exports = {
served: true,
included: false
}]
},
hooks: {
pre: factory.start,
post: factory.stop
}
}
}
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ matrix:
script:
- npm run lint
- npm run test
- npm run coverage
- make test

before_script:
- export DISPLAY=:99.0
Expand Down
237 changes: 8 additions & 229 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,246 +1,25 @@
<a name="14.2.1"></a>
## [14.2.1](https://github.com/ipfs/js-ipfs-api/compare/v14.2.0...v14.2.1) (2017-09-02)
<a name="14.3.4"></a>
## [14.3.4](https://github.com/ipfs/js-ipfs-api/compare/v14.3.3...v14.3.4) (2017-09-07)


### Bug Fixes

* regression caused by 322b756 ([#591](https://github.com/ipfs/js-ipfs-api/issues/591)) ([8affcfe](https://github.com/ipfs/js-ipfs-api/commit/8affcfe))



<a name="14.2.0"></a>
# [14.2.0](https://github.com/ipfs/js-ipfs-api/compare/v14.1.2...v14.2.0) (2017-09-02)


### Features

* Allow --cid-version option to be passed to ipfs files add ([#589](https://github.com/ipfs/js-ipfs-api/issues/589)) ([717c72f](https://github.com/ipfs/js-ipfs-api/commit/717c72f))
* Preserve "+" in file paths. ([#588](https://github.com/ipfs/js-ipfs-api/issues/588)) ([322b756](https://github.com/ipfs/js-ipfs-api/commit/322b756))
* test against latest go-ipfs ([#590](https://github.com/ipfs/js-ipfs-api/issues/590)) ([40c8f10](https://github.com/ipfs/js-ipfs-api/commit/40c8f10))



<a name="14.1.2"></a>
## [14.1.2](https://github.com/ipfs/js-ipfs-api/compare/v14.1.1...v14.1.2) (2017-08-06)



<a name="14.1.1"></a>
## [14.1.1](https://github.com/ipfs/js-ipfs-api/compare/v14.1.0...v14.1.1) (2017-07-26)


### Bug Fixes

* [#572](https://github.com/ipfs/js-ipfs-api/issues/572) ([3354901](https://github.com/ipfs/js-ipfs-api/commit/3354901))



<a name="14.1.0"></a>
# [14.1.0](https://github.com/ipfs/js-ipfs-api/compare/v14.0.4...v14.1.0) (2017-07-22)


### Bug Fixes

* circle ci, thanks victor! ([88b6705](https://github.com/ipfs/js-ipfs-api/commit/88b6705))



<a name="14.0.4"></a>
## [14.0.4](https://github.com/ipfs/js-ipfs-api/compare/v14.0.3...v14.0.4) (2017-06-21)


### Bug Fixes

* don't let qs mangle binary buffers ([#569](https://github.com/ipfs/js-ipfs-api/issues/569)) ([#570](https://github.com/ipfs/js-ipfs-api/issues/570)) ([6cbd89c](https://github.com/ipfs/js-ipfs-api/commit/6cbd89c))



<a name="14.0.3"></a>
## [14.0.3](https://github.com/ipfs/js-ipfs-api/compare/v14.0.2...v14.0.3) (2017-05-29)



<a name="14.0.2"></a>
## [14.0.2](https://github.com/ipfs/js-ipfs-api/compare/v14.0.1...v14.0.2) (2017-05-19)


### Features

* Use CID for api.get/api.cat ([#555](https://github.com/ipfs/js-ipfs-api/issues/555)) ([da7d0f4](https://github.com/ipfs/js-ipfs-api/commit/da7d0f4))



<a name="14.0.1"></a>
## [14.0.1](https://github.com/ipfs/js-ipfs-api/compare/v14.0.0...v14.0.1) (2017-05-04)



<a name="14.0.0"></a>
# [14.0.0](https://github.com/ipfs/js-ipfs-api/compare/v13.0.0...v14.0.0) (2017-03-30)


### Features

* new peer-info ([#542](https://github.com/ipfs/js-ipfs-api/issues/542)) ([820150c](https://github.com/ipfs/js-ipfs-api/commit/820150c))
* **pubsub:** Add pubsub api ([#493](https://github.com/ipfs/js-ipfs-api/issues/493)) ([d2eb925](https://github.com/ipfs/js-ipfs-api/commit/d2eb925))



<a name="13.0.0"></a>
# [13.0.0](https://github.com/ipfs/js-ipfs-api/compare/v12.1.7...v13.0.0) (2017-03-22)
<a name="14.3.3"></a>
## [14.3.3](https://github.com/ipfs/js-ipfs-api/compare/v14.3.2...v14.3.3) (2017-09-07)


### Features

* change window to self for webworker support ([e2e3213](https://github.com/ipfs/js-ipfs-api/commit/e2e3213))



<a name="12.1.7"></a>
## [12.1.7](https://github.com/ipfs/js-ipfs-api/compare/v12.1.6...v12.1.7) (2017-02-09)

* support options for .add / files.add ([8c717b2](https://github.com/ipfs/js-ipfs-api/commit/8c717b2))


<a name="12.1.6"></a>
## [12.1.6](https://github.com/ipfs/js-ipfs-api/compare/v12.1.5...v12.1.6) (2017-02-01)



<a name="12.1.5"></a>
## [12.1.5](https://github.com/ipfs/js-ipfs-api/compare/v12.1.4...v12.1.5) (2017-01-31)
<a name="14.3.2"></a>
## [14.3.2](https://github.com/ipfs/js-ipfs-api/compare/v14.3.1...v14.3.2) (2017-09-04)


### Bug Fixes

* lint ([dfb07a3](https://github.com/ipfs/js-ipfs-api/commit/dfb07a3))



<a name="12.1.4"></a>
## [12.1.4](https://github.com/ipfs/js-ipfs-api/compare/v12.1.3...v12.1.4) (2017-01-11)



<a name="12.1.3"></a>
## [12.1.3](https://github.com/ipfs/js-ipfs-api/compare/v12.1.2...v12.1.3) (2017-01-10)



<a name="12.1.2"></a>
## [12.1.2](https://github.com/ipfs/js-ipfs-api/compare/v12.1.1...v12.1.2) (2016-12-21)


* new fixed aegir ([93ac472](https://github.com/ipfs/js-ipfs-api/commit/93ac472))

<a name="12.1.1"></a>
## [12.1.1](https://github.com/ipfs/js-ipfs-api/compare/v12.1.0...v12.1.1) (2016-12-21)



<a name="12.1.0"></a>
# [12.1.0](https://github.com/ipfs/js-ipfs-api/compare/v12.0.3...v12.1.0) (2016-12-12)


### Features

* **object:** add template support to object.new ([2784863](https://github.com/ipfs/js-ipfs-api/commit/2784863))



<a name="12.0.3"></a>
## [12.0.3](https://github.com/ipfs/js-ipfs-api/compare/v12.0.2...v12.0.3) (2016-12-09)


### Bug Fixes

* block.get supports multihash as buffers again ([b3dbe45](https://github.com/ipfs/js-ipfs-api/commit/b3dbe45))



<a name="12.0.2"></a>
## [12.0.2](https://github.com/ipfs/js-ipfs-api/compare/v12.0.1...v12.0.2) (2016-12-01)



<a name="12.0.1"></a>
## [12.0.1](https://github.com/ipfs/js-ipfs-api/compare/v12.0.0...v12.0.1) (2016-11-28)



<a name="12.0.0"></a>
# [12.0.0](https://github.com/ipfs/js-ipfs-api/compare/v11.2.0...v12.0.0) (2016-11-24)



<a name="11.2.0"></a>
# [11.2.0](https://github.com/ipfs/js-ipfs-api/compare/v11.1.0...v11.2.0) (2016-11-24)


### Bug Fixes

* handle missing daemon errors ([41c8153](https://github.com/ipfs/js-ipfs-api/commit/41c8153))
* linting ([723b4b0](https://github.com/ipfs/js-ipfs-api/commit/723b4b0))


### Features

* **swarm:** support for new swarm.peers in 0.4.5 ([690a77c](https://github.com/ipfs/js-ipfs-api/commit/690a77c))
* upgrade to awesome dag-pb ([1e82b8c](https://github.com/ipfs/js-ipfs-api/commit/1e82b8c))



<a name="11.1.0"></a>
# [11.1.0](https://github.com/ipfs/js-ipfs-api/compare/v11.0.1...v11.1.0) (2016-11-08)


### Bug Fixes

* **get:** properly handled nested content ([0731f45](https://github.com/ipfs/js-ipfs-api/commit/0731f45))


### Features

* **object:** add lru cache to object get/put ([c439f39](https://github.com/ipfs/js-ipfs-api/commit/c439f39))
* add npm engine ([505ce8e](https://github.com/ipfs/js-ipfs-api/commit/505ce8e))
* update interface-ipfs-core ([1191bb6](https://github.com/ipfs/js-ipfs-api/commit/1191bb6))



<a name="11.0.1"></a>
## [11.0.1](https://github.com/ipfs/js-ipfs-api/compare/v11.0.0...v11.0.1) (2016-10-29)



<a name="11.0.0"></a>
# [11.0.0](https://github.com/ipfs/js-ipfs-api/compare/v10.0.0...v11.0.0) (2016-10-29)


### Bug Fixes

* increase memory (to enable release until we got the size of the bundle shaved down ([12c9660](https://github.com/ipfs/js-ipfs-api/commit/12c9660))



<a name="10.0.0"></a>
# [10.0.0](https://github.com/ipfs/js-ipfs-api/compare/v9.0.0...v10.0.0) (2016-10-28)


### Features

* disable phantomJS ([b634684](https://github.com/ipfs/js-ipfs-api/commit/b634684))
* support new CID block API ([4314815](https://github.com/ipfs/js-ipfs-api/commit/4314815))
* update files to use async dag-pb api ([ad96d22](https://github.com/ipfs/js-ipfs-api/commit/ad96d22))



<a name="9.0.0"></a>
# [9.0.0](https://github.com/ipfs/js-ipfs-api/compare/v8.0.4...v9.0.0) (2016-09-15)


### Bug Fixes

* Return req from tail ([0273a3a](https://github.com/ipfs/js-ipfs-api/commit/0273a3a))


### Features

* **swarm:** make interface-ipfs-core compliant ([f245f27](https://github.com/ipfs/js-ipfs-api/commit/f245f27))
4 changes: 4 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ machine:
node:
version: stable

test:
post:
- npm run coverage -- --upload

dependencies:
pre:
- google-chrome --version
Expand Down
2 changes: 1 addition & 1 deletion examples/bundle-browserify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var ipfs = IPFS()

function store () {
var toStore = document.getElementById('source').value
ipfs.add(new Buffer(toStore), function (err, res) {
ipfs.add(Buffer.from(toStore), function (err, res) {
if (err || !res) {
return console.error('ipfs add error', err, res)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/bundle-webpack/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class App extends React.Component {
protocol_version: res.protocolVersion
})
})
ipfs.add([new Buffer(stringToUse)], (err, res) => {
ipfs.add([Buffer.from(stringToUse)], (err, res) => {
if (err) throw err
const hash = res[0].hash
this.setState({added_file_hash: hash})
Expand Down
2 changes: 1 addition & 1 deletion examples/files-api/files-api.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

var ipfs = require('../../src')('localhost', 5001)
const ipfs = require('../../src')('localhost', 5001)

ipfs.files.ls('/folder1', function (err, res) {
if (err) {
Expand Down
2 changes: 1 addition & 1 deletion examples/name-api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const addAndPublish = (e) => {
e.preventDefault()

let input = e.target.elements['text']
let buffer = new Buffer(input.value)
let buffer = Buffer.from(input.value)

showStatus('adding to IPFS...', COLORS.active)

Expand Down
22 changes: 11 additions & 11 deletions examples/upload-file-via-browser/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ class App extends React.Component {
let ipfsId
const buffer = Buffer.from(reader.result)
this.ipfsApi.add(buffer)
.then((response) => {
console.log(response)
ipfsId = response[0].hash
console.log(ipfsId)
this.setState({added_file_hash: ipfsId})
}).catch((err) => {
console.error(err)
})
.then((response) => {
console.log(response)
ipfsId = response[0].hash
console.log(ipfsId)
this.setState({added_file_hash: ipfsId})
}).catch((err) => {
console.error(err)
})
}

arrayBufferToString (arrayBuffer) {
Expand All @@ -51,11 +51,11 @@ class App extends React.Component {
render () {
return (
<div>
<form id="captureMedia" onSubmit={this.handleSubmit}>
<input type="file" onChange={this.captureFile} />
<form id='captureMedia' onSubmit={this.handleSubmit}>
<input type='file' onChange={this.captureFile} />
</form>
<div>
<a target="_blank"
<a target='_blank'
href={'https://ipfs.io/ipfs/' + this.state.added_file_hash}>
{this.state.added_file_hash}
</a>
Expand Down
12 changes: 0 additions & 12 deletions gulpfile.js

This file was deleted.

Loading