sloev / gundb_torrent_signalling

6 stars 2 forks source link

Consider using bt dht #2

Open sloev opened 7 months ago

sloev commented 7 months ago

Maybe using https://github.com/ducksandgoats/bittorrent-relay

ducksandgoats commented 7 months ago

i updated the readme.

i checked the code in the gundb torrent signalling repo. essentially, you uses trystero to connect to other gundb users and then proxy that connection to gundb itself. do i understand it correctly?

bittorrent-relay creates a swarm of trackers, so trystero can still be used, it would just connect to a tracker created by bittorrent-relay (this tracker will be part of a bigger swarm of trackers). the trackers in the trackerUrls property in https://github.com/sloev/gundb_torrent_signalling/blob/master/src/config.json will be a tracker that is part of a swarm of trackers using bittorrent-relay.

you can also host a gundb peer along side the tracker which might make it possible to skip webrtc/trystero in some instances or using it as a fall back, we would pass it as an option such as the following:

const BitorrentRelay = require('bittorrent-relay')

const btRelay = new BittorrentRelay({domain: 'hostOrIP', dhtPort: 0000, trackerPort: 0000, services: {gun: {port: 0001}}})

btRelay.start()

so there are multiple ways you can connect gundb peers using this kind of package.