Command Palette

Search for a command to run...

Back to skills
skill № 39334

manual-udp-download-completion-e2e

Simulate a peer going from started to completed over UDP with tracker_client and the stats API. Use when checking that downloads increment, without the…

FreeNo executable scripts
torrustby torrust★ 539 GitHub stars

Install manual-udp-download-completion-e2e in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

Manual UDP Download-Completion E2E

Purpose

This skill verifies, manually and quickly, that a single peer transition from started to completed updates tracker state correctly:

  • seeders/leechers transition as expected
  • torrent completed/download count increments
  • global completed/download count increments

This workflow is a diagnostic complement to automated E2E (for example, qbittorrent_e2e_runner).

Prerequisites

Run commands from repository root.

  • Tracker config: ./share/default/config/tracker.development.sqlite3.toml
  • UDP tracker endpoint: 127.0.0.1:6969
  • Stats API endpoint: http://127.0.0.1:1212/api/v1/stats (send Authorization: Bearer MyAccessToken)

Optional (recommended for deterministic baseline):

rm -f ./storage/tracker/lib/database/sqlite3.db

1. Start tracker

In terminal A:

cargo run

Expected startup excerpt:

Loading extra configuration from default configuration file: `./share/default/config/tracker.development.sqlite3.toml` ...
... API: Started on: http://0.0.0.0:1212
... UDP TRACKER: Started on: udp://0.0.0.0:6969

2. Define test values

In terminal B:

INFO_HASH=1111111111111111111111111111111111111111
PEER_ID=ABCDEFGHIJKLMNOPQRST
TRACKER=127.0.0.1:6969
STATS_URL='http://127.0.0.1:1212/api/v1/stats'
AUTH='Authorization: Bearer MyAccessToken'

3. Capture baseline

3.1 Global stats

curl -s -H "$AUTH" "$STATS_URL"

Example output:

{"torrents":0,"seeders":0,"completed":0,"leechers":0,...}

3.2 Torrent-specific stats (scrape)

tracker_client writes JSON to stdout and refuses to run when stdout is a terminal (exit 2, a tty_refusal record on stderr), so the commands below pipe the output to jq. Pipe or redirect it the same way in your own commands.

cargo run -q -p torrust-tracker-client --bin tracker_client -- udp scrape "$TRACKER" "$INFO_HASH" | jq .

Example output:

{
  "Scrape": {
    "transaction_id": -214458979,
    "torrent_stats": [
      {
        "seeders": 0,
        "completed": 0,
        "leechers": 0
      }
    ]
  }
}

4. Send started announce

cargo run -q -p torrust-tracker-client --bin tracker_client -- udp announce \
  "$TRACKER" "$INFO_HASH" \
  --event started \
  --uploaded 0 \
  --downloaded 0 \
  --left 1000 \
  --port 6881 \
  --peer-id "$PEER_ID" \
  --key 1 \
  --peers-wanted 0 | jq .

Example output:

{
  "AnnounceIpv4": {
    "transaction_id": -888840697,
    "announce_interval": 120,
    "leechers": 1,
    "seeders": 0,
    "peers": []
  }
}

Verify after started:

cargo run -q -p torrust-tracker-client --bin tracker_client -- udp scrape "$TRACKER" "$INFO_HASH" | jq .
curl -s -H "$AUTH" "$STATS_URL"

Expected checks:

  • scrape leechers is 1
  • scrape seeders is 0
  • global leechers increased by 1
  • global completed unchanged

5. Send completed announce

cargo run -q -p torrust-tracker-client --bin tracker_client -- udp announce \
  "$TRACKER" "$INFO_HASH" \
  --event completed \
  --uploaded 0 \
  --downloaded 1000 \
  --left 0 \
  --port 6881 \
  --peer-id "$PEER_ID" \
  --key 1 \
  --peers-wanted 0 | jq .

Example output:

{
  "AnnounceIpv4": {
    "transaction_id": -888840697,
    "announce_interval": 120,
    "leechers": 0,
    "seeders": 1,
    "peers": []
  }
}

Verify after completed:

cargo run -q -p torrust-tracker-client --bin tracker_client -- udp scrape "$TRACKER" "$INFO_HASH" | jq .
curl -s -H "$AUTH" "$STATS_URL"

Expected checks:

  • scrape seeders changed 0 -> 1
  • scrape completed changed 0 -> 1
  • scrape leechers changed 1 -> 0
  • global seeders increased by 1
  • global completed increased by 1

6. Optional output formatting with jq (human-friendly)

If jq is available, use these helpers:

curl -s -H "$AUTH" "$STATS_URL" | jq '{torrents, seeders, completed, leechers}'

cargo run -q -p torrust-tracker-client --bin tracker_client -- udp scrape "$TRACKER" "$INFO_HASH" \
  | jq '.Scrape.torrent_stats[0]'

Troubleshooting

  • Peer ID must be exactly 20 bytes.
  • Use a fresh INFO_HASH to avoid contamination from previous runs.
  • If baseline numbers are non-zero, either reset SQLite DB or compare deltas instead of absolute values.
  • Confirm tracker/API are listening on 6969/udp and 1212/tcp.

Related

  • Automated E2E runner: src/bin/qbittorrent_e2e_runner.rs
  • Local tracker run workflow: .claude/skills/run-tracker-locally/SKILL.md
Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the manual-udp-download-completion-e2e skill do?

Simulate a peer going from started to completed over UDP with tracker_client and the stats API. Use when checking that downloads increment, without the qBittorrent E2E.

How do I install the manual-udp-download-completion-e2e skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the manual-udp-download-completion-e2e skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare manual-udp-download-completion-e2e with