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…
by 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
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(sendAuthorization: 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_clientwrites JSON to stdout and refuses to run when stdout is a terminal (exit 2, atty_refusalrecord on stderr), so the commands below pipe the output tojq. 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
leechersis1 - scrape
seedersis0 - global
leechersincreased by1 - global
completedunchanged
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
seederschanged0 -> 1 - scrape
completedchanged0 -> 1 - scrape
leecherschanged1 -> 0 - global
seedersincreased by1 - global
completedincreased by1
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_HASHto 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/udpand1212/tcp.
Related
- Automated E2E runner:
src/bin/qbittorrent_e2e_runner.rs - Local tracker run workflow:
.claude/skills/run-tracker-locally/SKILL.md
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
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…