Torrentfs
Torrentfs is a elastic file system, you can pull or push any files by following torrentfs protocol anywhere, anytime
Install (ubuntu & centos)
go install github.com/CortexFoundation/torrentfs/cmd/torrent@latest
Import
go get github.com/CortexFoundation/torrentfs
How to use
https://github.com/CortexFoundation/torrentfs.git
cd torrentfs
make
Create torrent file by 4k pieces
./build/bin/torrent-create workspace/data -p=4096 > workspace/test-torrent
Load info hash from torrent file
./build/bin/torrent-magnet < workspace/test-torrent
magnet:?xt=urn:btih:9196320d998fdab966bcb3a08f3f087e1f993c12&dn=data&tr=udp%3A%2F%2Ftracker.cortexlabs.ai%3A5008
Seed file to dht
mkdir -p mnt/9196320d998fdab966bcb3a08f3f087e1f993c12/data
cp workspace/test-torrent mnt/9196320d998fdab966bcb3a08f3f087e1f993c12/torrent
cp -r workspace/data/* mnt/9196320d998fdab966bcb3a08f3f087e1f993c12/data
./build/bin/seeding -dataDir=mnt
Download file
./build/bin/torrent download 'infohash:9196320d998fdab966bcb3a08f3f087e1f993c12'