Skip to content

Small blockchain-like application created for the Distributed Systems Course in NTUA.

Notifications You must be signed in to change notification settings

katakisnik/Distributed-NoobCash

Repository files navigation

Distributed-NoobCash

Created by: Nikiforos Katakis & Dimitris Katsiros .

Dependencies

– sudo apt-get install python3 python3-pip python3-requests python3-virtualenv

– virtualenv venv

– pip3 install -r requirements.txt

Usage

– 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

Client

You can use client in order to control the transactions. Client provides the following:

– source [number] Read source file.

– view Print current blockchain

balance Print current balance

exit Exit client. Server continues running.

Settings

You can always change the settings in src/trydjango/nbcsettings.py

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

Scripts

Some scripts are provided in order to automate some things

– 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.

About

Small blockchain-like application created for the Distributed Systems Course in NTUA.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published