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

Any way to provide the key to use when publishing to IPNS? #95

Closed
soupdiver opened this issue Jun 29, 2018 · 8 comments
Closed

Any way to provide the key to use when publishing to IPNS? #95

soupdiver opened this issue Jun 29, 2018 · 8 comments
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@soupdiver
Copy link
Contributor

I'm looking at https://github.com/ipfs/go-ipfs-api/blob/master/ipns.go#L9 and try to figure out how to specify the key to use for publishing the record?
I can see that on the api side the value can be red in theory: https://github.com/ipfs/go-ipfs/blob/master/core/coreapi/name.go#L42

I can implement that myself but I currently struggle to find the the point where https://github.com/ipfs/go-ipfs/blob/master/core/coreapi/name.go#L41 is invoked to see how the parameter needs to be formatted/named etc.

If someone can explain what I'm doing wrong or point me to the point where the http request is mapped to the coreapi function that would be awesome

@Stebalien
Copy link
Member

I believe one was supposed to put the key's name/id in the "node" field. However, that won't work as implemented. This method looks a bit buggy.

@Stebalien Stebalien added the kind/bug A bug in existing code (including security flaws) label Jun 30, 2018
@soupdiver
Copy link
Contributor Author

I see...
As said I'm willing to help out with this, since I need this feature for a project I work on.
I tried to navigate myself through the code and figure out how/where the translation between http request and command invocation is done. But let's say that part of the code is not exactly easy to read/understand imho.

If I'm right I tracked it down to this location: https://github.com/ipfs/go-ipfs-cmds/blob/master/http/parse.go#L18 where the http request is parsed, matched against (sub)commands and arguments/options are set.

What I don't get is how exactly this mapping is done.
Are the options/values red from the url? If yes, in which format do they need to be supplied? The only "example" I could find is this: https://github.com/ipfs/go-ipfs-cmds/blob/master/http/parse.go#L43

If you could clarify this a bit that would be great

@soupdiver
Copy link
Contributor Author

ok I just figured that this would be solved when #91 is merged if I don't overlook something

@magik6k
Copy link
Member

magik6k commented Jul 4, 2018

This package doesn't yet implement CoreAPI. This will be done in in #76, but that will take some time. Meanwhile #91 provides a good workaround

@soupdiver
Copy link
Contributor Author

agree @magik6k

@bonedaddy
Copy link
Contributor

#91 Should fix your issue. Before the PR is merged if you are in dire need of this functionality I have a forked go-ipfs-api branch https://github.com/RTradeLtd/go-ipfs-api

@soupdiver
Copy link
Contributor Author

@postables thanks for the hint
Tt seems there is nothing that stops your PR from being merged anymore. So I maybe can avoid changing deps :)

@soupdiver
Copy link
Contributor Author

@magik6k this can be closed since #91 merged now I guess?

@magik6k magik6k closed this as completed Jul 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

4 participants