skynet-nodejs. Any file over 40MB will automatically use the built-in tus upload client.
locationheader where PATCH requests are made. It should address a specific folder and have an upload identifier like this:
locationaddress mentioned above. The response should have a
skynet-skylinkheader containing the upload's skylink.
const TUS_CHUNK_SIZE = (1 << 22) * 10
Tus-Resumableheader set to the value of
Chris has written a full desciption of the tus protocol on Skynet, reproduced below.
chunkSize := (4MiB — encryptionOverhead) * fanoutDataPieces.By default, data uploaded to Skynet uses 10 data pieces for its fanout and Threefish for encryption which doesn’t have any overhead. As a result, the default chunk size is 40MiB. Since portals have limited amounts of RAM, they can’t keep these chunks in memory while waiting for users to resume their uploads. That’s why the chunk size specified in TUS needs to be a multiple of the Skynet chunk size. As long as they match, the portal can upload the chunks and free up memory while waiting for more data.