From 53af57c48789b30b2661a5925dd36cb79a320c83 Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Tue, 26 Nov 2024 16:04:10 +0700 Subject: [PATCH] Create migrate_data.py --- QuantumNexusProtocol/scripts/migrate_data.py | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 QuantumNexusProtocol/scripts/migrate_data.py diff --git a/QuantumNexusProtocol/scripts/migrate_data.py b/QuantumNexusProtocol/scripts/migrate_data.py new file mode 100644 index 000000000..101cf6534 --- /dev/null +++ b/QuantumNexusProtocol/scripts/migrate_data.py @@ -0,0 +1,22 @@ +import json +import requests + +def migrate_data(): + # Load old data + with open('old_data.json', 'r') as f: + old_data = json.load(f) + + # Migrate data to new contract structure + new_data = {} + for key, value in old_data.items(): + new_data[key] = value # Transform data as needed + + # Send new data to the blockchain + response = requests.post("http://localhost:8545/migrate", json=new_data) + if response.status_code == 200: + print("Data migrated successfully.") + else: + print("Error migrating data:", response.status_code) + +if __name__ == "__main__": + migrate_data()