ipfs-shipyard / gomobile-ipfs

IPFS and libp2p on Mobile, with Gomobile
Other
316 stars 64 forks source link

Download multiple large files at the same time, error reported:A/go/Seq: NewByteArray failed #117

Closed vcexnet closed 2 years ago

vcexnet commented 2 years ago

If you download multiple large files at the same time, gomobile-ipfs will report an error:A/go/Seq: NewByteArray failed

jefft0 commented 2 years ago

Hello @vcexnet . Can you be specific about the large files? How many files? What were their sizes?

vcexnet commented 2 years ago

@jefft0 Thank you very much for your reply. I have integrated gomobile-ipfs into my mobile app eactalk and would like to use the decentralized storage feature. But the problem I am currently facing is the inability to quickly cid address and download the cache locally. Especially for some large files. For example: https://ipfs.io/ipfs/Qmb12wBUaHVEwPGri7FptEv9Gd13K2eP3T4T5X4mbatNVT https://ipfs.io/ipfs/QmaYd1izQAr3t6fiiMCw7KmQXtKpUAmMLCvGtACKUHhPmQ

Also I don't understand the relationship between api and gateway, because my country can't access the gateway in ipfs gateway check, I need to use my own created gateway.

vcexnet commented 2 years ago

@jefft0 Download via stream, how to know the format of the file.

jefft0 commented 2 years ago

Are you streaming from an IPFS gateway using HTTP? It already sets the Content-Type.

vcexnet commented 2 years ago

Are you streaming from an IPFS gateway using HTTP? It already sets the Content-Type.

But there is no stream download method in the gomobile-ipfs library, how can I set up stream download?

jefft0 commented 2 years ago

Replying to your original question, the "cat" interface reads the entire file into memory. For large files this can cause an allocation in NewByteArray to fail. I am looking to see if gomobile-ipfs can support a streaming interface.

jefft0 commented 2 years ago

Hello @vcexnet . We are working on pull request #39 to implement a stream API. I would like to close this issue and you can track that pull request for progress. Does that sound good?

vcexnet commented 2 years ago

Thank you very much! @jefft0 .I would like to use your gomobile-ipfs inside my development application eactalk and would like to get your license.Close this issue

jefft0 commented 2 years ago

OK. Thank you. Closing this issue. If you have more questions, you can open another issue.