harddrive party
This allows two or more peers to share files. Peers can choose directories to share, and a swarm 'topic' name to meet at.
Peer discovery, NOISE handshaking and stream encryption is done by hyperswarm.
Remote file metadata is cached locally in memory.
Design goals:
- Minimal setup - do not need to wait to hash files for the index.
- Can be used with large media collections
- Remote control via ws / http interface. Can be run on an ARM device or NAS and controlled from another computer.
Protocol
The wire protocol consists of request / response messages of 3 main types:
- A
handshake
message at the beginning of each connection. ls
messages which query the remote file system for filenames.read
messages which read a file, or a portion of a file.
All messages have a 32 bit id
and related messages share the same id.
There is also an endResponse
signal which indicates that no more related messages with a particular id will be sent.
Usage
Requires node >= 14. Tested with 14.17.5
All options can be given either as command line options, specified in a TOML configuration file at ~/.hdp/config.toml
, or set with the web interface.
shares
- one or more directories containing media to sharejoin
- topic name to join - you will connect to peers who enter the same name
Example command line usage:
./cli.js start --join someplace --shares '/home/me/media'
Example configuration file:
shares = [
"/home/me/music",
"/home/me/film"
]
join = "someplace"
Roadmap
- LRU Cache
- Timeout
Search
- Search peers concurrently
- Stream large search results
- Cache index of own files
- Report directory sizes
Shares
- report homedir to UI
- report full local path to UI
- Allow runtime adding/removing of share dirs
- Automatically share download dir
- Mechanism to update changes in share dirs
- Serve shared files over http
Transfers
- Local download
- [wip] Remote queueing
- Local queueing
- Graceful restart download on reconnect / restart
- Recursive directory download
- Report uploads to UI
- Persistent representation of downloaded files (db)
- Serve downloaded files over http
Swarming
- Capability verification
- Avoid joining swarms already joined?
- Correctly report joined swarms on startup