Skip to content

Commit

Permalink
Add endpoint validation automation to 'generate all' script (#2174)
Browse files Browse the repository at this point in the history
* Add endpoint validation automation to 'generate all' script

* minor typo
  • Loading branch information
JeremyParish69 authored Dec 31, 2024
1 parent f02bd79 commit 2dc00c1
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 18 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/generate_all_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ jobs:
- name: Run code to Query Pools
working-directory: ./.github/workflows/utility
run: node queryPools.mjs

- name: Run code to Validate Endpoints
working-directory: ./.github/workflows/utility
run: node validateEndpoints.mjs routineBulkValidation

- name: Run code to Generate Assetlist
working-directory: ./.github/workflows/utility
Expand Down
32 changes: 28 additions & 4 deletions .github/workflows/utility/validateEndpoints.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const restEndpoints = [
];


const numChainsToQuery = 2;
const numChainsToQuery = 4;
const currentDateUTC = new Date();
const oneDayInMs = 24 * 60 * 60 * 1000;
const successReQueryDelay = 7 * oneDayInMs;
Expand Down Expand Up @@ -537,7 +537,7 @@ async function validateEndpointsForAllCounterpartyChains(chainName) {

}

function main() {
function routineBulkValidation() {
zone.chainNames.forEach(chainName => validateEndpointsForAllCounterpartyChains(chainName));
}

Expand Down Expand Up @@ -569,5 +569,29 @@ async function validateSpecificChain(chainName, chain_name) {

}

main();
//validateSpecificChain("osmosis", "konstellation");
//routineBulkValidation();

const functions = {
routineBulkValidation: () => {
console.log("Running routineBulkValidation...");
routineBulkValidation();
},
validateSpecificChain: (chainName, chain_name) => {
console.log("Running validateSpecificChain...");
validateSpecificChain(chainName, chain_name);
},
};

const [, , funcName, ...args] = process.argv;

if (functions[funcName]) {
functions[funcName](...args);
} else {
console.error(`Error: Unknown function '${funcName}'`);
process.exit(1); // Exit with error code if the function is unknown
}

/*
* validateSpecificChain("osmosis", "konstellation");
* > node validateEndpoints.mjs validateSpecificChain "osmosis" "konstellation"
*/
81 changes: 67 additions & 14 deletions osmosis-1/generated/state/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -1158,9 +1158,14 @@
},
{
"chain_name": "terra",
"validationDate": "2024-12-01T04:23:39.361Z",
"validationDate": "2024-12-31T22:35:55.075Z",
"validationSuccess": false,
"validationResults": [
{
"test": "RPC CORS",
"url": "https://rpc-terra-ia.cosmosia.notional.ventures/",
"success": false
},
{
"test": "RPC WSS",
"url": "wss://rpc-terra-ia.cosmosia.notional.ventures/websocket",
Expand All @@ -1172,6 +1177,11 @@
"success": false,
"stale": false
},
{
"test": "REST CORS",
"url": "https://api-terra-ia.cosmosia.notional.ventures/",
"success": false
},
{
"test": "REST Endpoints",
"url": "https://api-terra-ia.cosmosia.notional.ventures/cosmos/base/tendermint/v1beta1/node_info",
Expand All @@ -1181,8 +1191,14 @@
},
{
"chain_name": "secretnetwork",
"validationDate": "2024-12-01T04:23:39.361Z",
"validationDate": "2024-12-31T22:35:55.075Z",
"validationSuccess": false,
"validationResults": [
{
"test": "RPC CORS",
"url": "https://rpc-secret.keplr.app/",
"success": true
},
{
"test": "RPC WSS",
"url": "wss://rpc-secret.keplr.app/websocket",
Expand All @@ -1194,10 +1210,15 @@
"success": true,
"stale": false
},
{
"test": "REST CORS",
"url": "https://lcd-secret.keplr.app/",
"success": false
},
{
"test": "REST Endpoints",
"url": "https://lcd-secret.keplr.app/cosmos/base/tendermint/v1beta1/node_info",
"success": true
"success": false
}
]
},
Expand Down Expand Up @@ -1302,35 +1323,67 @@
},
{
"chain_name": "persistence",
"validationDate": "2024-11-29T20:12:36.729Z",
"validationDate": "2024-12-31T22:35:55.075Z",
"validationSuccess": false,
"validationResults": [
{
"test": "RPC CORS",
"url": "https://rpc-persistence.keplr.app/",
"success": false
},
{
"test": "RPC WSS",
"url": "wss://rpc-persistence.keplr.app/websocket",
"success": true
},
{
"test": "RPC Endpoints",
"url": "wss://rpc-persistence.keplr.app/status",
"success": false,
"url": "https://rpc-persistence.keplr.app/status",
"success": true,
"stale": false
},
{
"url": "wss://rpc-persistence.keplr.app/websocket",
"response": false
"test": "REST CORS",
"url": "https://lcd-persistence.keplr.app/",
"success": false
},
{
"test": "REST Endpoints",
"url": "https://lcd-persistence.keplr.app/cosmos/base/tendermint/v1beta1/node_info",
"success": true
}
]
},
{
"chain_name": "irisnet",
"validationDate": "2024-11-29T20:12:36.729Z",
"validationSuccess": false,
"validationDate": "2024-12-31T22:35:55.075Z",
"validationSuccess": true,
"validationResults": [
{
"test": "RPC CORS",
"url": "https://rpc-iris.keplr.app/",
"success": true
},
{
"test": "RPC WSS",
"url": "wss://rpc-iris.keplr.app/websocket",
"success": true
},
{
"test": "RPC Endpoints",
"url": "wss://rpc-iris.keplr.app/status",
"success": false,
"url": "https://rpc-iris.keplr.app/status",
"success": true,
"stale": false
},
{
"url": "wss://rpc-iris.keplr.app/websocket",
"response": false
"test": "REST CORS",
"url": "https://lcd-iris.keplr.app/",
"success": true
},
{
"test": "REST Endpoints",
"url": "https://lcd-iris.keplr.app/cosmos/base/tendermint/v1beta1/node_info",
"success": true
}
]
},
Expand Down

0 comments on commit 2dc00c1

Please sign in to comment.