# Packages
No description provided by the author
No description provided by the author
No description provided by the author
# README
🚀 Go-Blockchain-Bachelor
📋 Übersicht
Dieses Dokument beschreibt die Implementierung und Verwendung der Go-Blockchain-Bachelor
-Anwendung. Es enthält Anweisungen zur Installation, zum Starten der Nodes und zur Nutzung der verschiedenen Endpunkte, die zur Interaktion mit der Blockchain verfügbar sind.
🛠️ Installation
-
Voraussetzungen:
- ✅ Golang 1.18 oder höher
- ✅
curl
für API-Tests
-
Klonen des Repositories:
git clone https://github.com/MalcolmFuchs/Go-Blockchain-Bachelor.git cd Go-Blockchain-Bachelor
-
Abhängigkeiten installieren
go mod tidy
-
Build
go build -o Go-Blockchain-Bachelor
Starten der Nodes und Testen der Endpunkte
-
Authority Node starten:
./Go-Blockchain-Bachelor node --port 8080
-
Client Node starten und mit Authority Node verbinden:
./Go-Blockchain-Bachelor node --authority localhost:8080 --port 8081
-
Transaktion hinzufügen:
./Go-Blockchain-Bachelor create --node_address localhost:8080 --type "medical" --notes "Routine Check-up" --results "All tests normal" --patient ./keys/patient_public_key.pem --key ./keys/doctor_private_key.pem ./Go-Blockchain-Bachelor create --node_address localhost:8080 --type "medical" --notes "Blood Test" --results "Cholesterol levels normal" --patient ./keys/patient_public_key.pem --key ./keys/doctor_private_key.pem ./Go-Blockchain-Bachelor create --node_address localhost:8080 --type "medical" --notes "X-Ray Examination" --results "No fractures detected" --patient ./keys/patient_public_key.pem --key ./keys/doctor_private_key.pem ./Go-Blockchain-Bachelor create --node_address localhost:8080 --type "prescription" --notes "Prescribed medication for hypertension" --results "Medication: Lisinopril 10mg daily" --patient ./keys/patient_public_key.pem --key ./keys/doctor_private_key.pem ./Go-Blockchain-Bachelor create --node_address localhost:8080 --type "referral" --notes "Referral to cardiologist" --results "Appointment scheduled for 2024-11-01" --patient ./keys/patient_public_key.pem --key ./keys/doctor_private_key.pem
-
TransaktionsPool anzeigen:
curl "http://localhost:8080/getTransactionPool"
-
Block erstellen:
curl "http://localhost:8080/createBlock"
-
Blockchain anzeigen:
curl "http://localhost:8080/getBlockchain"
-
Patienten Transaktionen anzeigen:
./Go-Blockchain-Bachelor view --node_address localhost:8080 --key ./keys/patient_private_key.pem