Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Give CLI users the option to wrap or NOT wrap with directory #101

Merged
merged 1 commit into from
Nov 16, 2021

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
Collaborator

@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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants