Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sloev/gundb_torrent_signalling
https://github.com/sloev/gundb_torrent_signalling
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sloev/gundb_torrent_signalling
- Owner: sloev
- Created: 2024-02-04T14:54:26.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-02-05T16:00:12.000Z (11 months ago)
- Last Synced: 2024-10-03T10:31:48.981Z (3 months ago)
- Language: JavaScript
- Size: 971 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gundb torrent signalling example
an example on how to solve the problem of webrtc signalling for gundb by the use of a websocket proxy, heavily inspired by Dletta 2021 and https://github.com/Dletta/dht-proxy/blob/main/websocketproxy.js
## what it uses:
* [gundb](https://github.com/amark/gun)
* [trystero](https://github.com/dmotz/trystero) (webrtc signalling using webtorrent signalling)
* vanjs (for frontent ui)## how it works:
0. setup a private webtorrent tracker on a public url1. an infohash is generated for app_id: 'gundb_torrent_signalling_test' and room_id: 'test'
```
> npm run create_info_hash gundb_torrent_signalling_test test
3665367962366f34703164316e32353666357733
```
2. a config.json is created:
```json
{
"infoHashHex": "3665367962366f34703164316e32353666357733",
"appId": "gundb_torrent_signalling_test",
"roomName": "test",
"trackerUrls":["wss://tracker.com"]
}
```
3. a set of public and private credentials for the app is created, resulting in creds.client.json and creds.server.json
```
> npm run create_root_key
```
4. db is initialized with config.json and creds (this initializes the proxy and thereby the trystero webtorrent signalling)
```js
const db = setupDb(config, creds)
```
5. edit [bin/tracker.js](bin/tracker.js) so that it has your infohash in the whitelist
6. run your private tracker on a public ip: `npm run tracker`from here on the db is ready and will maintain its webrtc connections without bothering gundb