Created by: Nikiforos Katakis & Dimitris Katsiros .
– sudo apt-get install python3 python3-pip python3-requests python3-virtualenv
– virtualenv venv
– pip3 install -r requirements.txt
– Open a terminal and connect to the VirtualMachine.
– Activate the virtual environment
source venv/bin/activate
– Start server at [HOST]:[PORT]
python manage.py runserver [HOST]:[PORT]
– Open a new terminal to use client.
python client.py [PORT] [NUMBER]
[NUMBER]
: number of participants if you are setting up the coordinator, otherwise 0
– source [number]
Read source file.
– view
Print current blockchain
–balance
Print current balance
–exit
Exit client. Server continues running.
BLOCK_CAPACITY
: Set max transactions contained in a block in blockchain
DIFFICULTY
: Set difficulty in computing nonce.
COORDINATOR_PORT
: Set the coordinator port
CORDINATOR
: Set the coordinator's [HOST]
SOURCE_INPUTS_PATH
: Path which contains the source files for client
– plot_diagram.py
: Create diagrams using the statistics saved in blocktimes.txt
– runserver.sh
: Activates the virtual environment. Then runs 2 servers using [HOST]
depending on the machine's hostname, in the background. Ports used: 8000 and 8001.
If -k
is given as an argument, kills all servers running in the background.
– client.sh
: If 1
is given as an argument, starts a client on port 8000. Otherwise on port 8001.
– force_close_ports.sh
: Closes possible open tcp ports on 8000 and 8001.
– ssh_now.sh
: Given an argument [n]
attempts an ssh connection to the n'th virtual machine.
It is useful to provide an RSA key in virtual machines .ssh/known_hosts
.
– update_machine.sh
: Updates all files of each VM in the local network. In order to speed things up
the script uses rsync
, updating only difs since the last version.