Skip to content

Conversation

@parkan
Copy link
Contributor

@parkan parkan commented Nov 15, 2021

It seems that there is some controversy on this subject (#57, #88, #89) -- I'm not sure on the finer points discussed, but in practice I need to emit a root CID without wrapping to match how my other DAGs are processed in estuary. The files come from a system that does not rely on fs level metadata (Internet Archive, file metadata is stored separately in an xml system) so I don't need the wrapper. I think threading this through gives users the flexibility to get the behavior they need.

$ ./dist/cjs/cli/cli.js --pack ../derive-car/test/item/ --output /tmp/item.car
root CID: bafybeidmfmezmxnhnx4pnolbqriolgivs3xqcecsw7lbaiytjwqb4hidr4
  output: /tmp/item.car
$ ipfs-car --list /tmp/item.car 
bafybeidmfmezmxnhnx4pnolbqriolgivs3xqcecsw7lbaiytjwqb4hidr4
bafybeidmfmezmxnhnx4pnolbqriolgivs3xqcecsw7lbaiytjwqb4hidr4/item
...
$ ./dist/cjs/cli/cli.js --wrapWithDirectory false --pack ../derive-car/test/item/ --output /tmp/item.car
root CID: bafybeiar5v44pavnjsnz3tzmgnamrl36sioeakcbndw3t52dvg3crwnogy
  output: /tmp/item.car
$ ipfs-car --list /tmp/item.car 
bafybeiar5v44pavnjsnz3tzmgnamrl36sioeakcbndw3t52dvg3crwnogy
...

The root CID in the second case matches my other tools' output.

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vasco-santos vasco-santos merged commit 65a32d4 into storacha:main Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants