Some general feedback for archive/file APIs. They’re good for simple integrations, but a bit limited for more complex use cases. Some thoughts below:
- Add a call to calculate and return XOR addresses, rather than having to wait until an upload is completed. This prevents async upload calls, which due to upload speed, would be very useful. As these can be derived up front, they could be returned to the app and/or the user immediately, while upload is processed in the background.
- Expose lower level calls to retrieve chunks in memory, rather saving files to disk first. In many cases we want to pipe that data immediately into another routine. Having to persist the whole file to disk blocks until that operation is complete - the larger the files, the worse the pain. Exposing a finer grained function that provides data to a buffer chunk by chunk would be very useful and could be re-used by the disk saving version too.
- Like the above, but for uploads. Not sure if possible with self-encryption, but persisting a file to disk, then uploading it, may just be an overhead in some/many cases.
- Async calls could be useful too, where the call returns a handle to check status on in some way. Relates to 1 (and that would be higher in priority), but may help the dev experience if this stuff was built in.
- Sleep the autonomi client when not in use or have a mechanism to make it sleep. It is nice to have a long running instance, so we don’t need to keep bootstrapping new ones, but it would be nice to tell it to sleep after prolonged idle, to save power and bandwidth.
For AntTP, the upload/download/async use cases are fairly obvious - as a proxy, it wants to shuttle data to/from the network. It also doesn’t want to sit blocking on POSTs, as clients will timeout.
Streaming music/videos/other both uploads and downloads (latter is the priority) is key too, as you don’t want to wait for AntTP to download the file in full, to disk, then start sending the beginning of it to the client - it should do that as soon an AntTP has the first chunk.
As a proxy, AntTP may spend extended periods idle too. Allowing the client to sleep would be a help here.
Hope that helps!