kubo icon indicating copy to clipboard operation
kubo copied to clipboard

is that one super-powerful `ipfs.addAll` be possible?

Open tx0c opened this issue 3 years ago • 1 comments

is that one super-powerful ipfs.addAll be possible?

be able to add new files into the IPFS system, also add links to existing objects (with CID)

this is Javascript API, but need go-ipfs server side support first;

ipfs.addAll([
  { path: 'author-blog/index.html', content: 'top index content', },
  { path: 'author-blog/rss.xml', content: 'the updated top level rss', },
  { path: 'author-blog/new-post/index.html', content: 'the new blog post', },
  { path: 'author-blog/new-post/pic1.png', content: 'the new blog post's assets', },
  { path: 'author-blog/new-post/pic2.jpeg', content: 'the new blog post's assets', },

  // ... and can ipfs.addAll support add existing CIDs?
  { path: 'author-blog/previous-post', link: CID.parse('another-existing-cid-from-previous-publication') },
  { path: 'author-blog/previous-post2', link: CID.parse('more-existing-cids') },
  ...
])

Originally posted by @tx0c in https://github.com/ipfs/kubo/issues/9294#issuecomment-1255338281

tx0c avatar Sep 22 '22 17:09 tx0c

current alternative is:

  1. ipfs.addAll add all local files first,
  2. then call ipfs object patch add-link; (this is at least available)
  3. or wait #4782 ipfs dag patch ... which was opened in 2018 but not sure for how long can be ready?

tx0c avatar Sep 22 '22 17:09 tx0c