gochain / gofs

GoFS - GoChain FileSystem tools and documentation.
https://gofs.io
11 stars 3 forks source link

Add to docs to set cid-version if using regular ipfs client #6

Open treeder opened 5 years ago

treeder commented 5 years ago

User can add files using --cid-version 1 flag on add, eg:

ipfs add --cid-version 1 -r .
added zb2rhWpvkHi9XTH8JBbFRhxtA8weq28NDitoE28Yn2WuWVHxL hellocontract/Goodbye.abi
added zb2rhdWtBKCBcSC1Dk1G9pvNduPgyLG9q5dKt3iUVWSyxtJBb hellocontract/Goodbye.bin
added zb2rhWpvkHi9XTH8JBbFRhxtA8weq28NDitoE28Yn2WuWVHxL hellocontract/Hello.abi
added zb2rhiFh3TiS8c68LXYRzeZZHVBGNyDF8B8cNMfz8tPnq4fGp hellocontract/Hello.bin
added zb2rhbMEihhirTwQMgtQgbBDwZNYq63kZYaQThGhoqm3VCXvk hellocontract/goodbye.sol
added zb2rhi1n8MxSWBDZKSz9MB3PCRufDHNjDr2jamL2bczGD31ih hellocontract/hello.sol
added zdj7Wby448YUUqwVrqpGvVqCoXzKm81kwCXz59mh5yWgomtUC hellocontract
jmank88 commented 5 years ago

--raw-leaves is actually the necessary option, and v1 is implied.

treeder commented 5 years ago

That doesn't seem to be right, uses old one for the root.

 ipfs add --raw-leaves -r .
added zb2rhWpvkHi9XTH8JBbFRhxtA8weq28NDitoE28Yn2WuWVHxL hellocontract/Goodbye.abi
added zb2rhdWtBKCBcSC1Dk1G9pvNduPgyLG9q5dKt3iUVWSyxtJBb hellocontract/Goodbye.bin
added zb2rhWpvkHi9XTH8JBbFRhxtA8weq28NDitoE28Yn2WuWVHxL hellocontract/Hello.abi
added zb2rhiFh3TiS8c68LXYRzeZZHVBGNyDF8B8cNMfz8tPnq4fGp hellocontract/Hello.bin
added zb2rhbMEihhirTwQMgtQgbBDwZNYq63kZYaQThGhoqm3VCXvk hellocontract/goodbye.sol
added zb2rhi1n8MxSWBDZKSz9MB3PCRufDHNjDr2jamL2bczGD31ih hellocontract/hello.sol
added QmUsoghUd1NLd9XtYBYDLRhRhYva3PnQ7kkF2HaqsNCzJG hellocontract
jmank88 commented 5 years ago

That conflicts with docs I've read in multiple places, but I don't fully understand how raw leaves works. It may treat directories differently, or this could be a bug.

treeder commented 5 years ago

cid-version has correct behavior, so might as well just use that.

jmank88 commented 5 years ago

From the code it looks like v1 forces raw-leaves anyways, so that should be fine.