node
node copied to clipboard
Provider checker API
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
:warning: Please install the 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.
: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.
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.
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
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.
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.