node icon indicating copy to clipboard operation
node copied to clipboard

Provider checker API

Open Zensey opened this issue 1 year ago • 2 comments

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://107.173.23.19:8080/test

How to build go run mage.go buildProvChecker

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

Example of use #2 (with postgres - to save results of scan into table) .\build\myst\myst.exe --provchecker --log-level=error --checker.dsn="host=yyy user=mypguser password=xxx dbname=myst_nodes port=5432 ss lmode=disable" 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:4050/prov-checker-batch \
  -d '["0x020dd683990895d0f81a47702161f1d29d209976","0x1a52807858619c4acb2a075b659a86dbe459bc98"]'

Response:

[
  {
    "status": false,
    "error": "err_connect",
    "provider_id": "0x020dd683990895d0f81a47702161f1d29d209976"
  },
  {
    "status": true,
    "error": null,
    "provider_id": "0x1a52807858619c4acb2a075b659a86dbe459bc98"
  }
]

Batch mode #2 (check all providers of a given country or gloabally):

curl.exe -vvv -H "Content-Type: application/json" \
  http://localhost:4050/prov-checker-batch2?location=US

Zensey avatar May 14 '24 11:05 Zensey

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0.13423% with 744 lines in your changes missing coverage. Please review.

Project coverage is 27.85%. Comparing base (3174272) to head (cdc4644). Report is 29 commits behind head on master.

Files with missing lines Patch % Lines
core/connection/manager-diag.go 0.00% 575 Missing :warning:
services/wireguard/endpoint/diagclient/client.go 0.00% 72 Missing :warning:
cmd/di.go 0.00% 28 Missing :warning:
ci/packages/build.go 0.00% 16 Missing :warning:
cmd/bootstrap.go 0.00% 16 Missing :warning:
core/connection/pinger.go 0.00% 12 Missing :warning:
cmd/node.go 0.00% 7 Missing :warning:
services/wireguard/endpoint/endpoint.go 0.00% 5 Missing :warning:
tequilapi/endpoints/connection-diag-empty.go 0.00% 3 Missing :warning:
ci/packages/package.go 0.00% 2 Missing :warning:
... and 4 more

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

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #6047       +/-   ##
===========================================
- Coverage   37.92%   27.85%   -10.08%     
===========================================
  Files         371      524      +153     
  Lines       20715    30679     +9964     
===========================================
+ Hits         7856     8545      +689     
- Misses      12075    21310     +9235     
- Partials      784      824       +40     

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

codecov-commenter avatar May 14 '24 17:05 codecov-commenter

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.

stale[bot] avatar Jun 22 '24 11:06 stale[bot]

Do we have a task for this with requirements? From now it looks like it duplicates what we have for providers checks in the monitoring agent.

The difference from monitoring agent is the capability to function w/o using OS-based network interfaces, thus making it more cloud-friendly or suitable for non-Linux (e.g. Windows). One of the real applications of that API is search of provider nodes affected by bug #6022

Zensey avatar Aug 30 '24 09:08 Zensey

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.

stale[bot] avatar Sep 14 '24 01:09 stale[bot]

This pull request has been automatically closed because it has not had activity for a long time. If this pull request is still valid, please ping a maintainer and ask them to label it as "pinned". Thank you for your contributions.

stale[bot] avatar Sep 29 '24 15:09 stale[bot]