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

feat: support specify hash algorithm in files.add #1005

Closed
wants to merge 7 commits into from

Conversation

alanshaw
Copy link
Member

@alanshaw alanshaw commented Sep 8, 2017

Specify multihash hashing alogrithm

This allows the optional param --hash (CLI) or ?hash= (HTTP API) to be passed to files.add in order to specify the hash algorithm that should be used when generating the multihash(es) for the added content.

Passing this option will set the CID version option to true, as per the Go implementation.

Change object/get and object/data to accept CIDs

This brings js-ipfs more in line with go-ipfs. Where both object/get and object/data accept a CID. It's also needed by js-ipfs-api when adding files (see further discussion in ipfs-inactive/js-ipfs-http-client#597).

requires ipfs-inactive/js-ipfs-unixfs-engine#185
requires ipfs-inactive/js-ipfs-http-client#597

daviddias
daviddias previously approved these changes Sep 8, 2017
Copy link
Member

@daviddias daviddias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

released ipfs-api 14.3.5

Thanks @alanshaw ! :)

@@ -178,20 +164,19 @@ module.exports = function object (self) {
}
}),

get: promisify((multihash, options, callback) => {
get: promisify((hash, options, callback) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same nitpick as js-ipfs-api, they follow the same interface :)

@daviddias
Copy link
Member

@alanshaw do the tests fail to you locally as well?

@alanshaw
Copy link
Member Author

alanshaw commented Sep 8, 2017

Yes these have failed for me too :( I'll take a look asap.

@daviddias
Copy link
Member

@alanshaw this needs a rebase from master (things just moved around)

daviddias added a commit that referenced this pull request Sep 8, 2017
* wip - incomplete feature -> #1005

* fix: swarm.peers - ensure that only peers connected are returned
dryajov pushed a commit that referenced this pull request Sep 12, 2017
* wip - incomplete feature -> #1005

* fix: swarm.peers - ensure that only peers connected are returned
@daviddias daviddias added the status/in-progress In progress label Sep 13, 2017
@daviddias
Copy link
Member

@alanshaw are you available to finish this PR?

@daviddias daviddias added exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked and removed status/in-progress In progress labels Jan 25, 2018
@daviddias daviddias changed the title Support specify hash algorithm in files.add feat: support specify hash algorithm in files.add Feb 15, 2018
@daviddias
Copy link
Member

@hacdias wanna look into this one?

@vasco-santos vasco-santos self-assigned this Apr 9, 2018
@vasco-santos vasco-santos added status/in-progress In progress and removed status/ready Ready to be worked labels Apr 9, 2018
@vasco-santos vasco-santos removed their assignment Apr 9, 2018
@vasco-santos vasco-santos added status/ready Ready to be worked status/in-progress In progress and removed status/in-progress In progress status/ready Ready to be worked labels Apr 9, 2018
@vasco-santos vasco-santos self-assigned this Apr 10, 2018
@daviddias
Copy link
Member

Done on #1308

@daviddias daviddias closed this Apr 30, 2018
@ghost ghost removed the status/in-progress In progress label Apr 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue P2 Medium: Good to have, but can wait until someone steps up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants