A Blockchain-project as part of the class "Distributed Systems" in the winter semester 2023 of the course TINF21AI2 at DHBW Mannheim.
Name | Matrikel number |
---|---|
Matthias Heilmann | 4186046 |
Lorenz Müller | 8350586 |
Sean Schwarz | 3446064 |
Leo Stadtler | 9230282 |
The following paragraphs explain how to run the miner-application and the wallet app
Before starting, you might need to open a Powershell window as an Administrator and execute the following command to be able to execute the Udocoin Powershell starting script.
set-executionpolicy remotesigned
To run the udocoin miner application, with Docker you need to have Docker Desktop and docker-compose installed on your machine.
If you don't have a public and a private key, you also need to have at least Python 3.8 to generate keys. (See References for testing keys)
In your terminal, change your directory to udocoin/udocoin_miner
cd udocoin_miner
Execute the start files and follow the instructions in the terminal.
Windows:
start.ps1
Other operating systems:
source start.sh
Building the docker containers will take some time. Keep in mind you will have to have the Docker Desktop app running while building the application.
The server will be running on localhost:80.
Go to localhost/miner to check information about your server and the blockchain.
To run the udocoin miner application without Docker, you need to have at least Python 3.8 installed.
Change the directory to udocoin/udocoin_miner/application
cd udocoin_miner/application
Create and activate a Python virtual environment and install required packages
Windows:
python -m venv venv
venv\Scripts\activate.ps1
pip install -r requirements.txt
Other operation systems:
python3 -m venv venv
source venv/Scripts/activate
pip3 install -r requirements.txt
And then start the server
Windows:
python run.py
Other operating systems:
python3 run.py
Follow the instructions in the terminal and the server will be running on localhost:5000.
Go to localhost:5000/miner to check information about your server and the blockchain.
To create and send transactions, the wallet app should be used. Alternatively, you can use the file "post_to_localhost.py" to create a transaction and post it to your locally hosted Udocoin Miner. You can download the APK-File here and install it on your android device with an android version of at least 7.1.1. It is recommended to use a USB-cable to transfer the app to the mobile device.
The app was developed and tested on
- Google Pixel 3a (Android version 13)
- Samsung Galaxy A52 (Android version 13)
If there are problems with the installation of the APK-file, try to open the project in Android Studio to run the development version.
The app will notify you that it's running with an unlicensed version of Chaquopy. Please don't mind, there are no licensing issues as Chaquopy has gone open source under the MIT license.
If you don't get asked to grant camera-permission, go to your device's settings > apps > Udocoin Wallet and allow camera usage.
Scan the private key from sources/keys/server/privkey.png to immediately gain access to an account with balance if the seed server on our aws ec2 instance is running :)
To test the consensus algorithm you can access the endpoint /consensus_test or execute:
python udocoin_miner/tests/consensus_test.py
python3 udocoin_miner/tests/consensus_test.py
To test transactions without using the mobile app execute:
python udocoin_miner/tests/post_to_localhost.py
python3 udocoin_miner/tests/post_to_localhost.py