mysteriumnetwork / node

Mysterium Network Node - official implementation of distributed VPN network (dVPN) protocol
https://mysterium.network
GNU General Public License v3.0
1.09k stars 311 forks source link

Provider checker API #6047

Open Zensey opened 1 month ago

Zensey commented 1 month ago

VPN 2.0 monitoring.

Summry of task: Essentially, the program should get the connection parameters from the API, raise the connection and make sure that it works. Establishing a VPN connection to wireguard must be done through the wg+gvisor combination, because raising a real network interface is not convenient especially in could environments, so a VPN connection that works entirely from code would be very useful.

Implementation notes: Check of provider's functioning is done by requesting to http://1.1.1.1

Example of use .\build\myst\myst.exe --provchecker --log-level=error daemon

Api http://localhost:4050/prov-checker?id=0x020dd683990895d0f81a47702161f1d29d209976

Response: {"status":true,"error":null,"provider_id":"0x020dd683990895d0f81a47702161f1d29d209976"}

Batch mode (check many providers):

curl.exe -vvv -H "Content-Type: application/json" \
  http://localhost:5050/prov-checker-batch \
  -d '["0x020dd683990895d0f81a47702161f1d29d209976","0x1a52807858619c4acb2a075b659a86dbe459bc98"]'

Response:

[
  {
    "status": false,
    "error": "err_connect",
    "provider_id": "0x020dd683990895d0f81a47702161f1d29d209976"
  },
  {
    "status": true,
    "error": null,
    "provider_id": "0x1a52807858619c4acb2a075b659a86dbe459bc98"
  }
]
codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 0% with 771 lines in your changes are missing coverage. Please review.

Project coverage is 36.60%. Comparing base (4a517cd) to head (cc91377). Report is 73 commits behind head on master.

Files Patch % Lines
core/connection/manager-diag.go 0.00% 566 Missing :warning:
tequilapi/endpoints/connection-diag.go 0.00% 191 Missing :warning:
core/connection/pinger.go 0.00% 10 Missing :warning:
config/flags_node.go 0.00% 2 Missing :warning:
services/wireguard/connection/connection.go 0.00% 2 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #6047 +/- ## ========================================== - Coverage 37.90% 36.60% -1.31% ========================================== Files 371 374 +3 Lines 20665 21486 +821 ========================================== + Hits 7833 7864 +31 - Misses 12054 12839 +785 - Partials 778 783 +5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

stale[bot] commented 1 week ago

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.