Skip to content
This repository was archived by the owner on Jul 31, 2024. It is now read-only.

Simons36/hds-serenity-ledger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 

Repository files navigation

HDSLedger

IMPORTANT: To see how to run tests, please check the end of this readme file.

Introduction

HDSLedger is a simplified permissioned (closed membership) blockchain system with high dependability guarantees. It uses the Istanbul BFT consensus algorithm to ensure that all nodes run commands in the same order, achieving State Machine Replication (SMR) and guarantees that all nodes have the same state.

Requirements


Configuration Files

Node/Client configuration

Can be found inside the src/main/resources/ folder of the Common module.

Config of a node:

{
    "type" : "node",
    "id": <NODE_ID>,
    "isLeader": <IS_LEADER>,
    "hostname": "localhost",
    "port": <PORT>,
    "clientRequestPort": <ANOTHER_PORT>,
    "privateKeyPath" : "Keystore/<FILENAME_OF_PRIVATE_KEY>",
    "publicKeyPath" : "Keystore/<FILENAME_OF_PUBLIC_KEY>",
    "serviceConfig" : <SERVICE_CONFIG_FILENAME>

}

Config of a client:

{
    "type" : "client",
    "id": <NODE_ID>,
    "hostname": "localhost",
    "port": <PORT>,
    "privateKeyPath" : "Keystore/<FILENAME_OF_PRIVATE_KEY>",
    "publicKeyPath" : "Keystore/<FILENAME_OF_PUBLIC_KEY>"
}

Service Configuration

Can be found inside the src/main/resources folder of the Service module. Contains some general configurations about the service (e.g., transaction fee percentage, number of transactions in a block, etc.).

Example:

{
    "initial_account_balance": 1000,
    "transaction_fee": 0.05,
    "num_transaction_in_single_block" : 1
}

Dependencies

To install the necessary dependencies run the following command:

./install_deps.sh

This should install the following dependencies:

  • Google's Gson - A Java library that can be used to convert Java Objects into their JSON representation.
  • Junit - Junit is a simple framework to write repeatable tests.

Puppet Master

The puppet master is a python script puppet-master.py which is responsible for starting the nodes of the blockchain. The script runs with kitty terminal emulator by default since it's installed on the RNL labs.

To run the script you need to have python3 installed. The script has arguments which can be modified:

  • terminal - the terminal emulator used by the script
  • server_config - a string from the array server_configs which contains the possible configurations for the blockchain nodes

Run the script with the following command:

python3 puppet-master.py

Note: You may need to install kitty in your computer

Maven

It's also possible to run the project manually by using Maven.

Instalation

Compile and install all modules using:

mvn clean install

Execution

Client

To run:

cd Client/
mvn compile exec:java -Dexec.args="<id_of_client> <filename_of_config> localhost <port> all <false>"

Test Running

To run the test, first change to the Test module

cd Test

Then, to run a single test, perform the following command:

mvn test -Dtest=<NAME_OF_TEST>

To run all of the test, tou can simply execute the following command:

mvn test

About

Projeto SEC MEIC 2023/2024

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages