Skip to content

Improve documentaion for the seeder command #466

@josecelano

Description

@josecelano

Relates to: #453

There is a new command that allows you to upload random torrents to the Index.

For example, you can add torrents to the live demo with:

cargo run --bin seeder -- --api-base-url "index.torrust-demo.com/api" --number-of-torrents 2419200 --user admin --password xxxxxxxxxxxx --interval 1

That command would upload new 2419200 torrents using the admin account and wait for 1 second between uploads.

The torrent meta info is generated directly without creating the contents file. I did not include instructions on generating the same torrent and its contents manually. For example, it could be useful for testing purposes if you want to seed the torrent contents with a BitTorrent client.

If you want to generate the content you need to do this:

cd /tmp
mkdir test_torrents
cd test_torrents
echo $'1fd827fb-29dc-47bd-b116-bf96f6466e65' > file-1fd827fb-29dc-47bd-b116-bf96f6466e65.txt
imdl torrent create file-1fd827fb-29dc-47bd-b116-bf96f6466e65.txt 
imdl torrent show file-1fd827fb-29dc-47bd-b116-bf96f6466e65.txt.torrent 

Command to create the contents (a text file):

echo $'1fd827fb-29dc-47bd-b116-bf96f6466e65' > file-1fd827fb-29dc-47bd-b116-bf96f6466e65.txt

Command to create the torrent file using imdl:

$ imdl torrent create file-1fd827fb-29dc-47bd-b116-bf96f6466e65.txt 
[1/3] 🧿 Searching `file-1fd827fb-29dc-47bd-b116-bf96f6466e65.txt` for files…
[2/3] 🧮 Hashing pieces…
[3/3] 💾 Writing metainfo to `file-1fd827fb-29dc-47bd-b116-bf96f6466e65.txt.torrent`…
✨✨ Done! ✨✨

Command to show the torrent info using imdl:

$ imdl torrent show file-1fd827fb-29dc-47bd-b116-bf96f6466e65.txt.torrent
         Name  file-1fd827fb-29dc-47bd-b116-bf96f6466e65.txt
Creation Date  2024-02-07 12:47:32 UTC
   Created By  imdl/0.1.13
    Info Hash  c8cf845e9771013b5c0e022cb1fc1feebdb24b66
 Torrent Size  201 bytes
 Content Size  37 bytes
      Private  no
   Piece Size  16 KiB
  Piece Count  1
   File Count  1
        Files  file-1fd827fb-29dc-47bd-b116-bf96f6466e65.txt

Torrent on the live demo: https://index.torrust-demo.com/torrent/c8cf845e9771013b5c0e022cb1fc1feebdb24b66

We should add this to the command docs.

This is the torrent (in json) of the manually generated torrent by using imdl:

{
   "created by": "imdl/0.1.13",
   "creation date": 1707304810,
   "encoding": "UTF-8",
   "info": {
      "length": 37,
      "name": "file-1fd827fb-29dc-47bd-b116-bf96f6466e65.txt",
      "piece length": 16384,
      "pieces": "<hex>E2 11 4F 69 79 50 1E CC F6 32 91 A5 12 FA D5 6B 49 20 12 D3</hex>"
   }
}

This is the torrent (in json) of the downloaded torrent from the live demo:

{
   "announce": "udp://tracker.torrust-demo.com:6969/k24qT2KgWFh9d5e1iHSJ9kOwfK45fH4V",
   "announce-list": [
      [
         "udp://tracker.torrust-demo.com:6969/k24qT2KgWFh9d5e1iHSJ9kOwfK45fH4V"
      ]
   ],
   "info": {
      "length": 37,
      "name": "file-1fd827fb-29dc-47bd-b116-bf96f6466e65.txt",
      "piece length": 16384,
      "pieces": "<hex>E2 11 4F 69 79 50 1E CC F6 32 91 A5 12 FA D5 6B 49 20 12 D3</hex>"
   }
}

As you can see the info dict is the same producing the same infohash (c8cf845e9771013b5c0e022cb1fc1feebdb24b66).

The online service used to generated the JSON representation: https://chocobo1.github.io/bencode_online/

Metadata

Metadata

Assignees

No one assigned

    Labels

    - Developer -Torrust Improvement ExperienceDocumentationImproves Instructions, Guides, and Notices

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions