Categorygithub.com/MalcolmFuchs/Go-Blockchain-Bachelor
repositorypackage
0.0.0-20241016065904-d33ead5d0986
Repository: https://github.com/malcolmfuchs/go-blockchain-bachelor.git
Documentation: pkg.go.dev

# 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

  1. Voraussetzungen:

    • ✅ Golang 1.18 oder höher
    • curl für API-Tests
  2. Klonen des Repositories:

       git clone https://github.com/MalcolmFuchs/Go-Blockchain-Bachelor.git
       cd Go-Blockchain-Bachelor
    
  3. Abhängigkeiten installieren

       go mod tidy
    
  4. Build

       go build -o Go-Blockchain-Bachelor
    

Starten der Nodes und Testen der Endpunkte

  1. Authority Node starten:

    ./Go-Blockchain-Bachelor node --port 8080
    
  2. Client Node starten und mit Authority Node verbinden:

    ./Go-Blockchain-Bachelor node --authority localhost:8080 --port 8081
    
  3. 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
    
  4. TransaktionsPool anzeigen:

    curl "http://localhost:8080/getTransactionPool"
    
  5. Block erstellen:

     curl "http://localhost:8080/createBlock"
    
  6. Blockchain anzeigen:

    curl "http://localhost:8080/getBlockchain"
    
  7. Patienten Transaktionen anzeigen:

    ./Go-Blockchain-Bachelor view --node_address localhost:8080 --key ./keys/patient_private_key.pem