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 new HTTP tracker client binary #622

Merged

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Jan 17, 2024

You can execute it with:

cargo run --bin http_tracker_client https://tracker.torrust-demo.com 9c38422213e30bff212b30c360d26f9a02136422"

and the output should be something like:

{
  "complete": 1,
  "incomplete": 1,
  "interval": 300,
  "min interval": 300,
  "peers": [
    {
      "ip": "90.XX.XX.167",
      "peer id": [
        45,
        66,
        76,
        50,
        52,
        54,
        51,
        54,
        51,
        45,
        51,
        70,
        41,
        46,
        114,
        46,
        68,
        100,
        74,
        69
      ],
      "port": 59568
    }
  ]
}

I have intentionally not used the same client in production and testing code. I do not want to use production code for testing purposes. In the future, we could extract the tracker clients to new packages (removing dependencies with the core tracker) so we can test them independently and use them in our tracker tests.

You can execute it with:

```
cargo run --bin http_tracker_client https://tracker.torrust-demo.com 9c38422213e30bff212b30c360d26f9a02136422"
```

and the output should be something like:

```json{
  "complete": 1,
  "incomplete": 1,
  "interval": 300,
  "min interval": 300,
  "peers": [
    {
      "ip": "90.XX.XX.167",
      "peer id": [
        45,
        66,
        76,
        50,
        52,
        54,
        51,
        54,
        51,
        45,
        51,
        70,
        41,
        46,
        114,
        46,
        68,
        100,
        74,
        69
      ],
      "port": 59568
    }
  ]
}
```
@josecelano josecelano linked an issue Jan 17, 2024 that may be closed by this pull request
Copy link

codecov bot commented Jan 17, 2024

Codecov Report

Attention: 362 lines in your changes are missing coverage. Please review.

Comparison is base (44e8076) 80.70% compared to head (129fd2f) 77.16%.

Files Patch % Lines
...t_torrent/tracker/http/client/requests/announce.rs 0.00% 107 Missing ⚠️
...it_torrent/tracker/http/client/responses/scrape.rs 0.00% 91 Missing ⚠️
..._torrent/tracker/http/client/responses/announce.rs 0.00% 64 Missing ⚠️
src/shared/bit_torrent/tracker/http/client/mod.rs 0.00% 48 Missing ⚠️
...bit_torrent/tracker/http/client/requests/scrape.rs 0.00% 39 Missing ⚠️
src/shared/bit_torrent/tracker/http/mod.rs 0.00% 11 Missing ⚠️
...bit_torrent/tracker/http/client/responses/error.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #622      +/-   ##
===========================================
- Coverage    80.70%   77.16%   -3.55%     
===========================================
  Files          117      124       +7     
  Lines         7878     8242     +364     
===========================================
+ Hits          6358     6360       +2     
- Misses        1520     1882     +362     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

to follow same folder strucutre as the HTTP tracker client.
@josecelano
Copy link
Member Author

ACK 129fd2f

@josecelano josecelano merged commit dde3d8d into torrust:develop Jan 17, 2024
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Add a new HTTP tracker client binary
1 participant