All Projects → ngocjr7 → Voting Blockchain

ngocjr7 / Voting Blockchain

A simple blockchain-based voting system application built from scratch by Python. It's available for running with multipeer.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Voting Blockchain

Learn Solidity
Code base for "Learn Solidity: Programming Language for Ethereum Smart Contracts" course in Tosh Academy & Blockchain Council
Stars: ✭ 44 (+69.23%)
Mutual labels:  blockchain, voting, tutorial
Blockchain Tutorial
🌾 A step-by-step blockchain tutorial in simplified Chinese
Stars: ✭ 2,081 (+7903.85%)
Mutual labels:  blockchain, tutorial
Ton
Telegram Open Network research group. Telegram: https://t.me/ton_research
Stars: ✭ 146 (+461.54%)
Mutual labels:  blockchain, tutorial
Zerotoblockchain
Tutorial for Zero to Blockchain series
Stars: ✭ 272 (+946.15%)
Mutual labels:  blockchain, tutorial
Blockchaindemo
A simple demo for Blockchain in Swift
Stars: ✭ 44 (+69.23%)
Mutual labels:  blockchain, tutorial
Your first decentralized application python
An up to date and bare minimum tutorial on deploying smart contracts with python
Stars: ✭ 132 (+407.69%)
Mutual labels:  blockchain, tutorial
Heroes Service
Short tutorial to build a blockchain application in Go with Hyperledger Fabric
Stars: ✭ 248 (+853.85%)
Mutual labels:  blockchain, tutorial
Eattheblocks
Source code for Eat The Blocks, a screencast for Ethereum Dapp Developers
Stars: ✭ 431 (+1557.69%)
Mutual labels:  blockchain, tutorial
Eth Crypto
Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity
Stars: ✭ 420 (+1515.38%)
Mutual labels:  blockchain, tutorial
Cryptozombies Lesson Code
cryptozomebie lesson code
Stars: ✭ 301 (+1057.69%)
Mutual labels:  blockchain, tutorial
Arc
Arc is an operating system for DAOs.
Stars: ✭ 190 (+630.77%)
Mutual labels:  blockchain, voting
Paper
On self sovereign human identity.
Stars: ✭ 537 (+1965.38%)
Mutual labels:  blockchain, voting
Basic Blockchain Programming
Sample code from my blog series "Basic blockchain programming".
Stars: ✭ 282 (+984.62%)
Mutual labels:  blockchain, tutorial
Python blockchain app
A fully functional blockchain application implemented in Python from scratch (with tutorial).
Stars: ✭ 510 (+1861.54%)
Mutual labels:  blockchain, tutorial
Ethereum Development With Go Book
📖 A little book on Ethereum Development with Go (golang)
Stars: ✭ 754 (+2800%)
Mutual labels:  blockchain, tutorial
Fastapi Realworld Example App
Backend logic implementation for https://github.com/gothinkster/realworld with awesome FastAPI
Stars: ✭ 911 (+3403.85%)
Mutual labels:  tutorial
Md blockchain
blockchain of java
Stars: ✭ 24 (-7.69%)
Mutual labels:  blockchain
Bitgosdk Php
BitGo SDK written in PHP
Stars: ✭ 22 (-15.38%)
Mutual labels:  blockchain
Go Bftx
Blockfreight™ Node (MIT) Global Logistics Network in Go https://blockfreight.com/
Stars: ✭ 22 (-15.38%)
Mutual labels:  blockchain
Subnode.org
SubNode: Social Media App
Stars: ✭ 25 (-3.85%)
Mutual labels:  blockchain

A Simple Blockchain-based Voting System

A simple blockchain-based voting system application built from scratch by Python. It's available for running with multipeer.

Materials:

How it looks

alt tag

How to use

-> Note: At the first run, click Update Chaincode and Mine to init chaincode (I wrote a simple chaincode count_down_opening_time to auto close survey after a period of time) before using.

  • Mine : mine unconfirmed transaction
  • Resync : Reload front-end
  • Update Chaincode : Load smart contract from chaincode.py in vosy_app to blockchain transaction
  • Pending Transaction : List unconfirmed transaction
  • List Node : List node in the network

Instructions to run

This project can run separately by python or use docker-compose

Running by Docker-compose

-> NOTE: Only available for linux user. If you have any problem with request ip address, try to uncomment network_mode: "host" in docker-compose.yml.

Prerequisites

You need to install docker and docker-compose before

Running

In first machine

Follow this command:

docker-compose build
docker-compose up

You can run in background:

docker-compose up -d

You can stop this application:

docker-compose stop

Or down ( delete container ):

docker-compose down
In second machine

You have to provide IP address of machine 1 in .env file. For example:

ORDERER_IP=192.168.43.162
CA_IP=192.168.43.162
PEER_IP=192.168.43.162

Then run command

docker-compose -f docker-compose-peer-only.yml build
docker-compose -f docker-compose-peer-only.yml up

Running by Python command

Prerequisites

It needs python, pip to run. Install requirements

pip install -r requirements.txt

Running

In first machine

You need to run 4 app orderer.py certificate_authority.py peer.py vosy.py ( if you don't need front-end in this machine, you don't need to run vosy.py) . You can run each app on different machines but need to provide ip address for it.

python bcb_server/orderer.py

Certificate authority need to know aleast 1 orderer. so if is not default value 0.0.0.0, you need to pass orderer ip address to certificate_authority by argument --orderer

python bcb_server/certificate_authority.py

Peer need to know aleast 1 orderer and 1 certificate_authority so you need to pass orderer ip address and ca ip address to peer by argument --orderer and --ca

python bcb_server/peer.py

Vosy need to know aleast 1 peer so you need to pass peer ip address to vosy app by argument --host

python vosy_app/vosy.py
for example, with window users, ip address 0.0.0.0 is not available, so you need to run in 127.0.0.1 instead, so you have to follow this command in 4 cmd:
python bcb_server/orderer.py
python bcb_server/certificate_authority.py --orderer 127.0.0.1
python bcb_server/peer.py --orderer 127.0.0.1 --ca 127.0.0.1
python vosy_app/vosy.py --host 127.0.0.1
In second machine

You just need to run peer.py and vosy.py but you need to provide Lan IP address orderer.py and certificate_authority.py run in machine 1. In my case, it is 192.168.43.162

python bcb_server/peer.py --orderer 192.168.43.162 --ca 192.168.43.162
python vosy_app/vosy.py

this vosy will auto connect to local peer in address 0.0.0.0:5000

Tutorial

You can see video demo, or tutorials part 1, part 2(not ready now).

It is simple architecture of my network

alt tag

alt tag

Certificate Authority

It can validate connection when a node ask to join to network and Set permission for each node and validate transaction

Orderer

It can hold a list of peers and broadcast to all peer when receive a request broadcast new block or new transaction. It also have consensus method, which can return the longest blockchain in the network

Peer

It hold all data about blockchain, it have some method like mine, validate_transaction, return chain, open surveys, ...

Vosy

A blockchain-based application for voting system

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].