Coder Social home page Coder Social logo

revoltez / blocksharp Goto Github PK

View Code? Open in Web Editor NEW
19.0 4.0 5.0 1.31 MB

Actor based, horizontally scalable Blockchain using Akka.net.

C# 98.14% Shell 1.20% Dockerfile 0.66%
blockchain blockchain-technology pbft decentralized-applications consensus generic csharp akka actor-model

blocksharp's Introduction

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 : [email protected] linkedin : <www.linkedin.com/in/houadef-salih>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.