Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a seeder #6077

Merged
merged 3 commits into from
May 17, 2021
Merged

Add a seeder #6077

merged 3 commits into from
May 17, 2021

Conversation

drew2a
Copy link
Collaborator

@drew2a drew2a commented Apr 26, 2021

This PR introduces scripts for easily set up a seedbox (for propagating data to Tribler's network).

image
image

Linked to #21

The seedbox consists of two parts:

  1. Torrent seeding (by using a LibTorrent protocol)
  2. Channel disseminating (by using the Tribler network)

Prerequisites

  1. Clone the tribler repo include sub modules:
    git clone --recursive https://github.com/Tribler/tribler.git
  2. Install requirements:
    python3 -m pip install -r requirements.txt 
  3. Add necessary folders to PYTHONPATH (below the bash example)
    export PYTHONPATH=${PYTHONPATH}:`echo .. ../src/{pyipv8,tribler-common,tribler-core} | tr " " :`

Torrent seeding

To start torrents' seeding run the following script:

python3 seeder.py <source folder>

Consider the following folder structure:

source folder
├ sub_directory
| ├ file1
| └file2
├ sub_directory2
| ├ file3
| └ file4
├ thumbnail.png
└ description.md

In this particular example, seeder.py will create two torrents:
sub_directory.torrent and sub_directory2.torrent.

seeder.py will start to seed them through BitTorrent protocol after creating.

Data disseminating

To start disseminating data through Tribler's network run the following script:

python3 disseminator.py <source folder>

This script will create a channel and will disseminate it to Tribler.

Consider the following folder structure:

source folder
├ sub_directory.torrent
├ sub_directory2.torrent
├ thumbnail.png
└ description.md

Above you can see two "special" files:

  • thumbnail.png
  • description.md

The channel will be created with description based on these files.
As the channel name, the source folder's name will be used.

Error reporting

In case you want errors to be reported, you can use Sentry

To enable error reporting, specify the following environment variable:

export SENTRY_URL=<sentry_url>

URL can be taken directly from a corresponding Sentry project.

Generate test data

The following script generates 1GB dataset divided into 1024 folders:

python3 generate_test_data.py -d /tmp/test_data  

References:

@drew2a drew2a changed the title WIP: Add a seeder Add a seeder Apr 28, 2021
Copy link
Contributor

@ichorid ichorid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please move the seeder dir into either the src dir or experiments dir?

It is better to keep the toplevel structure of the project repository clean, if possible.

ichorid
ichorid previously approved these changes May 3, 2021
@sonarcloud
Copy link

sonarcloud bot commented May 17, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@drew2a drew2a requested a review from ichorid May 17, 2021 10:59
@drew2a drew2a merged commit 52bbf04 into Tribler:main May 17, 2021
@drew2a drew2a deleted the feature/seeder branch May 17, 2021 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants