decentralized-authority / pokt-lint Goto Github PK
View Code? Open in Web Editor NEWA diagnostic tool for testing the operation of pocket network servicer nodes
License: MIT License
A diagnostic tool for testing the operation of pocket network servicer nodes
License: MIT License
When simulate relays is not on, we should have something in the response that is more descriptive. "404 page not found" should follow up with: "Check that Simulate Relays is enabled"
Call
curl -X POST -H "Content-Type: application/json" -d '{"node_url": "https://node-001.testnet2.dopenodes.com:443", "chain_ids": ["0001","0040"]}' https://2eqrf8goof.execute-api.us-east-1.amazonaws.com/test/relay-test
Response:
{"0001":{"chain_id":"0001","chain_name":"POKT","success":true,"status_code":404,"message":"OK","duration_ms":36.672,"relay_request":{"data":"{}","method":"POST","path":"/v1/query/height","headers":null},"relay_response":{"status_code":404,"data":{"body":"404 page not found"}}},"0040":{"chain_id":"0040","chain_name":"HMY 0","success":true,"status_code":404,"message":"OK","duration_ms":36.288,"relay_request":{"data":"{\"jsonrpc\":\"2.0\",\"method\":\"hmy_blockNumber\",\"params\":[],\"id\":64}","method":"POST","path":"/","headers":null},"relay_response":{"status_code":404,"data":{"body":"404 page not found"}}}}da@chains01-04:~$
If I send a request to the relay-test
endpoint with incorrect parameters, eg excluding the node_id
param, the response is not very useful:
{
"errorMessage": "relaying.HandleRequest: relaying.NewNodeChecker: init: Node: strconv.ParseUint: parsing \"\": invalid syntax",
"errorType": "errorString"
}
Currently, requests to Algorand and OKExChain relays return a chain not supported error despite them being monetized chains on Pocket.
eg: this is the response for a relay test that should have failed. "success" should be false, but it is true
"0025": {
"chain_id": "0025",
"chain_name": "ETH Rinkeby",
"success": true,
"status_code": 400,
"message": "OK",
"duration_ms": 46.652,
"relay_request": {
"data": "{\"jsonrpc\":\"2.0\",\"method\":\"eth_blockNumber\",\"params\":[],\"id\":64}",
"method": "POST",
"path": "/",
"headers": null
},
"relay_response": {
"status_code": 400,
"data": {
"code": 400,
"message": "ERROR:\nCodespace: pocketcore\nCode: 46\nMessage: \"the blockchain requested is not hosted\"\n"
}
}
},
```
The pocket cherry-picker uses median time to measure latency, so our results (currently min, max, avg) should also include the median sample.
Pokt lint doesn't know about chain id 03DK
so we need to add it. Also, if we encounter an unsupported chain, all of the testing halts. We should continue testing, but return an error response for the unsupported chain.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.