Skip to content

Actor based, horizontally scalable Blockchain using Akka.net.

Notifications You must be signed in to change notification settings

revoltez/Blocksharp

Repository files navigation

Blocksharp

Actor based, horizontally scalable Blockchain using Akka.net.

This Blockchain aims to provide an easy way to create blockchains by simply injecting your own actor that should represent the blockchain runtime or in other words(the blockchain state transition function)

This Blockchain uses pBFT (practical byzantine fault tolerance) consensus Algorithm

Note this project is still under heavy development

why not OOP

Designing big scalable distributed systems requires a model that is distributed by default.

The traditional object-oriented programming paradigm makes it harder to create such systems and raises huge and big problems, more detailed informations can be found here What Problems Does the Actor Model Solve?

tools

  • Entity core as the ORM (object relational mapper)
  • Mysql database
  • Akka.net
  • Nsec (cryptography library)

Prerequisites

  • basic knwoeldge on Akka.net and akka.remote
  • c#
  • docker
  • kubernetes, minikube must be installed to test locally

project structure

  • the PBFT folder represents the consensus engine

  • startupserver folder (acts as bootstrap node, used to easily connect validators)

  • BlockchainTypes folder: a library that groups all the used types in this project.

  • kubernetesconfigs is a folder that contains few shell scripts to automate the building process

Actor hierarchy

  • as we all know actors form a hierarchy and the following diagram is the actor hierarchy of the blockchain actor hieararchy

kubernetes config

  • we used kubernetes to get more realistic and easier testing for a real network.
  • below is a simple diagram that shows the simple network simulated in kubernetes kubernetes

testing locally

a simple image that contains Entity core as a base image for the app, this can be merged with the application image (PBFT), they are seperated so that i dont download all the required libariries everytime i test :)

  • start minikube and execute RebuildCluster.sh
minikube start
eval $(minikube docker-env)
./Rebuildcluster.sh
  • check the server ip address by checking the logs
kubectl logs server 
  • get the list of all runnnig pods
kubectl get pods
  • attach to the pbftnode and wait for it to complete building and updating the database and then provide it with the server address
kubectl attach -it pod-name -c pbftnode

screenshots of a voting system

  • processing PBFT certificates PREPREPARE

  • counting votes Counting Vote

  • Receiving client transactions transactions Added

  • view change View Change

contact information

email : salih.houadef@gmail.com linkedin : <www.linkedin.com/in/houadef-salih>