feat: support stream uploads to Synapse#428
feat: support stream uploads to Synapse#428SgtPooki merged 3 commits intofilecoin-project:masterfrom
Conversation
|
This looks pretty good, tightly scoped and solves the specific issue. There's one additional thing you could do with this @shrirajpawar4, you look in |
|
@shrirajpawar4 have a look at #287 which was a draft of a previous attempt and it does a few more things. I think the code might have moved on from that PR but it had a bit more, including streaming the temp car for But, if you'd prefer to land this one first and do a follow-up with the second batch we can do that; this is a decent start but it shouldn't be hard to go a bit further. |
|
Thanks @rvagg . I applied the README suggestion and updated I kept the broader |
SgtPooki
left a comment
There was a problem hiding this comment.
short and sweet, nice PR. Just a few things to touch up and i'm good with it.
|
@SgtPooki made changes ser. |
|
Approve this unblocks the streaming contract we need, thanks for the implementation! |
rvagg
left a comment
There was a problem hiding this comment.
lgtm but we'll just have to make sure t he linked issue stays open so we can track the other part of t his
|
@rvagg yes works, will close out the issue in next PR. |
Summary
addresses part of #325.
Adds
ReadableStream<Uint8Array>support to the shared Synapse upload helpers so callers with pre-generated CAR files can stream upload data without first loading the whole CAR into memory.Changes
SynapseUploadData = Uint8Array | ReadableStream<Uint8Array>uploadToSynapse()andexecuteUpload()to acceptSynapseUploadDatasynapse.storage.upload()without bufferingReadable.toWeb(createReadStream(...))Notes
This intentionally does not implement true CAR creation streaming from #288, and it does not add byte-level progress callbacks from #326. This PR only covers uploading an already-created CAR as a stream. Will create separet PR for #326
Testing