git-remote-ipld icon indicating copy to clipboard operation
git-remote-ipld copied to clipboard

IPNS helper

Open magik6k opened this issue 8 years ago • 12 comments

See https://github.com/magik6k/git-remote-ipld/issues/3#issuecomment-340269048

magik6k avatar Oct 29 '17 15:10 magik6k

@magik6k what else needs to be done to get the IPNS helper working?

dirkmc avatar Apr 17 '18 19:04 dirkmc

2 most significant things:

  • [ ] Publish to IPNS, integrate with keystore nicely (ipns helper currently returns unixfs tree the ipns record should point at)
  • [ ] Implement some mechanism to map large git objects (> 1mb) to ipfs files (see https://github.com/ipfs/go-ipld-git/issues/18 (4.)).

magik6k avatar Apr 17 '18 22:04 magik6k

When you say "integrate with keystore nicely" do you mean that when pushing the first time, the IPNS git helper should create a new key in the key store, and associate the unixfs tree with that key in IPNS?

dirkmc avatar Apr 18 '18 15:04 dirkmc

maybe not 'associate the unixfs tree', but something like:

git [push/pull] ipns::keystoreKeyName should work. Integrating with dnslinks would be a nice feature too (we'd need to resolve first to see if the dnslink resolves to /ipns name and then see if we have a key for that name in the keystore)

magik6k avatar Apr 18 '18 16:04 magik6k

push should also print ipns::QmKey like it currently does with the ipld helper

magik6k avatar Apr 18 '18 16:04 magik6k

Currently it prints the IPFS hash of the patched object with an ipns:: prefix, eg Pushed to IPFS as ipns::Qmeue... Do you think it would make sense to instead update the IPNS key to point to this IPFS key and print Pushed to IPFS as /ipfs/Qmeue... Updated IPNS key /ipns/QmIPNSKey to point to /ipfs/Qmeue...

dirkmc avatar Apr 18 '18 19:04 dirkmc

We could print both, but it might be confusing for some users. I'd keep the ipns:: prefix as it allows for easier copy-paste, and only print ipns key to not confuse users unfamiliar with ipfs.

magik6k avatar Apr 18 '18 19:04 magik6k

Ok so I'm imagining that the user would do one of the following:

  • git push --set-upstream ipns::/ipns/QmIPNSkey branchname
  • git push --set-upstream ipns:: branchname In the second case the ipns helper would mint an ipns key for the user

At the end it would print Pushed to IPFS as ipns::/ipns/QmIPNSkey...

Does that sound right?

dirkmc avatar Apr 18 '18 20:04 dirkmc

Yep, that's about right. We might also want to store mapping between branches and keys in the tracker

magik6k avatar Apr 19 '18 10:04 magik6k

It seems like there is a bug in go-ipfs-api ipns name publish so I will wait till you have completed the work on core API

dirkmc avatar Apr 23 '18 02:04 dirkmc

Think we can move forward on this now?

Arlodotexe avatar Jun 28 '23 19:06 Arlodotexe

I thought this doesn't really work?

Unless I did something wrong when I was trying to use it - https://gist.github.com/mainiak/03f202480405affca3fd80dd8f6a7008

mainiak avatar Jun 29 '23 03:06 mainiak