Skip to content
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

Add support for IPNS #17

Merged
merged 13 commits into from
Nov 1, 2019
Merged

Add support for IPNS #17

merged 13 commits into from
Nov 1, 2019

Conversation

linas
Copy link
Contributor

@linas linas commented Oct 19, 2019

This adds support for publishing IPNS entries to IPFS objects.

The IPNS API requires the Key API given in pull req #16. If you merge that first, this will result in a merge conflict; I'll have to rebase. Alternately, merge this, and reject #16.

Copy link
Owner

@vasild vasild left a comment

Choose a reason for hiding this comment

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

I left some review comments. Also, a merge from master is needed.

(sorry, I stated looking at PRs in chronological order and already merged pr/16 before seeing your "merge this and drop 16" message here)

include/ipfs/client.h Outdated Show resolved Hide resolved
include/ipfs/client.h Outdated Show resolved Hide resolved
/** [out] IPNS name Id (multihash) of the named object. */
std::string* name_id,
/** [in] Lifetime duration of the record. */
const std::string& lifetime = "24h",
Copy link
Owner

Choose a reason for hiding this comment

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

The resolve option is missing.

What about passing a Json object for all of the 4 options described in https://github.com/ipfs/interface-js-ipfs-core/blob/master/SPEC/NAME.md#namepublish? If a property is not present in the supplied Json object, then we don't pass it to curl.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that may be a better API. Should it come before, or after the returned value? If after, then it can be given a default value. If before, then not... I;; push a change that places it before, but without a default.

include/ipfs/client.h Outdated Show resolved Hide resolved
include/ipfs/client.h Outdated Show resolved Hide resolved
test/name.cc Outdated Show resolved Hide resolved
test/name.cc Outdated Show resolved Hide resolved
test/name.cc Show resolved Hide resolved
test/name.cc Outdated Show resolved Hide resolved
test/name.cc Show resolved Hide resolved
@linas
Copy link
Contributor Author

linas commented Oct 27, 2019

OK, I've made all requested changes, and pushed a new API for NamePublish().

@linas
Copy link
Contributor Author

linas commented Oct 27, 2019

BTW: The name test requires 90 seconds to run, due to a "well-known" IPNS bug; see ipfs/kubo#3860 (comment) for details.

@vasild vasild merged commit f22eaa2 into vasild:master Nov 1, 2019
@vasild
Copy link
Owner

vasild commented Nov 1, 2019

Merged, thanks!

Notice: some followup commits:
dc9c28e Add a comment to make the NameResolve example self-contained
427ab59 Add missing { } around a single-line block
0194714 Bump project version, due to new Name*() methods
51be1fd Add trailing dots to URLs for consistency with the rest of client.h

@linas linas deleted the name branch November 1, 2019 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants