Skip to content

Giorgos-P/HashGraphBFT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hashgraph

Implementation of HashGraph Byzantine Fault tolerance algorithm in Golang programming language with Zero MQ.

Contents

About

Implementation of Hashgraph Byzantine Fault tolerance algorithm in Go programming language with ZeroMQ framework.

Based on:
"The Hashgraph Protocol: Efficient Asynchronous BFT for High-Throughput Distributed Ledgers"
by Leemon Baird and Atul Luykx.

Modules

Functions Protocols
Send Gossip Divide Rounds
Manage Client Request Decide Fame
Manage Incoming Gossip Find Order

Send Gossip

Send Gossip function implements the gossip protocol.
Chooses randomly another server and sends all the event we believe it does not know.

Manage Client Request

It is responsible to receive the client transaction and insert it in the graph.

Manage Incoming Gossip

  • Receives the gossip messages from the other servers
  • Checks whether or not to insert the events in the graph
  • Calls the protocols

Protocols

The protocols are implemented based on the paper[1]

Installation

Golang

If you have not already installed Golang follow the instructions here.

Clone Repository

cd ~/go/src/
git clone https://github.com/Giorgos-P/HashGraphBFT.git

Setup

In bin folder create the following paths:
bin/keys
bin/logs/client
bin/logs/error
bin/logs/out

Execution

Hashgraph Client

You can find the instructions for our BFT client here.

Manually

To install the program and generate the keys run:

go install HashgraphBFT
HashgraphBFT generate_keys <N>      // For key generation

Open different terminals and in each terminal run:

HashgraphBFT <ID> <N> <Clients> <Scenario> <Remote>

ID : is the server id [0 to (N-1)]
N : is the total number of servers
Clients : is the total number of clients
Scenario : is the scenarion number [0 to 2]
Remote : is [0 or 1] 0=local execution, 1 is remote execution (we have to set the correct ip address of the remote servers in ip.go)

Script

Adjust the script (HashgraphBFT/scripts/run.sh) and run:

bash ~/go/src/HashgraphBFT/scripts/run.sh

Kill Processes

When you are done and want to kill the processes run:

bash ~/go/src/HashgraphBFT/scripts/killHash.sh

Scenarios

  • 0 = Normal : no malicious nodes occurs
  • 1 = IDLE : malicious node do not send messages
  • 2 = Sleep : malicious nodes sleeo for some time and then restarts executing
  • 3 = Fork : malicious nodes send messages with arbitrary content

References

Go To TOP