Skip to content

add /renter/read and /renter/write APIs

Boris Nagaev requested to merge starius:ll-io2 into master

This is the beginning of efforts to expose lowlevel renter features (uploading and downloading a single block) in the API.

Proof of concept example: https://gist.github.com/51c4a6116aed791147a2744d6cb290fa File exchange site for files <4MB storing files directly in Sia without replication and/or encryption. A file can be fetched using URL of format site/contract_id/sector_root.

Running instance with 3 contracts to real Sia hosts: http://redjohn.tk:4499/ This image is fed directly from Sia: http://redjohn.tk:4499/9bb5c0c456ecee0efb2d5179e37224586d4c04a00f2d26c5033bdf4c5bea83c9/f9144c418f516648295b6015454c2dce1b63755dc59327119238d874ed6dd002/cluster.png

(Two of three hosts are distant from the site and fetching a file from them takes 5 seconds, but third host is close (5ms ping) and the image is fetched in 1.2s. A random host is chosen to upload a file, so I did it multiple time to get fast URL.)

There is a large room for improvement (e.g. add RS, store primary blocks in close hosts and erasure codes on distant hosts; add encryption, support larger files, pack multiple small files to a single sector, download only needed part of a sector, produce shorter links, ...).

Merge request reports