From 64c7fb4cd445618c36cac508f005c3f05216ae08 Mon Sep 17 00:00:00 2001 From: KOSASIH <kosasihg88@gmail.com> Date: Tue, 26 Nov 2024 16:02:48 +0700 Subject: [PATCH] Create generate_reports.py --- QuantumNexusProtocol/scripts/generate_reports.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 QuantumNexusProtocol/scripts/generate_reports.py diff --git a/QuantumNexusProtocol/scripts/generate_reports.py b/QuantumNexusProtocol/scripts/generate_reports.py new file mode 100644 index 000000000..3c850d325 --- /dev/null +++ b/QuantumNexusProtocol/scripts/generate_reports.py @@ -0,0 +1,15 @@ +import json +import requests + +def generate_report(): + response = requests.get("http://localhost:8545/report") + if response.status_code == 200: + report_data = response .json() + with open('network_report.json', 'w') as f: + json.dump(report_data, f, indent=4) + print("Report generated successfully: network_report.json") + else: + print("Error generating report:", response.status_code) + +if __name__ == "__main__": + generate_report()