Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

js-ipfs-api not compatible with the new go-ipfs name system (with multiple keys) #582

Closed
ReisenB opened this issue Aug 5, 2017 · 2 comments

Comments

@ReisenB
Copy link

ReisenB commented Aug 5, 2017

Recently go-ipfs got a cool upgrade where the daemon could maintain more than one IPNS address, and in my experience it seems to work quite well. However, js-ipfs-api does not yet support this new feature, and only has bindings for the old resolve and publish functions without allowing for the selection/creation of a different key.

@ReisenB
Copy link
Author

ReisenB commented Aug 20, 2017

I eventually got around to poking into the code and realize I was wrong: it does in fact support this already, it's just not documented in the examples.

Here's how you generate a key:

ipfs.key.gen('MyNewKey', {type: 'rsa', size: '2048'}, (err, resp) => {
  if (err)
    console.log(err);
  console.log(resp);
});

And here's how you publish something to it:

ipfs.name.publish('/ipfs/Qmaaabbbcccblahblah', {key: 'MyNewKey'}, (err, resp) => {
  if (err)
    console.log(err);
  console.log(resp);
});

@daviddias
Copy link
Contributor

HI @ReisenB, mind writing an example on how to do this?

Thank you for being a trooper and figuring it out :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants