Giter VIP home page Giter VIP logo

raftblockchain's Introduction

RaftBlockChain

The following is implementation of a blockchain network prototype, which focuses on solving problems of communication between network nodes, reaching consensus and distribution of blocks between nodes. The prototype is implemented in the Rust programming language. In the created prototype, individual nodes can play different roles. Among all nodes in the network, a leader is elected. The leader is the only network participant that can create a new block. By delegating operations such as creation of new blocks or leader election only to certain network nodes, we have achieved more effective communication between nodes and nodes are able to reach consensus faster. The consensus protocol used is based on the Raft consensus protocol

Build

Clone the repo

git clone https://github.com/nikiviro/RaftBlockChain.git
cd RaftBlockChain/

Build in release mode

cargo build --release

This will produce an executable in the ./target/release directory.

Setup

Using Docker

RaftBlockChain supports the use of Docker to provide an easy installation process by providing a single package that gives the user everything he needs to get node up and running. In order to get the installation package, run the following command after installing Docker:

docker build -t blockchain_docker_image .

Before the first start of the node it is necessary to:

  • generate the public and private key of the node which must be inserted into the configuration file, see Generation of private and public key
  • create config files - config.json and genesis.json, you can see example config files in the config/ folder

The Docker container is set up to use files with these names (config.json, genesis.json) by default when running the blockchain node. These files need to be modified based on the required network configuration.

If you want to run the blockchain node, run the following command:

docker run -p 4001:4001 -v <path to folder with config files>:/config blockchain_docker_image

This should result in RaftBlockChain node running.

Generation of public and private key

To generate public and private key run:

docker run blockchain_docker_image --generate_keypair

The generated private and public key is written to the console. The private and public keys must be entered in the configuration file (config/config.json).

raftblockchain's People

Contributors

nikiviro avatar

Stargazers

Vitaliy Yermolenko avatar

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.