-
Notifications
You must be signed in to change notification settings - Fork 0
Reference
-
[Time-persistent file list](#Time-persistent file list) : All shared files and folders will be aggregated into one single file list
-
Sharing "in the cloud" : files are aggregated into a time-persistent multimedia library allowing video and audio streaming
-
Optimized sharing : chunks of data are distributed among the peers to improve the availability of the most wanted files
Description
All shared files and folders will be aggregated into one single file list, simultaneously stored by every connected peer.
- anyone knows what is shared in the network, even if content is offline
- users can ask their client software to download a file anytime, it will be downloaded as soon as it becomes available
The file list will consist in a SQL table with the following fields
field | type | description |
---|---|---|
id | unique identifier for the record | |
host | user id | user id of the client hosting the file |
path | string | path of the file in the user's folder |
file_hash | string | tree hash root of the file |
timestamp | datetime | date and time of the record |
signature | binary | authenticates the record with the user's public key |
Note
The hub stores the (user_id, public_key) pairs and should make these records available to the connected users
As a user connects to the hub, he needs to download a copy of the global file list from one of the connected users.
There are also several reasons why the global file list should be updated :
- a user added/removed files to/from his folder
- a user updated timestamps for his file records
- a new user logged into the network with new files
The hub keeps in memory an up-to-date tree structure of the online users, with the following pattern :
- each node represents one online user
- a node has one parent (the referer)
- a node has up to n children (n is defined as a hub setting).
When a user connects to the hub, he is given :
- the user id of his referer
- a hash representing the most recent version of the global file list
- the user should download the file list from his referer and compare its hash with the one given by the hub
When a user disconnects from the hub :
- the hub should update the tree structure trying to limit the changes
- the hub should give all concerned users their new referers
When a user updated his local copy of the list :
- He broadcasts the new hash value of the list
- The user tree root downloads the copy of the list, and each user connects to his referer to download the updated version of the list