diff --git a/documentation/operators/src/testing/node-api-check.md b/documentation/operators/src/testing/node-api-check.md index 1e11ddeed7..3c2e19d1c0 100644 --- a/documentation/operators/src/testing/node-api-check.md +++ b/documentation/operators/src/testing/node-api-check.md @@ -111,11 +111,12 @@ The most common usage may be `./node_api_check.py query_stats ` where `< **Optional arguments** -| Flag | Shortcut | Description | -| :--- | :--- | :--- | -| `--markdown` | `-m` | returns output in markdown format | -| `--no_routing_history` | `-n` | returns output without routing history which can be lengthy | -| `--output` | `-o` | exports output to a file, possible to add a target path | +| Flag | Shortcut | Description | +| :--- | :--- | :--- | +| `--markdown` | `-m` | returns output in markdown format | +| `--no_routing_history` | None | returns output without routing history which can be lengthy | +| `--no_verloc_metrics` | None | returns output without verloc measurement which can be lengthy | +| `--output` | `-o` | exports output to a file, possible to add a target path | #### `version_count` @@ -123,3 +124,7 @@ Another command is `version_count` where at least one `nym-node` version is requ ```sh ./node_api_check version_count 1.1.0 1.1.1 1.1.2 1.1.3 --markdown ``` + +```admonish tip +To see a quick overview of `nym-node` version distribution in numbers and graph, visit [Nym Harbourmaster](https://harbourmaster.nymtech.net). +``` diff --git a/scripts/api_endpoints.json b/scripts/api_endpoints.json index 32bde5647d..fb67859b79 100644 --- a/scripts/api_endpoints.json +++ b/scripts/api_endpoints.json @@ -5,7 +5,6 @@ "/status/mixnode/{mix_id}/core-status-count", "/status/mixnode/{mix_id}/status", "/status/mixnode/{mix_id}/reward-estimation", - "/status/mixnode/{mix_id}/compute-reward-estimation", "/status/mixnode/{mix_id}/stake-saturation", "/status/mixnode/{mix_id}/inclusion-probability", "/status/mixnode/{mix_id}/avg_uptime" @@ -23,6 +22,7 @@ "swagger":[ "/roles", + "/auxiliary-details", "/build-information", "/description", "/host-information", diff --git a/scripts/node_api_check.py b/scripts/node_api_check.py index 8fcfe52b72..ee9decea3d 100755 --- a/scripts/node_api_check.py +++ b/scripts/node_api_check.py @@ -35,21 +35,29 @@ def display_results(self, args): print(f"Identity Key = {id_key}") print(f"Host = {host}") print(f"Version = {version}") + toc = "Swagger page is not accessible. T&Cs are unrecognized and treated as False!" + if swagger_data: + toc = swagger_data["/auxiliary-details"]["accepted_operator_terms_and_conditions"] + print(f"T&Cs = {toc}") + if mix_id: print(f"Mix ID = {mix_id}") print("\n\nNODE RESULTS FROM UNFILTERED QUERY\n") + if args.markdown: node_markdown = self._dataframe_to_markdown(node_df, ["RESULT"], ["API EDNPOINT"]) print(node_markdown, "\n") else: self.print_neat_dict(node_dict) print(f"\n\nNODE RESULTS FROM {self.api_url.upper()}\n") + if args.markdown: api_df = self._json_to_dataframe(api_data) node_markdown = self._dataframe_to_markdown(api_df, ["RESULT"], ["API EDNPOINT"]) print(node_markdown, "\n") else: self.print_neat_dict(api_data) + if swagger_data: print(f"\n\nNODE RESULTS FROM SWAGGER PAGE\n") if args.markdown: @@ -61,6 +69,7 @@ def display_results(self, args): print(swagger_data) else: swagger_data = f"\nSwagger API endpoints of node {id_key} hosted on IP: {host} are not responding. Maybe you querying a deprecated version of nym-mixnode or the VPS ports are not open correctly.\n" + if routing_history: print(f"\n\nNODE UPTIME HISTORY\n") if args.markdown: @@ -71,13 +80,14 @@ def display_results(self, args): routing_history = self._json_neat_format(routing_history) else: routing_history = " " + if args.output or args.output == "": node_dict = self._json_neat_format(node_dict) api_data = self._json_neat_format(api_data) if role: - data_list = [f"Id. Key = {id_key}", f"Host = {host}", f"Type = {mode}", f"Mode = {role}", node_dict, api_data, swagger_data, routing_history] + data_list = [f"Id. Key = {id_key}", f"Host = {host}", f"Type = {mode}", f"Mode = {role}", f"T&Cs = {toc}", node_dict, api_data, swagger_data, routing_history] else: - data_list = [f"Id. Key = {id_key}", f"Host = {host}", f"Type = {mode}", node_dict, api_data, swagger_data, routing_history] + data_list = [f"Id. Key = {id_key}", f"Host = {host}", f"Type = {mode}", f"T&Cs = {toc}", node_dict, api_data, swagger_data, routing_history] self.output.concat_to_file(args, data_list) def collect_all_results(self,args): @@ -118,6 +128,8 @@ def get_node_data(self,mode, node_dict, id_key, args): dicts = json.load(f) endpoints = dicts[mode] swagger = dicts["swagger"] + if args.no_verloc_metrics: + swagger.remove("/metrics/verloc") api_data = {} swagger_data = {} routing_history = {} @@ -364,7 +376,8 @@ def parser_main(self): # pull_stats arguments parser_pull_stats.add_argument("id", help="supply nym-node identity key") - parser_pull_stats.add_argument("-n","--no_routing_history", help="Display node stats without routing history", action="store_true") + parser_pull_stats.add_argument("--no_routing_history", help="Display node stats without routing history", action="store_true") + parser_pull_stats.add_argument("--no_verloc_metrics", help="Display node stats without verloc metrics", action="store_true") parser_pull_stats.add_argument("-m","--markdown",help="Display results in markdown format", action="store_true") parser_pull_stats.add_argument("-o","--output",help="Save results to file (in current dir or supply with path without filename)", nargs='?',const="", type=str) parser_pull_stats.set_defaults(func=self.functions.display_results)