Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat(cli): check block hash consistency when listing blocks #157

Merged
merged 2 commits into from
Dec 8, 2023

Conversation

alanshaw
Copy link
Member

@alanshaw alanshaw commented Sep 30, 2023

Checks the block hash consistency when listing blocks in the CAR. Pass --no-verify to disable.

e.g.

$ ipfs-car blocks ciqaih44edpp6equhdeacnifzxpqfoyr425e3hjef2autya5ohuq5ty.car
bafk2bzaceb6ddglkmua3upv2hhapl5dhklkc27xggtmndq6nqmtfkoay54gbs
bafk2bzacedu4gpmt2aqhq5gznjdmz4anxf64l34heez67rllizb6izvuqzava
file:///Users/alan/Code/web3-storage/ipfs-car/node_modules/@web3-storage/car-block-validator/esm/src/index.js:52
    throw new Error('CID hash does not match bytes');
          ^

Error: CID hash does not match bytes
    at validateBlock (file:///Users/alan/Code/web3-storage/ipfs-car/node_modules/@web3-storage/car-block-validator/esm/src/index.js:52:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Module.blocksList (file:///Users/alan/Code/web3-storage/ipfs-car/cmd/blocks.js:16:7)

Node.js v20.6.0
$ ipfs-car blocks ciqaih44edpp6equhdeacnifzxpqfoyr425e3hjef2autya5ohuq5ty.car --no-verify
bafk2bzaceb6ddglkmua3upv2hhapl5dhklkc27xggtmndq6nqmtfkoay54gbs
bafk2bzacedu4gpmt2aqhq5gznjdmz4anxf64l34heez67rllizb6izvuqzava
bafk2bzaceda5oo2f5wmcwfmqbqkxzdwzszc2bhqnj4lpygliqna7bmbkmzwh4
bafk2bzacedffd2nthrjt6b5nmbsqge633f4qxcn75jijisgkbu6ibvmxa4cl6
bafk2bzacecwbz6go6hpg57dqvc6e3rj7zdwlnlx73d47oxocxw54wsoznfo54
bafk2bzacec4zqgvyniqp3g6q5vwvn4qceplxvzg3cxtxemkocfstdfnrqvlua
bafykbzacedaqcn32xa35ufzadu7sq2w4e2xmcvzvl4f2frjhabhb3tvdi3psq

Copy link
Contributor

@olizilla olizilla left a comment

Choose a reason for hiding this comment

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

@olizilla
Copy link
Contributor

olizilla commented Dec 6, 2023

you like to merge @alanshaw ?

@alanshaw alanshaw merged commit 273079f into main Dec 8, 2023
8 checks passed
@alanshaw alanshaw deleted the feat/check-block-hash-consistency-for-block-lists branch December 8, 2023 06:51
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