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

invalid payload data integrity hash #537

Closed
HelloRickey opened this issue May 2, 2024 · 2 comments
Closed

invalid payload data integrity hash #537

HelloRickey opened this issue May 2, 2024 · 2 comments

Comments

@HelloRickey
Copy link

HelloRickey commented May 2, 2024

SDK version:
"@bnb-chain/greenfield-js-sdk": "^2.0.0",
"@bnb-chain/reed-solomon": "^1.1.3",

Environment:

  • OS (e.g. from /etc/os-release): mac
  • Install tools:
  • Others:node v18.0.0

What happened:

I found that greenfield-js-sdk has a problem when uploading json files to Object. Only json files have this problem, other files are normal

I use this method to build https://github.com/bnb-chain/greenfield-js-sdk/tree/main/packages/reed-solomon#nodejs

const { ReedSolomon } = require('@bnb-chain/reed-solomon') const rs = new ReedSolomon(); const res = await rs.encode(Uint8Array.from(fileBuffer));

When I upload Object, it will prompt me
{ code: '110004', message: 'invalid payload data integrity hash', statusCode: 406 }
https://github.com/HelloRickey/greenfield-test/blob/main/index.js#L97

But when I use Nodejs (worker_threads)
it will succeed
https://github.com/HelloRickey/greenfield-test/blob/main/index.js#L21

@rrr523
Copy link
Collaborator

rrr523 commented May 2, 2024

Sorry, we didn't update the example in time.

After 2.x, we don't need to compute hashes anymore, just use delegateUploadObject : https://github.com/bnb-chain/greenfield-js-sdk/blob/main/packages/js-sdk/tests/upload.spec.ts#L26

ref PR: #500

@rrr523 rrr523 closed this as completed May 2, 2024
@HelloRickey
Copy link
Author

Hey @rrr523 , I use delegateUploadObject, but it still doesn't work for json files and prompts new problems.
#539

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

No branches or pull requests

2 participants