0

I am trying to create directory and put them files using go-mfs. After creating my folder I need to share it on IPFS to allow other nodes write there new files

err:= mfs.Mkdir(node,"inbox",opts)

if err != nil {
  panic(err)
}

So I am creating a folder and can get hash Qm...... . But I can not share it on IPFS

Note: My IPFS netowrk is private

  • Can you clarify why you cannot share it? Do you mean that an error occurred when you tried to share? Or that you shared it but could not find it? Also, it would be easier to help if you can provide a bigger code example that shows the whole flow that you are attempting. That way, someone could try to reproduce using the public network. – Dietrich Ayala Apr 22 '19 at 17:57

1 Answers1

1

Khazar, you will have to do the equivalent of using the ipfs files cp command with: ipfs files cp <the hash you got> <the path you want to copy that file into your mfs directory tree

Note that MFS does not support automatic syncing (although it is in discussion https://github.com/ipfs/specs/issues/174), so each time you do an update in one of the nodes, you will have to manually sync by performing the ipfs files cp.

David Dias
  • 1,792
  • 3
  • 16
  • 28