Skip to content

Add support for IPNS#17

Merged
vasild merged 13 commits intovasild:masterfrom
linas:name
Nov 1, 2019
Merged

Add support for IPNS#17
vasild merged 13 commits intovasild:masterfrom
linas:name

Conversation

@linas
Copy link
Copy Markdown
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
Copy Markdown
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)

Comment thread include/ipfs/client.h Outdated
Comment thread include/ipfs/client.h Outdated
Comment thread include/ipfs/client.h Outdated
/** [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
Copy Markdown
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
Copy Markdown
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.

Comment thread include/ipfs/client.h Outdated
Comment thread include/ipfs/client.h Outdated
Comment thread test/name.cc Outdated
Comment thread test/name.cc Outdated
Comment thread test/name.cc
Comment thread test/name.cc Outdated
Comment thread test/name.cc
@linas
Copy link
Copy Markdown
Contributor Author

linas commented Oct 27, 2019

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

@linas
Copy link
Copy Markdown
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
Copy Markdown
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