A (backwards compatible) replacement of WebTorrent integrating the Hydrafiles and BitTorrent/WebTorrent P2P networks.
HydraTorrent wraps WebTorrent, hooking into certain methods enabling Hydrafiles functionality.
Some enhancements this integration would make possible include:
- Torrent Privacy: Leechers and Seeders gain plausible deniability over their involvement with any specific Torrent.
Improves Torrent Network Health(Finished): Seeders can opt into donating storage to keep less popular torrents alive with any spare storage they have.Torrent Indexing(Finished): Clients exchange metadata about individual files allowing nodes to build a searchable index of files in the network.Find Similar Torrents(Finished): If leeching a dead torrent, client automatically find other infohashes in index that contain the same file.- Webseeds (Half Finished): Clients can optionally act as webseeds,
with known Hydrafiles peers automatically added as webseeds on all torrents.
HydraTorrent extends WebTorrent, with no breaking changes to existing APIs. This allows existing codebases to use HydraTorrent by replacing only 2 lines.
HydraTorrent is under heavy development and not production ready.
import WebTorrent from 'webtorrent'
const client = new WebTorrent()
client.seed('08ada5a7a6183aae1e09d831df6748d566095a10')
import HydraTorrent from 'hydratorrent'
const client = new HydraTorrent()
client.seed('08ada5a7a6183aae1e09d831df6748d566095a10')
A second object can optionally be passed, defining custom Hydrafiles config.
const client = new HydraTorrent({ /* WebTorrent Config */ }, { /* Hydrafiles Config */ })
A Hydrafiles
object is accessible on the HydraTorrent class. This can be used to directly interact with the Hydrafiles network.
const client = new HydraTorrent()
const hydrafilesClient = client.Hydrafiles
const client = new HydraTorrent()
const files = await client.search({ where: { name: 'i-am-spartacus-its-me.gif' } })
- Creates
new Hydrafiles()
- Runs
hydrafiles.nodes.getNodes()
and adds all nodes as webseeds usingtorrent.addWebSeed()
- Runs
hydrafiles.search()
to find all SHA256 files for infohash and adds all nodes as webseeds usingtorrent.addWebSeed()
- Runs
hydrafiles.search()
to find all infohashes for SHA256 and adds all nodes as webseeds usingtorrent.addWebSeed()
Planned:
- Run
hydrafiles.FileHandler.getFile()
and pipe to torrent to eventually removetorrent.addWebSeed()
hook calls (and movehydrafiles.search()
logic to Hydrafiles lib)
Planned:
- Run
hydrafiles.FileHandler.cacheFile()