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

Provider checker API #6047

Closed
wants to merge 6 commits into from
Closed

Provider checker API #6047

wants to merge 6 commits into from

Conversation

Zensey
Copy link
Contributor

@Zensey Zensey commented May 14, 2024

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 Zensey self-assigned this May 14, 2024
@Zensey Zensey force-pushed the feature/provider-checker branch 9 times, most recently from 782e1ed to a464dbf Compare May 14, 2024 17:19
@codecov-commenter
Copy link

codecov-commenter commented May 14, 2024

⚠️ 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 ⚠️
services/wireguard/endpoint/diagclient/client.go 0.00% 72 Missing ⚠️
cmd/di.go 0.00% 28 Missing ⚠️
ci/packages/build.go 0.00% 16 Missing ⚠️
cmd/bootstrap.go 0.00% 16 Missing ⚠️
core/connection/pinger.go 0.00% 12 Missing ⚠️
cmd/node.go 0.00% 7 Missing ⚠️
services/wireguard/endpoint/endpoint.go 0.00% 5 Missing ⚠️
tequilapi/endpoints/connection-diag-empty.go 0.00% 3 Missing ⚠️
ci/packages/package.go 0.00% 2 Missing ⚠️
... and 4 more

❗ 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     

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

@Zensey Zensey force-pushed the feature/provider-checker branch 11 times, most recently from ef81c6a to cc91377 Compare May 24, 2024 09:50
@Zensey Zensey changed the title Provider checker mode Provider checker API Jun 4, 2024
Copy link

stale bot commented Jun 22, 2024

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 stale bot added the stale label Jun 22, 2024
@stale stale bot removed the stale label Jul 1, 2024
@Zensey Zensey force-pushed the feature/provider-checker branch 2 times, most recently from 4478b3c to e198aaa Compare July 17, 2024 12:41
@Zensey Zensey force-pushed the feature/provider-checker branch 3 times, most recently from 157e935 to 03c6753 Compare July 29, 2024 09:56
Copy link
Member

@soffokl soffokl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Zensey
Copy link
Contributor Author

Zensey commented Aug 30, 2024

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 Zensey force-pushed the feature/provider-checker branch from 03c6753 to cdc4644 Compare August 30, 2024 12:08
Copy link

stale bot commented Sep 14, 2024

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 stale bot added the stale label Sep 14, 2024
Copy link

stale bot commented Sep 29, 2024

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 stale bot closed this Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants