silverstream/README.md
Casper V. Kristensen 49eb78d5c0
Publish.
2019-04-19 02:33:31 +02:00

76 lines
3.2 KiB
Markdown

# Silverstream: *A fully decentralised music streaming platform*
## Installation
Silverstream requires Python 3.7+ with the `libtorrent` library, as well as the `libmpv1` package from your local
package repository. The dependencies can be installed from the Debian repositories:
```bash
sudo apt install -y python3.7 python3-libtorrent libmpv1
```
**Or** from source:
```bash
# Python 3.7 (https://docs.python.org/3/using/unix.html#building-python)
sudo apt build-dep -y python3
wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
tar xf Python-3.7.1.tgz
cd Python-3.7.1
./configure --enable-optimizations
make -j$(nproc)
sudo make altinstall
# Libtorrent (https://dev.deluge-torrent.org/wiki/Building/libtorrent)
sudo apt build-dep -y libtorrent-rasterbar
wget https://github.com/arvidn/libtorrent/releases/download/libtorrent_1_1_11/libtorrent-rasterbar-1.1.11.tar.gz
tar xf libtorrent-rasterbar-1.1.11.tar.gz
cd libtorrent-rasterbar-1.1.11/
PYTHON=$(which python3.7) ./configure --enable-python-binding --with-libiconv --disable-debug
make -j$(nproc)
sudo make install
sudo ldconfig
```
The libtorrent version from the Debian repository doesnt't seem to play nicely with Python 3.7, so please **check the
installation**:
```bash
python3.7 -c "import libtorrent; print(libtorrent.version)"
```
After installing the dependencies, the application can be installed using pip:
```bash
python3.7 -m pip install --upgrade https://git.caspervk.net/caspervk/silverstream/archive/master.tar.gz
```
## Usage
The program can be started by running `silverstream` or `python3.7 -m silverstream`, depending on system configuration.
```text
usage: silverstream [-h] [--interface interface] [--port port] [--load] [--stats] [-v] [--clean] [--crawler-nodes nodes]
[--crawler-delay seconds] [--crawler-await-bootstrap] [--indexer-workers workers]
[--indexer-save-torrents] [--btdht-seed host:port]
optional arguments:
-h, --help show this help message and exit
--interface interface Network interface to bind to. (default: 0.0.0.0)
--port port Network port to listen listen on. Ports are bound consecutively from this port.
(default: 6881)
--load Load state from file (use 'save' from the cli to save).
--stats Save statistics to file.
-v, --verbose Increase verbosity level. Can be used multiple times.
--clean Remove data directory.
Crawler:
--crawler-nodes nodes Number of BitTorrent DHT nodes to start. (default: 32)
--crawler-delay seconds Number of seconds to wait between starting each of the BitTorrent DHT nodes. (default: 1)
--crawler-await-bootstrap Wait for nodes to fully bootstrap before starting the next one.
Indexer:
--indexer-workers workers Number of Indexer workers to start. (default: 25)
--indexer-save-torrents Save indexed torrents to torrents/.
BitTorrent DHT:
--btdht-seed host:port BitTorrent DHT seed nodes. Overrides default seeds. Can be specified multiple times.
```
You may need to open some ports in your firewall. This command will allow a crawler with 128 nodes on UFW:
```bash
ufw allow 6881:7009/udp comment "silverstream"
```