Skip to content

Commit

Permalink
Create migrate_data.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Nov 26, 2024
1 parent c7ca1ba commit 53af57c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions QuantumNexusProtocol/scripts/migrate_data.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 53af57c

Please sign in to comment.