Skip to content

File/Folder sharing

Christopher Schinnerl requested to merge file-sharing into master

MERGE REQUEST

Overview

This MR adds the code @DavidVorick and I have been working on at ETHBerlin. It enables file sharing by exporting an archive of the files which should be shared. This archive can be imported by another renter. It's similar to backups but the difference is that individual files and folders can be exported and that the renter knows to form contracts with the hosts contained within the siafile's hostpubkeytable.

Changes to Work Flow

2 new endpoints:

  • renter/share/send -> export file/folder
  • renter/share/receive -> import file/folder

The public key table of the Siafile which stores the host keys now contains a Shared field. That way we can differentiate between two pieces which were uploaded to the same host but to different contracts. Pieces uploaded to shared hosts will not count towards redundancy, therefore the repair code will start to copy a shared file into our own contracts as soon as it is imported.

Testing Changes

TestFileSharing TestMarkHostsSahred

Documentation Changes

README was updated API docs were updated

Modules and Packages Impacted

modules/renter, modules/renter/siafile, node/api, node/api/client, modules/renter/contractor

Example for Visual changes (ie Screenshot)

N/A

Issues Closed

N/A

Checklist

Review and complete the checklist to ensure that the MR is complete before assigned to an approver.

  • Pipeline Passing (this is for NDFs where tests were run in a loop)
  • All new methods, or updating methods have clear docstrings
  • Testing added or updated for new methods
  • API documentation updated for API updates
  • Module README.md updated for changes to work flow
  • Issue added to Sia-UI repo for new supporting features
Edited by Christopher Schinnerl

Merge request reports